/* 🎨 ESTILOS AVANÇADOS - Modal de Usuários GEEMWEB */

/* ============ MODAL CONTAINER ============ */
#usuarios-modal {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.usuarios-modal-content {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ============ MODAL HEADER ============ */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ============ TABS ============ */
.modal-tabs {
    display: flex;
    background: white;
    border-bottom: 2px solid #e8eef7;
    padding: 0 32px;
    gap: 8px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 16px 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #8892b0;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* ============ CONTEÚDO ============ */
.aba-conteudo {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    animation: fadeIn 0.3s ease;
}

.aba-conteudo.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ TOOLBAR ============ */
.usuarios-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px solid #e8eef7;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

/* ============ TABELA ============ */
.usuarios-tabela-container {
    flex: 1;
    overflow: auto;
    background: white;
    border-radius: 12px;
    border: 1px solid #e8eef7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.usuarios-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.usuarios-tabela thead {
    background: linear-gradient(135deg, #f5f7fa 0%, #eef2f9 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.usuarios-tabela th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    color: #667eea;
    border-bottom: 2px solid #e8eef7;
    letter-spacing: 0.5px;
}

.usuarios-tabela td {
    padding: 16px;
    border-bottom: 1px solid #f0f4f9;
    color: #44546f;
}

.usuarios-tabela tbody tr {
    transition: all 0.2s ease;
}

.usuarios-tabela tbody tr:hover {
    background: #f8fafc;
}

.usuarios-tabela tbody tr:last-child td {
    border-bottom: none;
}

.status {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    display: inline-block;
}

.status.ativo {
    background: #d4edda;
    color: #155724;
}

.status.inativo {
    background: #f8d7da;
    color: #721c24;
}

/* ============ BOTÕES NA TABELA ============ */
.btn-small {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-right: 6px;
    background: #e8eef7;
    color: #667eea;
}

.btn-small:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-small.btn-danger {
    color: #dc3545;
    background: #f8d7da;
}

.btn-small.btn-danger:hover {
    background: #dc3545;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* ============ FORMULÁRIO ============ */
#usuarios-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#form-titulo {
    margin: 0 0 16px 0;
    font-size: 22px;
    font-weight: 700;
    color: #667eea;
    letter-spacing: -0.5px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #44546f;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 14px;
    border: 2px solid #e8eef7;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: #f8fafc;
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.form-group.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.form-group.checkbox label {
    margin: 0;
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input {
    flex: 1;
}

.btn-small-form {
    padding: 10px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-small-form:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ============ BOTÕES DE AÇÃO ============ */
.form-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #e8eef7;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn.btn-secondary {
    background: #e8eef7;
    color: #667eea;
}

.btn.btn-secondary:hover {
    background: #d0daf0;
    transform: translateY(-2px);
}

.btn.btn-block {
    width: 100%;
    justify-content: center;
}

.btn.btn-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 100;
}

/* ============ RESPONSIVO ============ */
@media (max-width: 768px) {
    .usuarios-modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .modal-tabs {
        padding: 0 20px;
    }
    
    .aba-conteudo {
        padding: 16px 20px;
    }
    
    .usuarios-toolbar {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .usuarios-tabela {
        font-size: 12px;
    }
    
    .usuarios-tabela th,
    .usuarios-tabela td {
        padding: 12px;
    }
    
    .btn-small {
        padding: 6px 10px;
        font-size: 12px;
        margin-right: 4px;
    }
}

/* ============ ANIMAÇÕES ============ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.usuarios-modal-content {
    animation: slideIn 0.3s ease;
}

/* ============ LOADING ============ */
.loading-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.spinner {
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
}

/* ============ SCROLLBAR ============ */
.usuarios-tabela-container::-webkit-scrollbar {
    width: 8px;
}

.usuarios-tabela-container::-webkit-scrollbar-track {
    background: #f0f4f9;
}

.usuarios-tabela-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.usuarios-tabela-container::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}
