/* Custom CSS for Sistema de Gestão Escolar - Clean & Modern Design */

:root {
    --primary-color: #2563eb;
    --secondary-color: #475569;
    --success-color: #059669;
    --info-color: #0891b2;
    --warning-color: #d97706;
    --danger-color: #dc2626;

    /* Clean Gray Palette */
    --white: #ffffff;
    --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;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    overflow-x: hidden;
}

/* ============ LAYOUT ESTRUTURA ============ */
.app-wrapper {
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--gray-900);
    transition: color 0.2s;
}

.sidebar-brand:hover {
    color: var(--primary-color);
}

.sidebar-logo {
    width: 100px;
    height: auto;
    object-fit: contain;
}

.brand-text-container {
    display: flex;
    flex-direction: column;
}

.brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #2563eb 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    padding: 1.5rem 0;
    flex: 1;
}

/* Dark mode: rolagem roxa "bonita" na sidebar */
html[data-theme="dark"] .sidebar {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-purple) transparent;
}

/* WebKit (Chrome, Edge, Safari) */
html[data-theme="dark"] .sidebar::-webkit-scrollbar {
    width: 10px;
}

html[data-theme="dark"] .sidebar::-webkit-scrollbar-track {
    background: transparent;
}

html[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb {
    background-color: var(--accent-purple);
    border-radius: 8px;
    border: 2px solid transparent;
}

html[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-purple);
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    padding: 0 1.25rem;
    margin-bottom: 0.5rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--gray-50);
    color: var(--gray-900);
    border-left-color: var(--gray-300);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-link .nav-badge {
    margin-left: auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    min-width: 24px;
    height: 22px;
    text-align: center;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.sidebar-nav .nav-link .nav-badge::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
}

html[data-theme="dark"] .sidebar-nav .nav-link .nav-badge {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Active state - pode ser adicionado via JavaScript */
.sidebar-nav .nav-link.active {
    background-color: var(--gray-50);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* Scrollbar customizado */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============ OVERLAY (MOBILE) ============ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============ TOPBAR ============ */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-700);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: none;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    flex: 1;
}

.topbar-actions {
    margin-left: auto !important;
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

.content-wrapper {
    flex: 1;
    padding: 2rem 1.5rem;
    background-color: var(--gray-50);
}

.content-wrapper .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

.messages-container {
    padding: 1rem 0;
}

.main-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 1.5rem;
    margin-top: auto;
}

/* ============ RESPONSIVIDADE ============ */
@media (max-width: 992px) {
    .main-content {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 1.5rem 1rem;
    }

    .topbar {
        padding: 1rem;
    }

    .topbar-title {
        font-size: 1.1rem;
    }
}


/* Cards - Clean Design */
.card {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    transition: all 0.3s ease;
    background-color: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08) !important;
    border-color: var(--gray-300);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    border-bottom: 1px solid var(--gray-200);
    background-color: var(--gray-50);
}

.card-body {
    padding: 1.5rem;
}

/* Clean Stats Cards */
.stats-card {
    border-left: 4px solid var(--gray-400);
    background: linear-gradient(135deg, var(--white) 0%, var(--gray-50) 100%);
}

.stats-card.primary {
    border-left-color: #2563eb;
}

.stats-card.success {
    border-left-color: #059669;
}

.stats-card.info {
    border-left-color: #0891b2;
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,0.03);
    cursor: pointer;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Forms */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.6rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Badges */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 500;
    border-radius: 6px;
}

/* Breadcrumb */
.breadcrumb {
    background-color: white;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

/* Footer */
footer {
    margin-top: auto;
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* Pagination */
.page-link {
    color: var(--primary-color);
    border-radius: 6px;
    margin: 0 3px;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Dashboard Stats Cards */
.card h2 {
    font-weight: 700;
    color: var(--gray-900);
}

.card h6.text-muted {
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-in-out;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.9rem;
    }

    .btn-group-sm > .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
    }
}

/* Custom Utilities */
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
}

.shadow {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

/* Form Validation */
.text-danger {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Navbar Active State */
.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    border-radius: 6px;
}

/* Loading State */
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Table Actions */
.btn-group .btn {
    padding: 0.25rem 0.5rem;
}

/* Icons */
.bi {
    vertical-align: -0.125em;
}
/* Custom Alert Icons */
.alert i.bi {
    font-size: 1.2rem;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* Clean Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s;
}

.btn-outline-primary, .btn-outline-success, .btn-outline-info {
    border-width: 1.5px;
}

/* Clean Table Styles */
.table {
    color: var(--gray-700);
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    background-color: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

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

/* Clean Badge Styles */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 500;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge.bg-secondary {
    background-color: var(--gray-500) !important;
    color: var(--white);
}

/* Section Headers */
h1.display-4 {
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -1px;
}

.lead {
    color: var(--gray-600);
    font-weight: 400;
}

h3 {
    font-weight: 600;
    color: var(--gray-800);
}
