/* Sports Card Checklists - Shared Styles */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:wght@400;500;600;700&display=swap');

/* Smooth page load - fade in after fonts/styles settle */
@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

html {
    animation: pageFadeIn 0.3s ease-out 0.1s both;
}

/* ============================================
   CSS Custom Properties (Theme Variables)
   Override these in page-specific styles
   ============================================ */
:root {
    /* Colors - defaults (Jayden Daniels theme) */
    --color-primary: #667eea;
    --color-primary-dark: #764ba2;
    --color-accent: #f39c12;
    --color-background: #f5f5f5;
    --color-surface: white;
    --color-text: #333;
    --color-text-muted: #666;
    --color-text-light: #999;

    /* Auth bar */
    --auth-bg: #1a1a2e;
    --auth-link-color: #aaa;
    --auth-link-hover: #fff;

    /* Stats */
    --stat-bg: #1a1a2e;
    --stat-value-color: #667eea;
    --stat-label-color: #aaa;

    /* Cards */
    --card-border: #e0e0e0;
    --card-hover-color: #667eea;
    --card-owned-bg: #e8f5e9;
    --card-owned-border: #4caf50;

    /* Common colors */
    --color-success: #4caf50;
    --color-warning: #ff9800;
    --color-error: #f44336;
    --color-sync-syncing: #f1c40f;
    --color-sync-synced: #2ecc71;
    --color-sync-error: #e74c3c;

    /* Border radius */
    --radius-sm: 3px;
    --radius-md: 4px;
}

/* ============================================
   Base Styles
   ============================================ */
* { box-sizing: border-box; }

body {
    font-family: 'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-background);
    margin: 0;
    padding: 0;
    color: var(--color-text);
}

/* ============================================
   Page Header (Scoreboard Style)
   ============================================ */
.page-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 20px 20px 24px;
    margin-bottom: 24px;
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

h1 {
    font-family: 'Bebas Neue', sans-serif;
    text-align: center;
    font-size: 2.8em;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin: 0 0 6px 0;
    background: linear-gradient(180deg, #d0d0d0 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-family: 'Barlow', sans-serif;
    text-align: center;
    color: #555;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

/* Content area below header */
.page-content {
    padding: 0 20px 20px;
}

/* ============================================
   Broadcast Ticker Nav Bar
   ============================================ */
.nav-bar {
    background: var(--nav-bg, linear-gradient(180deg, #1a1a2e 0%, #12121f 100%));
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: relative;
}

.nav-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(243, 156, 18, 0.3) 20%,
        var(--color-accent, #f39c12) 50%,
        rgba(243, 156, 18, 0.3) 80%,
        transparent 100%
    );
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 52px;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #888;
    transition: color 0.2s;
}

.nav-brand:hover { color: var(--color-accent, #f39c12); }

.nav-brand svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.nav-brand-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1em;
    letter-spacing: 0.1em;
    color: #666;
}

.nav-divider {
    display: none;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-link {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.95em;
    letter-spacing: 0.08em;
    text-decoration: none;
    color: #777;
    padding: 8px 16px;
    border-radius: 3px;
    position: relative;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #ccc;
    background: rgba(255,255,255,0.05);
}

.nav-link.active {
    color: var(--color-accent, #f39c12);
    background: linear-gradient(180deg, rgba(243, 156, 18, 0.15) 0%, rgba(243, 156, 18, 0.05) 100%);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--color-accent, #f39c12);
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.6);
    border-radius: 2px 2px 0 0;
}

/* Auth section - avatar with dropdown menu */
.nav-auth {
    display: flex;
    align-items: center;
    position: relative;
}

#auth-content {
    position: relative;
}

/* Avatar trigger button */
.nav-avatar-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-avatar-btn img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: border-color 0.15s ease;
}

.nav-avatar-btn:hover img {
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-avatar-btn.menu-open img {
    border-color: var(--color-accent, #f39c12);
}

/* Dropdown menu */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: linear-gradient(165deg, #1a1a2e 0%, #12121f 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.nav-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Gold accent line at top */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent, #f39c12), transparent);
}

/* User info header */
.nav-dropdown-header {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-dropdown-header img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-dropdown-header span {
    font-family: 'Barlow', sans-serif;
    font-size: 0.85em;
    font-weight: 600;
    color: #ccc;
}

/* Menu items */
.nav-dropdown-item {
    font-family: 'Barlow', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: #888;
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.nav-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}

.nav-dropdown-item svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.6;
}

.nav-dropdown-item:hover svg {
    opacity: 1;
}

.nav-dropdown-item.active {
    color: var(--color-accent, #f39c12);
}

.nav-dropdown-item.active svg {
    opacity: 1;
}

.nav-dropdown-item.danger {
    color: #888;
}

.nav-dropdown-item.danger:hover {
    background: rgba(255, 82, 82, 0.15);
    color: #ff5252;
}

.nav-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 4px 0;
}

.nav-dropdown-footer {
    padding: 8px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-family: 'Barlow', sans-serif;
    font-size: 0.7em;
    color: #444;
    text-align: right;
}

.nav-dropdown-footer a {
    color: #555;
    text-decoration: none;
}

.nav-dropdown-footer a:hover {
    color: var(--color-accent, #f39c12);
}

/* Mobile nav */
@media (max-width: 768px) {
    .nav-inner {
        height: auto;
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }

    .nav-brand-text { display: none; }
    .nav-divider { display: none; }

    .nav-links {
        position: static;
        transform: none;
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 8px;
        border-top: 1px solid rgba(255,255,255,0.05);
        gap: 2px;
    }

    .nav-link {
        font-size: 0.75em;
        padding: 6px 8px;
    }

    /* Dropdown adjusts on mobile */
    .nav-dropdown {
        right: -8px;
    }
}

.sync-status {
    font-family: 'Barlow', sans-serif;
    font-size: 0.75em;
    font-weight: 500;
    color: #888;
    min-width: 50px;
    text-align: right;
}

.sync-status.syncing { color: var(--color-sync-syncing); }
.sync-status.synced { color: var(--color-sync-synced); }
.sync-status.error { color: var(--color-sync-error); }

.read-only-notice {
    font-family: 'Barlow', sans-serif;
    background: rgba(255, 182, 18, 0.2);
    color: #FFB612;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85em;
    font-weight: 500;
    margin-right: auto;
}

/* ============================================
   Stats Section (Scoreboard Style)
   ============================================ */
.stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    background: rgba(0,0,0,0.3);
    padding: 16px 28px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.08);
    min-width: 120px;
    flex-shrink: 0;
}

.stat-value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3em;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #c8c8c8;
    line-height: 1;
    margin-bottom: 4px;
}

/* Larger size for owned/total count stats to fill their boxes */
#owned-count,
#total-count {
    font-size: 3.5em;
}

.stat-value.highlight {
    color: var(--color-accent);
}

.stat-label {
    font-family: 'Barlow', sans-serif;
    font-size: 0.65em;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #666;
}

.stat-breakdown {
    font-family: 'Barlow', sans-serif;
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 0.7em;
    font-weight: 500;
    margin-top: 6px;
}

.stat-breakdown .owned-value { color: var(--color-success); }
.stat-breakdown .needed-value { color: var(--color-warning); }

/* ============================================
   Filters
   ============================================ */
.filters {
    font-family: 'Barlow', sans-serif;
    background: var(--color-surface);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

select, input[type="text"] {
    font-family: 'Barlow', sans-serif;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid #ddd;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
}

.filter-btn {
    font-family: 'Barlow', sans-serif;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    background: var(--color-surface);
    color: var(--color-text);
}

.filter-btn:hover {
    background: #f0f0f0;
}

/* ============================================
   Sections & Headers
   ============================================ */
.section {
    margin-bottom: 28px;
}

.group-header {
    font-family: 'Bebas Neue', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    padding: 14px 20px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 1.5em;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    border-bottom: 2px solid var(--color-accent);
}

.section-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin-bottom: 28px;
}

.section-group .section {
    margin-bottom: 20px;
}

.section-group .section:last-child {
    margin-bottom: 0;
}

.section-header {
    font-family: 'Bebas Neue', sans-serif;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 1.3em;
    font-weight: 400;
    letter-spacing: 0.06em;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), transparent);
}

/* ============================================
   Card Grid
   ============================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    background: var(--color-surface);
    padding: 18px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ============================================
   Card Component
   ============================================ */
.card {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    transition: all 0.2s;
    background: var(--color-surface);
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: var(--card-hover-color);
    box-shadow: 0 4px 12px rgba(102,126,234,0.2);
    transform: translateY(-2px);
}

.card.owned {
    background: var(--card-owned-bg);
    border-color: var(--card-owned-border);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 140%;
    margin-bottom: 8px;
    background: #f0f0f0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fafafa;
    cursor: pointer;
}

.card-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    text-decoration: none;
    border: 1px dashed #ccc;
}

.card-image.placeholder:hover {
    background: #f0f0f0;
    color: var(--color-primary);
}

.card-title {
    font-family: 'Barlow', sans-serif;
    font-weight: 600;
    font-size: 13px;
    margin: 8px 0 4px;
    color: var(--color-text);
}

.card-number {
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.card-type {
    font-family: 'Barlow', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-light);
    margin-top: 4px;
}

/* ============================================
   Price Badge
   ============================================ */
.price-badge {
    font-family: 'Barlow', sans-serif;
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--color-success);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

.price-badge.mid { background: var(--color-warning); }
.price-badge.high { background: var(--color-error); }

/* Auto Badge (autographed cards) - matches price badge style with gold color */
.auto-badge {
    font-family: 'Barlow', sans-serif;
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #d4af37 0%, #c4a030 100%);
    color: #1a1a2e;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

.price-link {
    font-family: 'Barlow', sans-serif;
    display: inline-block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-light);
    text-decoration: none;
}

.price-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* ============================================
   Card Actions (bottom of card)
   ============================================ */
.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
}

.card-actions.links-only {
    justify-content: center;
}

/* ============================================
   Checkbox & Owned
   ============================================ */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.checkbox-wrapper input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.checkbox-wrapper label {
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
}

.owned-badge {
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
}

/* ============================================
   Links
   ============================================ */
.search-link {
    font-family: 'Barlow', sans-serif;
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
}

.search-link:hover {
    text-decoration: underline;
}

/* ============================================
   Achievement Pills
   ============================================ */
.achievement {
    font-family: 'Barlow', sans-serif;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-top: 6px;
    align-self: center;
}

/* ============================================
   Clear Button
   ============================================ */
.clear-btn {
    font-family: 'Barlow', sans-serif;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ff5252;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.clear-btn:hover { background: #ff1744; }

/* ============================================
   Collapsible Sections
   ============================================ */
.section-header.collapsible {
    cursor: pointer;
    user-select: none;
}

.section-header.collapsible::after {
    content: ' ▼';
    font-size: 12px;
    opacity: 0.7;
}

.section-header.collapsible.collapsed::after {
    content: ' ▶';
}

/* ============================================
   Notes (for inserts, chase, extras)
   ============================================ */
.section-note {
    font-family: 'Barlow', sans-serif;
    background: rgba(243, 156, 18, 0.1);
    color: #b36b00;
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 500;
    border-bottom: 1px solid rgba(243, 156, 18, 0.2);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .card { break-inside: avoid; }
    .search-link { display: none; }
    .auth-bar { display: none; }
    .filters { display: none; }
    .clear-btn { display: none; }
    body { background: white; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }

    h1 { font-size: 1.8em; }

    .card { padding: 8px; }

    .stats { gap: 12px; }

    .stat {
        padding: 12px 18px;
        min-width: 90px;
    }

    .stat-value { font-size: 2em; }
}

/* ============================================
   Edit Mode
   ============================================ */

/* Edit button in nav */
.nav-btn.edit-btn {
    color: #666;
}

.nav-btn.edit-btn:hover {
    color: #999;
}

.nav-btn.edit-btn.active {
    background: rgba(243, 156, 18, 0.1);
    color: var(--color-accent, #f39c12);
}

.nav-btn.edit-btn.active svg {
    opacity: 1;
}

/* Card Context Menu - right-click menu for editing cards */
.card-context-menu {
    position: fixed;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 0;
    min-width: 160px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s ease;
}

.card-context-menu.visible {
    opacity: 1;
    visibility: visible;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    color: #e0e0e0;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.context-menu-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.context-menu-item:hover svg {
    opacity: 1;
}

.context-menu-item.danger {
    color: #e74c3c;
}

.context-menu-item.danger:hover {
    background: rgba(231, 76, 60, 0.15);
}

/* ============================================
   Card Editor Modal - Broadcast Style
   ============================================ */

/* Backdrop with broadcast static effect */
.card-editor-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.92);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.card-editor-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.card-editor-backdrop.active .card-editor-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Modal container */
.card-editor-modal {
    background: linear-gradient(165deg, #1a1a2e 0%, #12121f 50%, #1a1a2e 100%);
    border-radius: 8px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 100px rgba(102, 126, 234, 0.15);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Glowing top accent bar */
.card-editor-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        #667eea 20%,
        #f39c12 50%,
        #667eea 80%,
        transparent 100%
    );
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
}

/* Corner accent decorations */
.card-editor-modal::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, transparent 50%, rgba(243, 156, 18, 0.1) 50%);
    pointer-events: none;
}

/* Header */
.card-editor-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.card-editor-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6em;
    font-weight: 400;
    letter-spacing: 0.1em;
    margin: 0;
    background: linear-gradient(180deg, #e0e0e0 0%, #f39c12 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-editor-subtitle {
    font-family: 'Barlow', sans-serif;
    font-size: 0.75em;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #666;
    margin-top: 4px;
}

.card-editor-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-editor-close:hover {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* Form body */
.card-editor-body {
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.card-editor-body::-webkit-scrollbar {
    width: 6px;
}

.card-editor-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.card-editor-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

/* Form grid */
.card-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.card-editor-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-editor-field.full-width {
    grid-column: 1 / -1;
}

.card-editor-label {
    font-family: 'Barlow', sans-serif;
    font-size: 0.7em;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #888;
}

.card-editor-modal .card-editor-input,
.card-editor-modal .card-editor-select {
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 14px;
    background: rgba(30, 30, 50, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #fff !important;
    transition: all 0.2s;
}

.card-editor-modal .card-editor-input:focus,
.card-editor-modal .card-editor-select:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: rgba(40, 40, 70, 0.95) !important;
}

.card-editor-modal .card-editor-input::placeholder {
    color: #666 !important;
    font-style: italic;
    opacity: 0.7;
}

.card-editor-select {
    cursor: pointer;
    appearance: none;
    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='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.card-editor-select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Checkbox styling */
.card-editor-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.card-editor-checkbox:hover {
    border-color: rgba(102, 126, 234, 0.3);
}

.card-editor-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.card-editor-checkbox span {
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
}

/* Image preview section */
.card-editor-image-section {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Image input with process button */
.card-editor-image-input-row {
    display: flex;
    gap: 8px;
}

.card-editor-image-input-row .card-editor-input {
    flex: 1;
}

.card-editor-process-btn {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 4px;
    color: white;
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 80px;
}

.card-editor-process-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.card-editor-process-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.card-editor-process-btn .process-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: processSpinner 0.8s linear infinite;
}

.card-editor-process-btn.processing .process-text {
    display: none;
}

.card-editor-process-btn.processing .process-spinner {
    display: block;
}

@keyframes processSpinner {
    to { transform: rotate(360deg); }
}

.card-editor-image-preview {
    width: 100%;
    height: 180px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 8px;
}

.card-editor-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-editor-image-preview .placeholder {
    color: #555;
    font-size: 13px;
    font-weight: 500;
}

/* Footer with actions */
.card-editor-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.2);
}

.card-editor-btn {
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 12px 24px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.card-editor-btn.cancel {
    background: rgba(255, 255, 255, 0.06);
    color: #888;
}

.card-editor-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.card-editor-btn.save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.card-editor-btn.save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.card-editor-btn.save:active {
    transform: translateY(0);
}

.card-editor-btn.delete {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    margin-right: auto;
}

.card-editor-btn.delete:hover {
    background: rgba(244, 67, 54, 0.25);
}

/* Dirty state indicator */
.card-editor-modal.dirty .card-editor-title::after {
    content: ' •';
    color: #f39c12;
}

/* Mobile responsive */
@media (max-width: 500px) {
    .card-editor-modal {
        width: 95%;
        max-height: 95vh;
    }

    .card-editor-grid {
        grid-template-columns: 1fr;
    }

    .card-editor-body {
        max-height: 55vh;
    }

    .card-editor-footer {
        flex-wrap: wrap;
    }

    .card-editor-btn {
        flex: 1;
        min-width: 100px;
    }

    .card-editor-btn.delete {
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }
}

/* ============================================
   Add Card Button (sticky below nav)
   ============================================ */
.add-card-btn {
    position: fixed;
    top: 68px;
    right: 20px;
    background: linear-gradient(135deg, var(--color-primary, #667eea) 0%, var(--color-primary-dark, #764ba2) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    z-index: 90;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.add-card-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.add-card-btn:active {
    transform: translateY(0);
}

@media (max-width: 500px) {
    .add-card-btn {
        padding: 10px 24px;
        font-size: 13px;
    }
}
