/* =================================================================
   EL Services - CSS Principal
   Arquivo: static/css/main.css
================================================================= */

/* ================= VARIÁVEIS CSS ================= */
:root {
    /* Cores Primárias */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #4b64a2 100%);
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #a3bffa;

    /* Cores Secundárias */
    --secondary-color: #4b59a2;
    --accent-color: #f093fb;

    /* Cores de Estado */
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --info-color: #4299e1;

    /* Cores de Status das Sessões */
    --status-standby: rgba(211, 211, 211, 0.7);
    --status-pending: rgba(255, 204, 203, 0.7);
    --status-processing: rgba(173, 216, 230, 0.7);
    --status-emitted: rgba(144, 238, 144, 0.7);
    --status-advance: rgba(255, 250, 205, 0.7);

    /* Cores Neutras */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transições */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

/* ================= ESTILOS GLOBAIS ================= */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

/* ================= COMPONENTES DE CARD ================= */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    background: white;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-elevated {
    box-shadow: var(--shadow-xl);
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--gray-100);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    padding: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* ================= GRADIENTES ================= */
.bg-gradient-primary {
    background: var(--primary-gradient);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

/* ================= ÍCONES ================= */
.icon-shape {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all var(--transition-normal);
}

.icon-shape i {
    color: white;
    font-size: 1.25rem;
}

.icon-shape:hover {
    transform: scale(1.1);
}

/* ================= BOTÕES ================= */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    transition: all var(--transition-normal);
    border: none;
    padding: 0.75rem 1.5rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #4b64a2 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ================= FORMULÁRIOS ================= */
.form-control {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    transition: all var(--transition-normal);
    background: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-floating .form-control {
    padding: 1rem 1rem 0.25rem;
}

/* ================= NAVBAR ================= */
.navbar {
    background: var(--primary-gradient) !important;
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all var(--transition-normal);
    border-radius: var(--radius);
    margin: 0 0.25rem;
    padding: 0.5rem 1rem !important;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-item .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.7rem;
}

/* ================= DROPDOWN ================= */
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(2px);
}

/* ================= STATUS DE SESSÕES ================= */
.status-Standby {
    background-color: var(--status-standby);
    color: var(--gray-700);
}
.status-Pending {
    background-color: var(--status-pending);
    color: var(--gray-800);
}
.status-Processing {
    background-color: var(--status-processing);
    color: var(--gray-800);
}
.status-Emitted {
    background-color: var(--status-emitted);
    color: var(--gray-800);
}
.status-Advance_Issuance {
    background-color: var(--status-advance);
    color: var(--gray-800);
}

/* ================= BADGES ================= */
.badge {
    border-radius: var(--radius);
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.pending-sessions-count {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* ================= TABELAS ================= */
.table {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table thead th {
    background: var(--gray-50);
    border: none;
    font-weight: 600;
    color: var(--gray-700);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-color: var(--gray-100);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* ================= ALERTAS ================= */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    border-left-color: var(--success-color);
    color: #22543d;
}

.alert-danger {
    background: rgba(245, 101, 101, 0.1);
    border-left-color: var(--danger-color);
    color: #742a2a;
}

.alert-warning {
    background: rgba(237, 137, 54, 0.1);
    border-left-color: var(--warning-color);
    color: #7b341e;
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    border-left-color: var(--info-color);
    color: #2c5282;
}

/* ================= MODAIS ================= */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border: none;
}

.modal-footer {
    border: none;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ================= LOADING SPINNER ================= */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

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

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ================= LOGIN PAGE ================= */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #4b64a2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    backdrop-filter: blur(10px);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h1 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-logo p {
    color: var(--gray-600);
    font-size: 1rem;
}

/* ================= RESPONSIVIDADE ================= */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }

    .navbar-nav {
        text-align: center;
        margin-top: 1rem;
    }

    .login-card {
        margin: 1rem;
        padding: 2rem;
    }

    .container-fluid {
        padding: 1rem;
    }
}

/* ================= UTILITÁRIOS ================= */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hover-lift {
    transition: transform var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-3px);
}
