/* Modern Custom Styles for Aplikasi Jadwal Guru */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-50: #ecfdf5;
    --primary-100: #d1fae5;
    --primary-200: #a7f3d0;
    --primary-300: #6ee7b7;
    --primary-400: #34d399;
    --primary-500: #10b981;
    --primary-600: #059669;
    --primary-700: #047857;
    --primary-800: #065f46;
    --primary-900: #064e3b;
    
    --bg-body: #f0fdf4;
    --bg-sidebar: linear-gradient(180deg, #065f46 0%, #047857 100%);
    --bg-card: #ffffff;
    --text-primary: #064e3b;
    --text-secondary: #64748b;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    overflow: hidden;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Sidebar Styles */
.sidebar {
    min-height: 100vh;
    max-height: 100vh;
    background: var(--bg-sidebar);
    box-shadow: 4px 0 30px rgba(6, 95, 70, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sidebar-logo i {
    font-size: 2.1rem;
    color: var(--primary-300);
}

.sidebar-menu-wrapper {
    overflow-y: auto;
    flex-grow: 1;
    padding: 1rem 1rem 2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}

.sidebar-menu-wrapper::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu-wrapper::-webkit-scrollbar-track {
    background: transparent;
    margin: 0.5rem 0;
}

.sidebar-menu-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.25);
    border-radius: 10px;
    transition: background-color 0.3s;
}

.sidebar-menu-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255,255,255,0.4);
}

.sidebar.collapsed {
    width: 80px !important;
}

.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .section-title {
    display: none;
}

.sidebar.collapsed .sidebar-logo span {
    display: none;
}

.sidebar.collapsed .sidebar-menu-wrapper {
    padding: 1rem 0.5rem 2rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.82);
    padding: 0.85rem 1.1rem;
    margin: 0.3rem 0;
    border-radius: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    font-weight: 500;
    letter-spacing: 0.01em;
    font-size: 0.92rem;
}

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

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.14);
    color: white;
    transform: translateX(3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.1) 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-left: 3px solid var(--primary-300);
}

.section-title {
    color: rgba(255,255,255,0.55);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 1.2rem 1.1rem 0.6rem;
    margin-top: 0.8rem;
}

/* Navbar Styles */
.navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 18px rgba(6, 95, 70, 0.06);
    border-bottom: 1px solid rgba(16, 185, 129, 0.08);
    padding: 0.9rem 1.5rem;
}

.navbar .btn-outline-secondary {
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--primary-700);
    transition: all 0.3s;
}

.navbar .btn-outline-secondary:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary-800);
}

.navbar .dropdown-toggle {
    border: 1px solid rgba(16, 185, 129, 0.12);
    background: rgba(209, 250, 229, 0.35);
    color: var(--primary-800);
    font-weight: 500;
}

.navbar .dropdown-toggle:hover {
    background: var(--primary-100);
    border-color: var(--primary-300);
}

/* Main Content Styles */
.main-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: var(--bg-body);
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--primary-200);
    border-radius: 10px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-300);
}

/* Card Styles */
.card {
    border: none;
    border-radius: 1.1rem;
    box-shadow: 0 5px 25px rgba(6, 95, 70, 0.06);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-card);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 12px 40px rgba(6, 95, 70, 0.12);
    transform: translateY(-4px);
}

.card-header {
    background: linear-gradient(90deg, rgba(209,250,229,0.5) 0%, rgba(167,243,208,0.3) 100%);
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    padding: 1rem 1.5rem;
}

.card-header h5 {
    color: var(--primary-800);
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    color: white;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.35);
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 14px 45px rgba(16, 185, 129, 0.45);
}

.stat-card .icon {
    font-size: 2.9rem;
    opacity: 0.9;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    border: none;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    padding: 0.65rem 1.4rem;
    border-radius: 0.75rem;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 100%);
    box-shadow: 0 7px 20px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

.btn-primary:focus,
.btn-primary:active {
    box-shadow: 0 0 0 0.35rem rgba(16, 185, 129, 0.25);
}

/* Table Styles */
.table thead {
    background: linear-gradient(90deg, var(--primary-50) 0%, var(--primary-100) 100%);
}

.table thead th {
    color: var(--primary-800);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    border: none;
    padding: 1rem 1.25rem;
}

.table tbody tr {
    transition: all 0.25s ease;
}

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

.table tbody td {
    padding: 0.9rem 1.25rem;
    vertical-align: middle;
    color: var(--text-primary);
}

/* Form Styles */
.form-control,
.form-select {
    border-radius: 0.7rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.7rem 1rem;
    transition: all 0.3s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 0.3rem rgba(16, 185, 129, 0.15);
}

/* DataTables Custom Styling */
.dataTables_wrapper {
    padding: 0.5rem 0;
}

.dataTables_wrapper .dataTables_length {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 0.6rem;
    border-color: var(--primary-200);
    padding: 0.4rem 0.75rem;
}

.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.6rem;
    border-color: var(--primary-200);
    padding: 0.5rem 1rem;
}

.dataTables_wrapper .paginate_button {
    border-radius: 0.6rem !important;
    margin: 0 0.15rem;
    padding: 0.4rem 0.9rem !important;
}

.dataTables_wrapper .paginate_button.current,
.dataTables_wrapper .paginate_button.current:hover {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700)) !important;
    border-color: transparent !important;
    color: white !important;
}

.dataTables_wrapper .paginate_button:hover {
    background: var(--primary-100) !important;
    border-color: var(--primary-200) !important;
    color: var(--primary-800) !important;
}

.dataTables_wrapper .dataTables_info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(240, 253, 244, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--primary-100) 25%, var(--primary-50) 50%, var(--primary-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Dark Mode (Optional, Updated for Green Theme) */
body.dark-mode {
    --bg-body: #064e3b;
    --bg-card: #065f46;
    --text-primary: #ecfdf5;
    --text-secondary: #a7f3d0;
}

body.dark-mode .card {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

body.dark-mode .sidebar {
    background: linear-gradient(180deg, #022c22 0%, #064e3b 100%);
}

body.dark-mode .table {
    color: var(--text-primary);
}

body.dark-mode .table thead {
    background: linear-gradient(90deg, #065f46 0%, #064e3b 100%);
}

body.dark-mode .table tbody tr:hover {
    background-color: rgba(16, 185, 129, 0.15);
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        z-index: 1050;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .navbar {
        padding: 0.75rem 1rem;
    }
}
