/* ============================================================
   FAERI Media Gallery — Base Styles
   ============================================================ */

:root {
    --primary: #0c0e49;
    --primary-dark: #080a35;
    --primary-light: #e8e8f5;
    --secondary: #191919;
    --accent: #fc9a1e;
    --accent-red: #d72323;
    --accent-red-dark: #850101;
    --accent-gold: #e9a754;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.2s ease;
    --font: 'Muli', 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Rajdhani', 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font); color: var(--gray-800); background: var(--gray-50);
    line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-red-dark); }

/* Container */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* Typography */
h1, h2, h3, h4 {
    line-height: 1.3; color: var(--gray-900);
    font-family: var(--font-heading);
    letter-spacing: -0.01em;
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.625rem 1.25rem; border: none; border-radius: var(--radius);
    font-family: var(--font); font-size: 0.875rem; font-weight: 500;
    cursor: pointer; transition: all var(--transition); text-decoration: none; line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent-red); color: var(--white); }
.btn-primary:hover { background: var(--accent-red-dark); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; color: var(--white); }
.btn-outline { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { border-color: var(--accent-red); color: var(--accent-red); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.375rem; font-size: 0.875rem; color: var(--gray-700); }
.form-group input[type="text"],
.form-group input[type="search"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%; padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300); border-radius: var(--radius);
    font-family: var(--font); font-size: 0.9375rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--white);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(215,35,35,.15);
}
.form-group textarea { resize: vertical; }
.form-group small { color: var(--gray-500); }
.form-group .required { color: var(--danger); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group-lg { grid-column: 1 / -1; }
.form-fieldset {
    border: 1px solid var(--gray-200); border-radius: var(--radius);
    padding: 1.25rem; margin-bottom: 1rem;
}
.form-fieldset legend {
    font-weight: 600; font-size: 0.9375rem; padding: 0 0.5rem;
    color: var(--gray-700);
}
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 1.125rem; height: 1.125rem; accent-color: var(--accent-red); }

/* Flash Messages */
.flash-message {
    padding: 0.875rem 1rem; font-size: 0.9375rem;
    display: flex; align-items: center; justify-content: space-between;
}
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-warning { background: #fef3c7; color: #92400e; }
.flash-close {
    background: none; border: none; font-size: 1.25rem; cursor: pointer;
    color: inherit; opacity: 0.7; padding: 0 0.5rem;
}
.flash-close:hover { opacity: 1; }

/* Badges */
.badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px;
    font-size: 0.75rem; font-weight: 500; text-transform: capitalize;
}
.badge-image { background: var(--primary-light); color: var(--primary); }
.badge-video { background: #fce7f3; color: #9d174d; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-muted { background: var(--gray-200); color: var(--gray-600); }

/* Cards */
.card {
    background: var(--white); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); overflow: hidden;
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-100);
}
.card-header h2 { font-size: 1.125rem; }
.card-body { padding: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }

/* Tables */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th, .data-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--gray-100); }
.data-table th { font-weight: 600; color: var(--gray-600); background: var(--gray-50); white-space: nowrap; }
.data-table tr:hover td { background: var(--gray-50); }
.table-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 4px; }
.table-thumb-video {
    width: 56px; height: 42px; background: var(--gray-200);
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px; color: var(--gray-500); font-size: 1.25rem;
}
.actions-cell { white-space: nowrap; display: flex; gap: 0.375rem; }

/* Pagination */
.pagination { display: flex; gap: 0.375rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pagination-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: var(--radius);
    font-size: 0.875rem; font-weight: 500;
    border: 1px solid var(--gray-300); color: var(--gray-700);
    text-decoration: none; transition: all var(--transition);
}
.pagination-link:hover { border-color: var(--accent-red); color: var(--accent-red); }
.pagination-link.active { background: var(--accent-red); border-color: var(--accent-red); color: var(--white); }

/* Breadcrumb */
.breadcrumb {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 1rem 0; font-size: 0.875rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--accent-red); }
.breadcrumb-sep { color: var(--gray-400); }
.breadcrumb-current { color: var(--gray-800); font-weight: 500; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal-dialog {
    position: relative; background: var(--white); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; margin: 1rem;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 1.125rem; }
.modal-close, .modal-close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray-500); }
.modal-body { padding: 1.5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--gray-100); }

/* Spinner */
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--gray-200); border-top-color: var(--accent-red);
    border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Utilities */
.text-muted { color: var(--gray-500); }
.not-found { text-align: center; padding: 4rem 1rem; }
.not-found h2 { margin-bottom: 1rem; }
.not-found .btn { margin-top: 1.5rem; }
.page-heading { font-size: 1.75rem; margin-bottom: 0.5rem; }
.page-subheading { color: var(--gray-500); margin-bottom: 2rem; }
.section-title { font-size: 1.375rem; margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .container { padding: 0 1rem; }
}
