/* ===================================================
   E-Modul Microlearning Interaktif - Main CSS
   Modern & Elegant Design
   =================================================== */

/* Font & Reset */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-darker: #1e40af;
    --primary-light: #eff6ff;
    --primary-lighter: #dbeafe;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
    --primary-gradient-soft: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fef2f2;
    --info: #3b82f6;
    --info-light: #eff6ff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-primary: 0 4px 14px rgba(37, 99, 235, 0.3);
    --shadow-primary-lg: 0 8px 30px rgba(37, 99, 235, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===================================================
   GLASSMORPHISM UTILITY
   =================================================== */

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* ===================================================
   NAVBAR
   =================================================== */

.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.navbar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-link {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.navbar-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
}

.navbar-link i {
    font-size: 16px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.navbar-toggle:hover {
    background: var(--bg-secondary);
}

/* ===================================================
   MAIN CONTENT
   =================================================== */

.main-content {
    flex: 1;
}

/* ===================================================
   BUTTONS
   =================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    font-family: var(--font);
    line-height: 1;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-lg);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-xs);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-xl {
    padding: 18px 40px;
    font-size: 18px;
    border-radius: var(--radius);
}

.btn-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fde68a;
}

.btn-warning:hover {
    background: #fde68a;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--error-light);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #fecaca;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.btn-success:hover {
    background: #a7f3d0;
    transform: translateY(-1px);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
}

/* ===================================================
   DASHBOARD
   =================================================== */

.dashboard-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 36px;
    gap: 20px;
    flex-wrap: wrap;
}

.dashboard-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.dashboard-header h1 i {
    color: var(--primary);
    margin-right: 8px;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 0;
}

.dashboard-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--bg);
    padding: 16px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-group i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.filter-group input,
.filter-group select {
    padding: 10px 14px 10px 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg);
    transition: var(--transition);
    min-width: 220px;
    font-family: var(--font);
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.filter-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* ===================================================
   STATS GRID
   =================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
}

.stat-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 18px;
    background: inherit;
    opacity: 0.15;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* ===================================================
   IMAGE GRID - DASHBOARD
   =================================================== */

.image-grid-dashboard {
    display: grid;
    gap: 24px;
}

.image-card-dashboard {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    display: flex;
    transition: var(--transition);
    position: relative;
}

.image-card-dashboard:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-thumbnail {
    width: 300px;
    min-width: 240px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-card-dashboard:hover .card-thumbnail img {
    transform: scale(1.08);
}

.card-stats-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    padding: 48px 16px 14px;
    display: flex;
    gap: 20px;
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.card-stats-overlay span {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.card-stats-overlay span i {
    font-size: 14px;
}

.card-body {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.card-header-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.card-header-info h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.badge-materi {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
    white-space: nowrap;
    border: 1px solid var(--primary-lighter);
}

.badge-materi i {
    font-size: 11px;
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px;
    line-height: 1.6;
    flex: 1;
}

.card-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-meta span i {
    font-size: 14px;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.card-actions .btn {
    font-size: 13px;
}

/* ===================================================
   PAGINATION
   =================================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}

.page-link {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    min-width: 44px;
    text-align: center;
}

.page-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.page-link.active {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
}

/* ===================================================
   EMPTY STATE
   =================================================== */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: var(--border);
    display: block;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 0 10px;
}

.empty-state p {
    font-size: 15px;
    margin: 0 0 28px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ===================================================
   TOAST NOTIFICATION
   =================================================== */

.toast {
    position: fixed;
    top: 88px;
    right: 24px;
    z-index: 9999;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    max-width: 420px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

.toast-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    color: white;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-content i {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

@keyframes slideInRight {
    from { 
        transform: translateX(100%) scale(0.9); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0) scale(1); 
        opacity: 1; 
    }
}

@keyframes slideOutRight {
    from { 
        transform: translateX(0) scale(1); 
        opacity: 1; 
    }
    to { 
        transform: translateX(100%) scale(0.9); 
        opacity: 0; 
    }
}

/* ===================================================
   FOOTER
   =================================================== */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: 24px 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===================================================
   FORM ELEMENTS
   =================================================== */

.form-container {
    max-width: 700px;
    margin: 0 auto;
}

.upload-form {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group .required {
    color: var(--error);
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: var(--transition);
    background: var(--bg);
    box-sizing: border-box;
    font-family: var(--font);
    color: var(--text);
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: var(--bg);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
    position: relative;
}

.file-upload:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.01);
}

.file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-placeholder i {
    font-size: 56px;
    color: var(--primary);
    margin-bottom: 16px;
    display: block;
}

.file-upload-placeholder p {
    font-size: 16px;
    color: var(--text);
    margin: 0 0 8px;
    font-weight: 600;
}

.file-upload-placeholder span {
    font-size: 13px;
    color: var(--text-muted);
}

.file-upload-preview {
    text-align: center;
}

.file-upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

/* Alert */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-error {
    background: var(--error-light);
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background: var(--success-light);
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-info {
    background: var(--info-light);
    border: 1px solid var(--primary-lighter);
    color: var(--primary-darker);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* Current Image */
.current-image {
    margin-bottom: 8px;
}

.current-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* ===================================================
   SKELETON LOADING
   =================================================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-xs);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===================================================
   SCROLLBAR
   =================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===================================================
   ANIMATIONS
   =================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease forwards;
}

/* Stagger animation for cards */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.5s; }

/* ===================================================
   RESPONSIVE
   =================================================== */

@media (max-width: 1024px) {
    .image-card-dashboard {
        flex-direction: column;
    }
    .card-thumbnail {
        width: 100%;
        height: 220px;
    }
    .dashboard-container {
        padding: 28px 20px;
    }
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .navbar-menu {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        padding: 20px 24px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    }
    .navbar-menu.active {
        display: flex;
    }
    .navbar-user {
        flex-direction: column;
        align-items: stretch;
        border-left: none;
        padding-left: 0;
        padding-top: 16px;
        margin-top: 12px;
        border-top: 1px solid var(--border);
    }
    .navbar-user .btn {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    .dashboard-header {
        flex-direction: column;
    }
    .dashboard-header h1 {
        font-size: 26px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .filter-group input,
    .filter-group select {
        min-width: 160px;
    }
    .card-actions {
        flex-direction: column;
    }
    .card-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .upload-form {
        padding: 24px;
    }
    .form-actions {
        flex-direction: column;
    }
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 20px 16px;
    }
    .filter-group input,
    .filter-group select {
        min-width: 100%;
    }
    .dashboard-filter {
        flex-direction: column;
        padding: 12px 16px;
    }
    .dashboard-filter .btn {
        width: 100%;
        justify-content: center;
    }
    .navbar-container {
        padding: 0 16px;
    }
    .navbar-brand {
        font-size: 18px;
    }
    .navbar-brand .brand-icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
    .toast {
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

/* ===================================================
   HOMEPAGE (index.php)
   =================================================== */

.hero-section {
    text-align: center;
    padding: 60px 20px 40px;
    max-width: 700px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.hero-section h1 span {
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.hero-stats-wrap {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.hero-stats-wrap .hs-item {
    text-align: center;
}

.hero-stats-wrap .hs-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.hero-stats-wrap .hs-lbl {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.page-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Filter Tabs */
.filter-section {
    margin-bottom: 28px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto;
}

.filter-tabs a {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
}

.filter-tabs a:hover {
    background: var(--bg-secondary);
}

.filter-tabs a.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.search-bar {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.search-bar .input-wrap {
    flex: 1;
    position: relative;
}

.search-bar .input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar .input-wrap input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.search-bar .input-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-bar .btn-search {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
}

.search-bar .btn-search:hover {
    background: var(--primary-dark);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.media-card {
    background: var(--bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    text-decoration: none;
    display: block;
    border-top: 3px solid var(--card-accent, #2563eb);
    position: relative;
}
.media-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px color-mix(in srgb, var(--card-accent, #2563eb) 25%, rgba(0,0,0,0.08));
    border-color: var(--card-accent, #2563eb);
}
.media-card .card-thumb {
    position: relative;
    background: color-mix(in srgb, var(--card-accent, #2563eb) 15%, var(--bg-tertiary));
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.media-card .card-body {
    padding: 14px 16px;
    background: color-mix(in srgb, var(--card-accent, #2563eb) 6%, var(--bg));
}
.media-card .card-thumb .type-badge-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--card-accent, #2563eb) !important;
    color: white;
    backdrop-filter: blur(4px);
}
.media-card .card-thumb .thumb-icon {
    color: var(--card-accent, #2563eb);
    opacity: 0.5;
}
.media-card .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.media-card .card-body .card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-card .card-body .card-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.media-card .card-body .card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Homepage Pagination */
.homepage-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 20px 0 40px;
}

.homepage-pagination a {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.homepage-pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.homepage-pagination a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.empty-state-home {
    margin-bottom: 40px;
}

/* Responsive Homepage */
@media (max-width: 1024px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .page-container { padding: 0 16px; }
    .hero-section h1 { font-size: 28px; }
    .hero-stats-wrap { gap: 20px; }
    .search-bar { flex-direction: column; }
    .search-bar .btn-search { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .hero-section h1 { font-size: 24px; }
    .hero-section { padding: 40px 16px 28px; }
}
