/* Cliente DB - Estilos */
* {
    box-sizing: border-box;
}

#cliente-db-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

/* Login Screen */
.cdb-login-box {
    max-width: 400px;
    margin: 100px auto;
    background: #1a1a1a;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
}

.cdb-login-box h2 {
    text-align: center;
    color: #00ff00;
    margin-bottom: 10px;
}

.cdb-login-box p {
    text-align: center;
    color: #888;
    margin-bottom: 30px;
}

.cdb-login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 16px;
}

.cdb-login-box input:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 0 2px rgba(0, 255, 0, 0.1);
}

/* Header */
.cdb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.cdb-header h1 {
    color: #00ff00;
    margin: 0;
    font-size: 28px;
}

.cdb-header-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.cdb-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cdb-btn-primary {
    background: #00ff00;
    color: #0a0a0a;
}

.cdb-btn-primary:hover {
    background: #00cc00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
}

.cdb-btn-success {
    background: #00ff00;
    color: #0a0a0a;
}

.cdb-btn-success:hover {
    background: #00cc00;
}

.cdb-btn-danger {
    background: #ff3333;
    color: white;
}

.cdb-btn-danger:hover {
    background: #cc0000;
}

.cdb-btn-install {
    background: linear-gradient(135deg, #00ff00, #00cc00);
    color: #0a0a0a;
    animation: pulse 2s infinite;
}

.cdb-btn-install:hover {
    background: linear-gradient(135deg, #00cc00, #009900);
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 255, 0, 0);
    }
}

.cdb-btn-secondary {
    background: #333;
    color: #e0e0e0;
}

.cdb-btn-secondary:hover {
    background: #444;
}

/* Search */
.cdb-search {
    margin-bottom: 25px;
}

.cdb-search input {
    width: 100%;
    padding: 12px 20px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 16px;
}

.cdb-search input:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 0 2px rgba(0, 255, 0, 0.1);
}

/* Lista de Clientes */
.cdb-clientes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.cdb-cliente-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cdb-cliente-card:hover {
    border-color: #00ff00;
    box-shadow: 0 4px 16px rgba(0, 255, 0, 0.2);
    transform: translateY(-2px);
}

.cdb-cliente-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.cdb-cliente-foto {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00ff00;
    flex-shrink: 0;
}

.cdb-cliente-foto-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #666;
    flex-shrink: 0;
}

.cdb-cliente-info h3 {
    margin: 0 0 5px 0;
    color: #00ff00;
    font-size: 18px;
}

.cdb-cliente-info p {
    margin: 0;
    color: #888;
    font-size: 14px;
}

.cdb-cliente-details {
    border-top: 1px solid #333;
    padding-top: 15px;
}

.cdb-cliente-detail-item {
    margin-bottom: 8px;
    font-size: 14px;
}

.cdb-cliente-detail-item strong {
    color: #00ff00;
    font-weight: 600;
}

/* Modal */
.cdb-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.cdb-modal-content {
    background-color: #1a1a1a;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #00ff00;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 255, 0, 0.2);
}

.cdb-modal-header {
    background: #0a0a0a;
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cdb-modal-header h2 {
    margin: 0;
    color: #00ff00;
}

.cdb-close, .cdb-close-view {
    color: #888;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.cdb-close:hover, .cdb-close-view:hover {
    color: #00ff00;
}

.cdb-modal-body {
    padding: 30px;
}

.cdb-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

/* Form */
.cdb-form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    margin-bottom: 25px;
}

.cdb-foto-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.cdb-foto-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #00ff00;
    background: #0a0a0a;
    position: relative;
}

.cdb-foto-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.cdb-foto-preview img.loaded {
    display: block;
}

#foto-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: #333;
}

.cdb-form-fields {
    flex: 1;
}

.cdb-form-group {
    margin-bottom: 20px;
}

.cdb-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #00ff00;
    font-weight: 600;
    font-size: 14px;
}

.cdb-form-group input,
.cdb-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
}

.cdb-form-group input:focus,
.cdb-form-group textarea:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 0 2px rgba(0, 255, 0, 0.1);
}

.cdb-form-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #333;
}

.cdb-form-section h3 {
    color: #00ff00;
    margin-bottom: 20px;
    font-size: 18px;
}

/* Loading */
.cdb-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.cdb-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top: 4px solid #00ff00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Messages */
.cdb-error {
    color: #ff3333;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

/* Empty State */
.cdb-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.cdb-empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Detalhes do Cliente (Modal de Visualização) */
#cliente-details {
    color: #e0e0e0;
}

.cdb-detail-section {
    margin-bottom: 30px;
}

.cdb-detail-section h3 {
    color: #00ff00;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.cdb-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
}

.cdb-detail-foto-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #00ff00;
    flex-shrink: 0;
}

.cdb-detail-foto-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: #666;
    flex-shrink: 0;
}

.cdb-detail-info {
    flex: 1;
}

.cdb-detail-item {
    margin-bottom: 12px;
}

.cdb-detail-item strong {
    color: #00ff00;
    display: inline-block;
    min-width: 120px;
    font-weight: 600;
}

/* Responsividade */
@media (max-width: 768px) {
    .cdb-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cdb-header h1 {
        font-size: 22px;
    }
    
    .cdb-clientes-list {
        grid-template-columns: 1fr;
    }
    
    .cdb-form-row {
        grid-template-columns: 1fr;
    }
    
    .cdb-foto-section {
        flex-direction: row;
        justify-content: center;
    }
    
    .cdb-modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .cdb-detail-row {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    #cliente-db-app {
        padding: 10px;
    }
    
    .cdb-modal-body {
        padding: 20px;
    }
    
    .cdb-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}
