/* ================================================================
   MTG Ibiza - Moxfield-Inspired Clean Theme
   Centralized stylesheet with Light/Dark mode via CSS variables
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Serif:wght@400;600;700&display=swap');

/* ==============================
   CSS VARIABLES - LIGHT THEME (DEFAULT)
   ============================== */
:root {
    /* Backgrounds */
    --bg-body: #f0f1f4;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f7f8fa;
    --bg-elevated: #ffffff;
    --bg-nav: #ffffff;
    --bg-hover: #edeef2;
    --bg-active: #e2e4e9;
    --bg-input: #f7f8fa;
    --bg-overlay: rgba(0, 0, 0, 0.5);

    /* Text */
    --text-primary: #1a1c23;
    --text-secondary: #4a4d5c;
    --text-muted: #7c7f8e;
    --text-faint: #a0a3b0;
    --text-on-accent: #ffffff;

    /* Borders */
    --border: #dfe1e6;
    --border-hover: #c5c8d0;
    --border-focus: var(--accent);

    /* Accent (MTG Ibiza purple) */
    --accent: #6c5ce7;
    --accent-hover: #5a4bd1;
    --accent-light: rgba(108, 92, 231, 0.1);
    --accent-medium: rgba(108, 92, 231, 0.2);
    --accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #5b4cdb 100%);

    /* Gold accent */
    --gold: #c8a84e;
    --gold-light: rgba(200, 168, 78, 0.15);

    /* Semantic colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.06), 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.08), 0 8px 10px rgba(0, 0, 0, 0.04);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Noto Serif', Georgia, serif;

    /* Layout */
    --nav-height: 48px;
    --container-max: 1200px;

    /* Role colors */
    --role-0: #6b7280;
    --role-1: #3b82f6;
    --role-2: #22c55e;
    --role-3: #8b5cf6;
    --role-10: #f59e0b;
    --role-20: #ec4899;
    --role-4: #a855f7;
    --role-5: #eab308;

    /* Scrollbar */
    --scrollbar-track: #edeef2;
    --scrollbar-thumb: #c5c8d0;
    --scrollbar-thumb-hover: #a0a3b0;
}

/* ==============================
   CSS VARIABLES - DARK THEME
   ============================== */
[data-theme="dark"] {
    --bg-body: #0f1117;
    --bg-surface: #181a24;
    --bg-surface-alt: #1e2130;
    --bg-elevated: #222538;
    --bg-nav: #141620;
    --bg-hover: #252840;
    --bg-active: #2e3250;
    --bg-input: #1a1d2a;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    --text-primary: #e2e5ee;
    --text-secondary: #a0a6b8;
    --text-muted: #6e7488;
    --text-faint: #4a4f60;
    --text-on-accent: #ffffff;

    --border: #2a2d40;
    --border-hover: #3a3e55;
    --border-focus: var(--accent);

    --accent: #8b7cf6;
    --accent-hover: #a59bfa;
    --accent-light: rgba(139, 124, 246, 0.12);
    --accent-medium: rgba(139, 124, 246, 0.22);
    --accent-gradient: linear-gradient(135deg, #8b7cf6 0%, #7c6ce7 100%);

    --gold: #daa520;
    --gold-light: rgba(218, 165, 32, 0.15);

    --success-bg: rgba(34, 197, 94, 0.15);
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning-bg: rgba(245, 158, 11, 0.15);
    --info-bg: rgba(59, 130, 246, 0.15);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4);

    --scrollbar-track: #181a24;
    --scrollbar-thumb: #2e3250;
    --scrollbar-thumb-hover: #3e4268;
}

/* ==============================
   RESET & BASE
   ============================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--nav-height);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
    display: none;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

/* ==============================
   TYPOGRAPHY
   ============================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    line-height: 1.3;
}

.page-title {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.2px;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.golden-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-sans);
    font-weight: 700;
}

.section-title {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
    letter-spacing: -0.2px;
}

/* ==============================
   CONTAINER
   ============================== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==============================
   NAVBAR
   ============================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-inner {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
    gap: 0.5rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.navbar-brand-img {
    height: 26px !important;
    width: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.navbar-brand-text {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    flex: 1;
    overflow: visible;
    flex-wrap: wrap;
}

.navbar-link {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.navbar-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.navbar-link.active {
    background: var(--accent-light);
    color: var(--accent);
}

.navbar-link-icon {
    font-size: 1rem;
    line-height: 1;
}

.navbar-separator {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 0.25rem;
    flex-shrink: 0;
}

/* Navbar dropdowns */
.navbar-dropdown {
    position: relative;
    flex-shrink: 0;
}

.navbar-dropdown-toggle {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.navbar-dropdown-toggle.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.navbar-dropdown-arrow {
    font-size: 0.65rem;
    margin-left: 0.1rem;
    opacity: 0.6;
}

.navbar-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 190px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    z-index: 1100;
}

.navbar-dropdown-menu.open {
    display: block;
}

.navbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.navbar-dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.navbar-dropdown-item .navbar-link-icon {
    font-size: 1rem;
}

.navbar-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

.navbar-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.navbar-user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.1rem 0.4rem;
    background: var(--accent-light);
    border-radius: 10px;
}

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-surface-alt);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* Hamburger */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-surface-alt);
    cursor: pointer;
    padding: 6px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.navbar-toggle:hover {
    background: var(--bg-hover);
}

.navbar-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: all 0.2s ease;
}

.navbar-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.navbar-toggle.open span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile menu */
.navbar-mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem;
    z-index: 999;
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
}

.navbar-mobile-menu.open {
    display: block;
}

.navbar-mobile-menu .navbar-link {
    display: flex;
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}

.navbar-mobile-menu .navbar-separator {
    width: 100%;
    height: 1px;
    margin: 0.35rem 0;
}

/* ==============================
   BUTTONS
   ============================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-on-accent);
    border-color: var(--accent);
    box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-surface-alt);
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    filter: brightness(1.1);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Backward compat: .magic-button */
.magic-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    background: var(--accent-gradient);
    border: 1px solid var(--accent);
    color: var(--text-on-accent);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.magic-button:hover {
    filter: brightness(1.1);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.magic-button::before {
    display: none;
}

.magic-button:disabled {
    background: var(--bg-surface-alt);
    border-color: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: none;
}

/* ==============================
   FORMS / INPUTS
   ============================== */
.form-group {
    margin-bottom: 0.75rem;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.form-input,
.magic-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    transition: all 0.15s ease;
    outline: none;
}

.form-input:focus,
.magic-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-surface);
}

.form-input::placeholder,
.magic-input::placeholder {
    color: var(--text-faint);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237c7f8e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

textarea.form-input,
textarea.magic-input {
    resize: vertical;
    min-height: 80px;
}

/* ==============================
   CARDS & PANELS
   ============================== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.card-body {
    padding: 1rem;
}

.card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.88rem;
}

/* Backward compat */
.magic-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    backdrop-filter: none;
}

.magic-panel:hover {
    border-color: var(--border-hover);
}

.magic-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    backdrop-filter: none;
}

.magic-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* ==============================
   TABLES
   ============================== */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: var(--bg-hover);
}

/* ==============================
   BADGES
   ============================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
}

.badge-accent {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-medium);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

/* Role badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.65rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.role-0  { background: rgba(107, 114, 128, 0.12); color: var(--role-0); border: 1px solid rgba(107, 114, 128, 0.25); }
.role-1  { background: rgba(59, 130, 246, 0.12); color: var(--role-1); border: 1px solid rgba(59, 130, 246, 0.25); }
.role-2  { background: rgba(34, 197, 94, 0.12); color: var(--role-2); border: 1px solid rgba(34, 197, 94, 0.25); }
.role-3  { background: rgba(139, 92, 246, 0.12); color: var(--role-3); border: 1px solid rgba(139, 92, 246, 0.25); }
.role-10 { background: rgba(245, 158, 11, 0.12); color: var(--role-10); border: 1px solid rgba(245, 158, 11, 0.25); }
.role-20 { background: rgba(236, 72, 153, 0.12); color: var(--role-20); border: 1px solid rgba(236, 72, 153, 0.25); }
.role-4  { background: rgba(168, 85, 247, 0.12); color: var(--role-4); border: 1px solid rgba(168, 85, 247, 0.25); }
.role-5  { background: rgba(234, 179, 8, 0.12); color: var(--role-5); border: 1px solid rgba(234, 179, 8, 0.25); }

/* ==============================
   MODALS
   ============================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    z-index: 2000;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.modal-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    margin: 1rem;
    padding: 1.25rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* ==============================
   ALERTS
   ============================== */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid var(--info);
    color: var(--info);
}

/* ==============================
   STAT CARDS
   ============================== */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
}

.stat-card.gain   { border-left: 2px solid var(--success); }
.stat-card.loss   { border-left: 2px solid var(--danger); }
.stat-card.info   { border-left: 2px solid var(--info); }
.stat-card.special { border-left: 2px solid var(--accent); }

.stat-card-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-card-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==============================
   FILTER TABS
   ============================== */
.filter-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-tab {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 500;
}

.filter-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

/* ==============================
   SEARCH INPUT (admin page)
   ============================== */
.search-input {
    width: 100%;
    max-width: 300px;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    transition: all 0.15s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-input::placeholder {
    color: var(--text-faint);
}

/* ==============================
   HERO SECTION (index.html)
   ============================== */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
}

.hero-logo-wrapper {
    margin-bottom: 0.75rem;
}

.hero-logo-wrapper img {
    height: 72px !important;
    width: 72px !important;
    max-width: 72px !important;
    max-height: 72px !important;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.hero-title {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    letter-spacing: -0.3px;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
    max-width: 400px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    max-width: 600px;
    width: 100%;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: #ffffff;
    border: 1px solid #dfe1e6;
    border-radius: var(--radius-sm);
    color: #4a4d5c;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.82rem;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

[data-theme="dark"] .hero-button {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-secondary);
}

.hero-button:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #f3f0ff;
}

[data-theme="dark"] .hero-button:hover {
    background: var(--accent-light);
}

/* ==============================
   CONTENT SECTIONS (index.html)
   ============================== */
.content-section {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.content-section:nth-child(even) {
    background: var(--bg-surface-alt);
}

.section-container {
    max-width: var(--container-max);
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
    letter-spacing: -0.2px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ==============================
   NEWS / BLOG CARDS (index.html)
   ============================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.news-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.15s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.news-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-content {
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.news-category {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    width: fit-content;
}

.news-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
}

.news-excerpt {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.news-date,
.news-author {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

/* View all button */
.view-all-container {
    text-align: center;
    margin-top: 1.25rem;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    background: #ffffff;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.view-all-btn:hover {
    background: var(--accent);
    color: #ffffff;
}

.view-all-btn.gold {
    border-color: var(--gold);
    color: var(--gold);
    background: #ffffff;
}

.view-all-btn.gold:hover {
    background: var(--gold);
    color: #ffffff;
}

[data-theme="dark"] .view-all-btn {
    background: transparent;
}

[data-theme="dark"] .view-all-btn.gold {
    background: transparent;
}

/* ==============================
   DECK CARDS (index.html)
   ============================== */
.deck-card {
    background: #ffffff;
    border: 1px solid #dfe1e6;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.15s ease;
    cursor: pointer;
    height: 100%;
}

[data-theme="dark"] .deck-card {
    background: var(--bg-surface);
    border-color: var(--border);
}

.deck-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.deck-card.tournament-deck {
    border-color: rgba(200, 168, 78, 0.35);
}

.deck-card.tournament-deck:hover {
    border-color: var(--gold);
}

.deck-card-preview {
    height: 110px;
    background: #f7f8fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .deck-card-preview {
    background: var(--bg-surface-alt);
}

.deck-card-preview img {
    height: 160px;
    transform: rotate(-8deg) translateY(15px);
    opacity: 0.9;
    transition: transform 0.2s ease;
    border-radius: 3px;
    box-shadow: var(--shadow-sm);
}

.deck-card:hover .deck-card-preview img {
    transform: rotate(-5deg) translateY(8px) scale(1.03);
}

.deck-card-info {
    padding: 0.6rem 0.75rem;
    background: #ffffff;
}

[data-theme="dark"] .deck-card-info {
    background: var(--bg-surface);
}

.deck-card-name {
    color: #1a1c23;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .deck-card-name {
    color: var(--text-primary);
}

.deck-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.deck-format-badge {
    background: var(--accent-light);
    border: 1px solid var(--accent-medium);
    padding: 0.2rem 0.6rem;
    border-radius: 14px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}

.deck-card-count {
    color: #7c7f8e;
    font-size: 0.78rem;
}

[data-theme="dark"] .deck-card-count {
    color: var(--text-muted);
}

.deck-visibility {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.deck-visibility .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
}

.deck-card-author {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid #dfe1e6;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #7c7f8e;
    font-size: 0.78rem;
}

[data-theme="dark"] .deck-card-author {
    border-top-color: var(--border);
    color: var(--text-muted);
}

/* Tournament badge */
.tournament-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, var(--gold), #b8960b);
    color: #1a1c23;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 5;
}

/* ==============================
   CAROUSEL (index.html)
   ============================== */
.carousel-wrapper {
    position: relative;
    overflow: hidden;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
}

.carousel-container {
    display: flex;
    transition: transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
    gap: 1.25rem;
}

.carousel-slide {
    min-width: 280px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .carousel-slide {
        min-width: calc(33.333% - 0.85rem);
    }
}

@media (min-width: 1200px) {
    .carousel-slide {
        min-width: calc(25% - 0.95rem);
    }
}

.carousel-progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.5rem;
}

.carousel-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.carousel-progress-dot.active {
    width: 32px;
    border-radius: 4px;
    background: var(--accent-light);
}

.carousel-progress-dot.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 4px;
    animation: progressFill 5s linear forwards;
}

.carousel-progress-dot:hover {
    background: var(--accent-medium);
}

@keyframes progressFill {
    from { width: 0%; }
    to { width: 100%; }
}

.carousel-pause-btn {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    margin-left: 0.75rem;
}

.carousel-pause-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.carousel-pause-btn.paused {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

/* ==============================
   LOADING STATES
   ============================== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.loading-spinner {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--border);
    border-bottom-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0.75rem;
}

.loading-spinner.gold {
    border-bottom-color: var(--gold);
}

.no-posts {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-size: 1rem;
}

/* ==============================
   LOGIN PAGE
   ============================== */
.login-wrapper {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    margin: 0 auto 0.75rem;
    overflow: hidden;
    background: var(--bg-surface);
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-title {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.15rem;
}

.login-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.82rem;
}

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    max-width: 380px;
    width: 100%;
    padding: 1.5rem;
}

.login-form-title {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1rem;
}

.login-toggle-text {
    text-align: center;
    margin-top: 1.25rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.login-toggle-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.login-toggle-link:hover {
    text-decoration: underline;
}

/* ==============================
   ADMIN PAGE
   ============================== */
.admin-wrapper {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.admin-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-title {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.admin-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.role-info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 0.85rem;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.role-info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.role-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
}

.uid-cell {
    font-family: monospace;
    font-size: 0.72rem;
    color: var(--text-faint);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pages-list {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-height: 100px;
    overflow-y: auto;
    line-height: 1.6;
}

/* ==============================
   CONTACT MESSAGES PAGE
   ============================== */
.message-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.message-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.message-card.pending {
    border-left: 4px solid var(--warning);
}

.message-card.replied {
    border-left: 4px solid var(--success);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-replied {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

[data-theme="dark"] .status-pending {
    color: #f59e0b;
}

[data-theme="dark"] .status-replied {
    color: #22c55e;
}

/* ==============================
   FOOTER
   ============================== */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1rem;
    margin-top: 1.5rem;
}

.footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logos {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logos img {
    height: 22px !important;
    width: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    object-fit: cover;
    border-radius: 3px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    border: 1px solid var(--border);
}

.footer-logos img:hover {
    opacity: 1;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-social a {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.footer-social a:hover {
    color: var(--accent);
}

.footer-social svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.footer-social button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.footer-social button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.footer-copy {
    width: 100%;
    text-align: center;
    color: var(--text-faint);
    font-size: 0.72rem;
    margin-top: 0.5rem;
}

/* Backward compat: old footer class */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1rem;
    position: relative;
    box-shadow: none;
    min-height: auto;
    z-index: auto;
    backdrop-filter: none;
}

/* ==============================
   MAIN CONTAINER (login/simple pages)
   ============================== */
.main-container {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.header-section {
    text-align: center;
    margin-bottom: 1rem;
}

/* ==============================
   LOGO STYLES (backward compat)
   ============================== */
.mtg-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg-surface);
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.main-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    overflow: hidden;
    margin: 0 auto 0.75rem;
    background: var(--bg-surface);
}

.main-logo::before {
    display: none;
}

.main-logo .logo-image {
    width: 100%;
    height: 100%;
}

/* ==============================
   TITLES (backward compat)
   ============================== */
.main-title {
    font-family: var(--font-sans);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.3px;
    -webkit-text-fill-color: unset;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.description {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 500px;
    line-height: 1.5;
}

/* ==============================
   TEXT UTILITIES (backward compat)
   ============================== */
.text-golden { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-light-muted { color: var(--text-secondary); }
.text-very-muted { color: var(--text-faint); }

/* ==============================
   MTG CARD RARITIES
   ============================== */
.rarity-mythic  { color: #f97316; font-weight: 700; }
.rarity-rare    { color: #fbbf24; font-weight: 600; }
.rarity-uncommon { color: var(--text-muted); font-weight: 500; }
.rarity-common  { color: var(--text-faint); }

[data-theme="dark"] .rarity-mythic { text-shadow: 0 0 6px rgba(249, 115, 22, 0.4); }
[data-theme="dark"] .rarity-rare   { text-shadow: 0 0 6px rgba(251, 191, 36, 0.4); }

/* ==============================
   SETS GRID
   ============================== */
.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-surface-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

/* ==============================
   CARD HOVER EFFECTS
   ============================== */
.card-hover {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ==============================
   PAGINATION
   ============================== */
.pagination-button {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.15s ease;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0.5rem 0.85rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.pagination-button:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.pagination-button.active {
    background: var(--accent-gradient);
    color: var(--text-on-accent);
    border-color: var(--accent);
}

/* ==============================
   KEYRUNE ICONS
   ============================== */
.keyrune { font-size: 2rem !important; line-height: 1 !important; }
.keyrune-small { font-size: 1rem !important; }

/* ==============================
   MAIN BUTTON (backward compat)
   ============================== */
.main-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    min-width: 280px;
    position: relative;
    overflow: hidden;

}

.main-button::before {
    display: none;
}

.main-button:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ==============================
   BUTTONS GRID (index page)
   ============================== */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    max-width: 700px;
    width: 100%;
}

/* ==============================
   PARTICLES (optional subtle effect)
   ============================== */
.magic-particles {
    display: none;
}

[data-theme="dark"] .magic-particles {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.25;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(139, 124, 246, 0.5);
    border-radius: 50%;
    animation: float 18s infinite linear;
}

@keyframes float {
    0%   { transform: translateY(100vh) translateX(0); opacity: 0; }
    10%  { opacity: 0.7; }
    90%  { opacity: 0.7; }
    100% { transform: translateY(-10vh) translateX(25px); opacity: 0; }
}

/* ==============================
   SCROLLBAR
   ============================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ==============================
   ANIMATIONS
   ============================== */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes shimmer {
    0%   { transform: rotate(45deg) translateY(-100%); }
    100% { transform: rotate(45deg) translateY(100%); }
}

/* ==============================
   UTILITY CLASSES
   ============================== */
.mb-4  { margin-bottom: 1rem; }
.mb-6  { margin-bottom: 1.5rem; }
.mb-8  { margin-bottom: 2rem; }
.mt-4  { margin-top: 1rem; }
.mt-6  { margin-top: 1.5rem; }
.p-4   { padding: 1rem; }
.p-6   { padding: 1.5rem; }
.p-8   { padding: 2rem; }
.rounded-md  { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-xl); }
.text-center { text-align: center; }
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }
.hidden { display: none; }

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    :root {
        --nav-height: 44px;
    }

    body {
        padding-top: var(--nav-height);
    }

    /* Navbar mobile */
    .navbar-menu {
        display: none;
    }

    .navbar-end .navbar-user-info {
        display: none;
    }

    .navbar-toggle {
        display: flex;
    }

    .navbar-brand-text {
        font-size: 0.85rem;
    }

    /* Hero responsive */
    .hero-section {
        padding: 1.5rem 1rem 1rem;
    }

    .hero-logo-wrapper img {
        height: 56px;
        width: 56px;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .hero-subtitle {
        font-size: 0.82rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
    }

    .hero-button {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    /* Content sections */
    .content-section {
        padding: 1rem;
    }

    .section-header h2 {
        font-size: 1rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    /* Carousel mobile */
    .carousel-slide {
        min-width: 240px;
    }

    /* Admin */
    .admin-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Titles */
    .main-title {
        font-size: 1.15rem;
    }

    .page-title {
        font-size: 1.1rem;
    }

    /* Login */
    .login-card {
        padding: 1.25rem;
    }

    /* Footer */
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-logos,
    .footer-social {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 1rem 0.75rem;
    }

    .hero-logo-wrapper img {
        height: 48px;
        width: 48px;
    }

    .hero-title {
        font-size: 1.1rem;
    }

    .main-container {
        padding: 1rem;
    }

    .main-title {
        font-size: 1.1rem;
    }

    .carousel-slide {
        min-width: 240px;
    }

    .login-card {
        padding: 1rem;
    }
}

/* ==============================
   ACTION BUTTONS (backward compat)
   ============================== */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

/* ==============================
   OLD AUTH BUTTONS CONTAINER (hidden - replaced by navbar)
   ============================== */
#authButtons {
    display: none !important;
}
