/* ResellMode v3.0 - Shared Styles */
/* Light mode default, dark mode when .light-mode class is removed */

/* ========== SELF-HOSTED FONTS ========== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/inter-latin-700-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('./fonts/inter-latin-800-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('./fonts/inter-latin-900-normal.woff2') format('woff2');
}

/* ========== iOS FLASHING FIX ========== */
/* Force GPU compositing on iOS to prevent white flash during transitions */
@supports (-webkit-touch-callout: none) {
    /* iOS scroll jitter fix - use overscroll-behavior instead of backface on scroll container */
    html {
        overscroll-behavior: none;
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        overscroll-behavior-y: none;
        /* Prevent pull-to-refresh interference */
        touch-action: pan-y;
    }
    
    /* Prevent flash on animated/transitioned elements - NOT on html/body */
    a, button, .btn, .card, .nav-item, .bottom-nav a,
    .tool-card, .guide-btn, .category-card, [class*="strip"],
    .icon-btn, .back-arrow, .home-logo, input, select, textarea {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
    
    /* Fixed bottom nav - prevent jitter with containment */
    .bottom-nav {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        /* Prevent fixed element from triggering scroll recalculation */
        contain: layout style;
    }
    
    /* Disable problematic transitions on iOS */
    .bottom-nav a {
        transition: color 0.15s ease !important;
    }
    
    /* Force layer creation for smooth scrolling */
    .container {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* ========== Cross-Browser Compatibility ========== */
/* Safari/iOS smooth scrolling */
html {
    -webkit-overflow-scrolling: touch;
}

/* Gap fallback for iOS Safari < 14.1 (uses margin on children) */
@supports not (gap: 1px) {
    .site-header > *:not(:last-child),
    .header-actions > *:not(:last-child),
    .input-group > *:not(:last-child),
    .button-row > *:not(:last-child),
    .footer-links > *:not(:last-child) {
        margin-right: 8px;
        margin-bottom: 8px;
    }
}

/* Prevent tap highlight on iOS */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS zoom on input focus */
input, select, textarea, button {
    font-size: 16px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== CSS Variables ========== */
:root {
    /* Light Mode - Warm and professional */
    --bg-primary: #fafaf9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f5f4;
    --bg-input: #ffffff;
    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #78716c;
    --border-color: #e7e5e4;
    --border-focus: #00d26a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    
    /* Cash Money Green */
    --green: #00d26a;
    --green-light: #dcfce7;
    --green-dark: #166534;
    --green-glow: rgba(0, 210, 106, 0.3);
    
    /* Supporting colors */
    --red: #dc2626;
    --red-light: #fee2e2;
    --blue: #0284c7;
    --blue-light: #e0f2fe;
    --purple: #7c3aed;
    --purple-light: #ede9fe;
    --orange: #d97706;
    --orange-light: #fef3c7;
    --pink: #db2777;
    --pink-light: #fce7f3;
}

:root:not(.light-mode), :root[data-theme="dark"] {
    /* Premium Dark Base - Black velvet for the diamond */
    --bg-primary: #0d0d0d;
    --bg-secondary: #161616;
    --bg-tertiary: #1f1f1f;
    --bg-input: #0a0a0a;
    --text-primary: #f5f5f4;
    --text-secondary: #d4d4d4;
    --text-muted: #8a8a8a;
    --border-color: #2a2a2a;
    --border-focus: #00d26a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.6);
    
    /* Cash Money Green - THE profit color */
    --green: #00d26a;
    --green-light: #166534;
    --green-dark: #009f4f;
    --green-glow: rgba(0, 210, 106, 0.4);
    
    /* Supporting colors - muted to not compete */
    --red: #ef4444;
    --red-light: #ef444415;
    --blue: #0ea5e9;
    --blue-light: #0ea5e915;
    --purple: #8b5cf6;
    --purple-light: #8b5cf615;
    --orange: #f59e0b;
    --orange-light: #f59e0b15;
    --pink: #ec4899;
    --pink-light: #ec489915;
}

/* ========== Base Reset ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { 
    scroll-behavior: smooth;
    overscroll-behavior: none; /* Prevent rubber-band bounce */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS Safari fix */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-transition: background 0.2s, color 0.2s;
    transition: background 0.2s, color 0.2s;
    /* Prevent font size adjustment on orientation change */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overscroll-behavior: none; /* Prevent rubber-band bounce */
}

/* iOS input zoom prevention */
input, select, textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Touch-friendly tap targets */
button, .btn, a.btn, .back-btn, .theme-toggle, .preset-btn {
    min-height: 44px; /* Apple HIG minimum */
    min-width: 44px;
    touch-action: manipulation; /* Remove 300ms tap delay on mobile */
}

/* ========== Layout ========== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 20px 120px;
    padding-bottom: max(120px, calc(100px + env(safe-area-inset-bottom)));
}

.container.wide {
    max-width: 900px;
}

.container.narrow {
    max-width: 500px;
}

/* ========== Header ========== */
.site-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* Brand logo for inner pages */
.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: all 0.15s;
    flex-shrink: 0;
}
.header-brand:hover {
    border-color: var(--green);
    background: var(--green-light);
}
.header-brand svg {
    width: 20px;
    height: 20px;
}
.header-brand span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--green);
    display: none;
}
@media (min-width: 500px) {
    .header-brand span {
        display: inline;
    }
}

.back-btn {
    width: 48px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
    padding-left: 6px;
}

/* Arrow indicator on left side */
.back-btn::before {
    content: '‹';
    position: absolute;
    left: 6px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green);
    line-height: 1;
}

/* Move logo SVG slightly right to make room for arrow */
.back-btn svg {
    margin-left: 4px;
}

@media (hover: hover) {
    .back-btn:hover {
        border-color: var(--green);
        background: var(--green-light);
    }
}

.back-btn:active {
    transform: scale(0.95);
}

.page-title {
    flex: 1;
    min-width: 0;
}

.page-title h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-title .badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--green-light);
    color: var(--green);
    border-radius: 20px;
    font-weight: 600;
}

:root:not(.light-mode) .page-title .badge,
:root[data-theme="dark"] .page-title .badge {
    background: var(--green-dark);
    color: var(--green);
}

.page-title .subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.15s;
    color: var(--text-secondary);
}

.icon-btn:hover {
    border-color: var(--green);
    background: var(--green-light);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* ========== Cards & Panels ========== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--text-muted);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== Form Elements ========== */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Focus states - accessible for keyboard users */
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-glow);
}

/* Keyboard focus indicator - high visibility for accessibility */
:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

/* Remove double outline on inputs that already have border highlight */
.form-input:focus-visible,
.form-select:focus-visible {
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.large {
    font-size: 1.5rem;
    padding: 15px;
    font-weight: 600;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px var(--green-glow);
}

@media (hover: hover) {
    .btn-primary:hover {
        background: linear-gradient(135deg, #00e070 0%, var(--green) 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 25px var(--green-glow);
    }
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--green-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    color: var(--green);
    border: 1px solid var(--green);
}

.btn-outline:hover {
    background: var(--green-light);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 1.1rem;
}

/* ========== Results Display ========== */
.result-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    margin: 15px 0;
    position: relative;
    overflow: hidden;
}

/* Profit glow background effect */
.result-box.profit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--green-glow) 0%, transparent 70%);
    opacity: 0.25;
    pointer-events: none;
    animation: profitPulse 2s ease-in-out infinite;
}

.result-box.loss::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.3) 0%, transparent 70%);
    opacity: 0.2;
    pointer-events: none;
}

@keyframes profitPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.35; }
}

.result-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    font-weight: 600;
    position: relative;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--green);
    font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
    text-shadow: 0 0 30px var(--green-glow);
    position: relative;
    line-height: 1.1;
}

.result-value.negative {
    color: var(--red);
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.result-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
    position: relative;
}

/* ========== Tables ========== */
.table-wrapper {
    overflow-x: auto;
    margin: 15px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    color: var(--text-primary);
}

tr:hover td {
    background: var(--bg-tertiary);
}

/* ========== Lists ========== */
.list-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 8px;
    gap: 12px;
    transition: all 0.15s;
    text-decoration: none;
    color: inherit;
}

.list-item:hover {
    border-color: var(--green);
    transform: translateX(3px);
}

.list-item .icon {
    font-size: 1.3rem;
    width: 40px;
    text-align: center;
}

.list-item .info {
    flex: 1;
}

.list-item .title {
    font-weight: 600;
    color: var(--text-primary);
}

.list-item .desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.list-item .arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* ========== Content Typography ========== */
.content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--green);
}

.content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 10px;
}

.content p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.content ul, .content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.content li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.content a {
    color: var(--green);
    text-decoration: none;
}

.content a:hover {
    text-decoration: underline;
}

.content blockquote {
    border-left: 4px solid var(--green);
    padding-left: 15px;
    margin: 15px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.content pre {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
}

.content pre code {
    background: none;
    padding: 0;
}

/* ========== Alerts & Messages ========== */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: var(--green-light);
    border: 1px solid var(--green);
    color: var(--green-dark);
}

.alert-error {
    background: var(--red-light);
    border: 1px solid var(--red);
    color: #991b1b;
}

.alert-info {
    background: var(--blue-light);
    border: 1px solid var(--blue);
    color: #1e40af;
}

.alert-warning {
    background: var(--orange-light);
    border: 1px solid var(--orange);
    color: #92400e;
}

:root:not(.light-mode) .alert-success,
:root[data-theme="dark"] .alert-success { color: #86efac; }
:root:not(.light-mode) .alert-error,
:root[data-theme="dark"] .alert-error { color: #fca5a5; }
:root:not(.light-mode) .alert-info,
:root[data-theme="dark"] .alert-info { color: #93c5fd; }
:root:not(.light-mode) .alert-warning,
:root[data-theme="dark"] .alert-warning { color: #fcd34d; }

/* ========== Bottom Navigation ========== */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    display: -webkit-box !important;
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-around;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
    z-index: 9999 !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    /* Force visibility on iOS */
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    /* Prevent iOS hiding on scroll */
    -webkit-overflow-scrolling: auto;
}

/* Dark mode */
:root:not(.light-mode) .bottom-nav,
[data-theme="dark"] .bottom-nav {
    background: #161616;
    border-color: #2a2a2a;
}

.bottom-nav .nav-icon {
    font-size: 1.7rem !important;
    line-height: 1;
    display: block;
    margin-bottom: 2px;
    transition: transform 0.15s ease;
}

.bottom-nav a {
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    align-items: center;
    -webkit-align-items: center;
    text-decoration: none;
    color: #6b7280;
    font-size: 0.65rem;
    padding: 4px 8px;
    min-width: 50px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    transition: color 0.15s ease;
}

.bottom-nav a.active {
    color: #009f4f;
}

.bottom-nav a.active .nav-icon {
    transform: scale(1.1);
}

:root:not(.light-mode) .bottom-nav a,
[data-theme="dark"] .bottom-nav a {
    color: #737373;
}

:root:not(.light-mode) .bottom-nav a.active,
[data-theme="dark"] .bottom-nav a.active {
    color: #00d26a;
}

/* Desktop centering */
@media (min-width: 768px) {
    .bottom-nav {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) translate3d(0, 0, 0) !important;
        -webkit-transform: translateX(-50%) translate3d(0, 0, 0) !important;
        max-width: 600px;
        width: 100%;
        border-radius: 20px 20px 0 0;
    }
}

/* ========== Footer ========== */
.site-footer {
    margin-top: 20px;
    padding: 12px 0 0;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.site-footer p {
    margin: 0 0 4px;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--green);
}

.site-footer .affiliate-disclosure {
    font-size: 0.65rem;
    opacity: 0.85;
}

/* ========== Affiliate Links - REVENUE GENERATOR ========== */
.aff-container {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 2px solid var(--green);
    border-radius: 14px;
    padding: 18px 22px;
    margin: 25px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.15);
}

.aff-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--green) 0%, #009f4f 100%);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.3);
    transition: all 0.25s ease;

}

/* Hover only on devices that support it */
@media (hover: hover) {
    .aff-link:hover {
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
        background: linear-gradient(135deg, #4de89b 0%, var(--green) 100%);
    }
}

/* Active state for mobile taps */
.aff-link:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, #009f4f 0%, #14532d 100%);
}

/* Light mode disclosure - visible green text */
.aff-disclosure {
    font-size: 0.7rem;
    color: #166534;
    flex-basis: 100%;
    text-align: center;
    margin-top: 5px;
}

/* Dark mode affiliate */
:root:not(.light-mode) .aff-container,
:root[data-theme="dark"] .aff-container {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
}

:root:not(.light-mode) .aff-disclosure,
:root[data-theme="dark"] .aff-disclosure {
    color: #bbf7d0;
}

/* ========== Utility Classes ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.hidden { display: none !important; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

/* ========== Responsive ========== */
@media (max-width: 500px) {
    body { padding: 15px; }
    .site-header { gap: 10px; }
    .page-title h1 { font-size: 1.2rem; }
    .card { padding: 15px; }
    .result-value { font-size: 1.6rem; }
    .footer-links { gap: 15px; }
}

/* ========== Print Styles ========== */
@media print {
    body { background: white; color: black; }
    .site-header, .site-footer { display: none; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    /* Hide glow effects in print */
    .result-box::before,
    .results-hero::before,
    .result-display::before,
    .results-card::before,
    .result-card::before { display: none !important; }
    .result-value, .profit-amount, .breakdown-value { text-shadow: none !important; }
}

/* ========== Email Capture ========== */

/* ========== Social Share Buttons ========== */
.social-share {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.share-btn.twitter { background: #1da1f2; color: #fff; }
.share-btn.facebook { background: #4267b2; color: #fff; }
.share-btn.linkedin { background: #0077b5; color: #fff; }
.share-btn.copy { 
    background: var(--bg-tertiary); 
    color: var(--text-primary); 
    border: 1px solid var(--border-color);
}

/* Share buttons - explicit styling to override browser defaults */
.social-share a.share-btn,
a.share-btn {
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.social-share a.share-btn.twitter,
a.share-btn.twitter {
    background: #1da1f2 !important;
    color: #fff !important;
}

.social-share a.share-btn.facebook,
a.share-btn.facebook {
    background: #4267b2 !important;
    color: #fff !important;
}

.social-share a.share-btn.linkedin,
a.share-btn.linkedin {
    background: #0077b5 !important;
    color: #fff !important;
}

button.share-btn.copy {
    cursor: pointer;
    border: 1px solid var(--border-color);
}

/* ========== Guide Page Styles ========== */
.top-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.top-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s;
}

.top-link:hover {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

/* Guide Navigation Buttons */
.guide-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.guide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s ease;
    min-width: 80px;
}

.guide-btn:hover {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

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

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

.content-section {
    margin-bottom: 25px;
}

.content-section h2 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.content-section h3 {
    color: var(--green);
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 10px;
}

.content-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 12px;
}

.content-section ul,
.content-section ol {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    padding-left: 20px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
}

.data-table td {
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: var(--bg-secondary);
}

.data-table strong {
    color: var(--text-primary);
}

/* ========== Guide-Specific Components ========== */

/* Condition Guide */
.condition-section {
    margin-bottom: 30px;
}

.condition-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.condition-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.condition-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.condition-badge.new { background: var(--green); color: #fff; }
.condition-badge.excellent, .excellent { background: #3b82f6; color: #fff; }
.condition-badge.good, .good { background: #f59e0b; color: #fff; }
.condition-badge.fair, .fair { background: #ef4444; color: #fff; }

.condition-name {
    font-weight: 700;
    color: var(--text-primary);
}

.condition-abbr {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 5px;
}

.condition-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

.condition-examples {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px 15px;
}

.condition-examples h4 {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.condition-examples ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.85rem;
}

.comparison-table th,
.comparison-table td {
    padding: 12px 10px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
}

.comparison-table td {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Code Block */
.code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    font-family: monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    color: var(--text-secondary);
}

/* Era/Vintage Guide */
.era-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.era-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.era-antique { background: #8b5a2b; color: #fff; }
.era-vintage { background: #a855f7; color: #fff; }
.era-classic { background: #3b82f6; color: #fff; }
.era-modern { background: var(--green); color: #fff; }
.era-golden { background: #f59e0b; color: #fff; }
.era-silver { background: #6b7280; color: #fff; }

/* Trading Cards Guide */
.badge-pokemon { background: #ffcb05; color: #000; }
.badge-mtg { background: #8b4513; color: #fff; }
.badge-yugioh { background: #4a0080; color: #fff; }
.badge-sports { background: #dc2626; color: #fff; }

.grade-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin: 5px;
}

.grade {
    font-weight: 700;
    color: var(--text-primary);
}

/* Section Title */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--green);
}

/* Back Arrow (header nav) */
.back-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.15s;
}

.back-arrow:hover {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

/* Home Logo */
.home-logo {
    display: flex;
    align-items: center;
}

.home-logo svg {
    width: 32px;
    height: 32px;
}

/* Header Nav */
.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== Enhanced UI States ========== */

/* Button focus states for keyboard navigation */
button:focus-visible,
.btn:focus-visible,
.action-btn:focus-visible,
.submit-btn:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

/* Disabled button states */
button:disabled,
.btn:disabled,
button.disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Active/pressed button state */
button:active:not(:disabled),
.btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Toast/snackbar notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--green);
    color: white;
}

.toast.error {
    background: #ef4444;
    color: white;
}

/* Result highlight animation */
@keyframes resultPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.result-highlight {
    animation: resultPulse 0.3s ease;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Improved empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.empty-state p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.empty-state .cta {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--green);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

/* Card hover enhancement */
.tool-card:hover,
.guide-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

:root:not(.light-mode) .tool-card:hover,
:root:not(.light-mode) .guide-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ========== Accessibility: Skip Link ========== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    z-index: 99999;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 12px;
    outline: 3px solid var(--text-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Guide Content Styles - Consolidated from inline CSS
   ========================================================================== */

/* Guide Card Container */
.guide-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
}

/* Guide Content Typography */
.guide-content h2 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 30px 0 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.guide-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.guide-content h3 {
    color: var(--green);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 25px 0 12px;
}
.guide-content h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 20px 0 10px;
}
.guide-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 15px;
}
.guide-content ul,
.guide-content ol {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    padding-left: 20px;
    margin-bottom: 15px;
}
.guide-content li {
    margin-bottom: 10px;
}
.guide-content strong {
    color: var(--text-primary);
}

/* Callout Boxes */
.tip-box {
    background: var(--green-light);
    border-left: 4px solid var(--green);
    padding: 15px 18px;
    border-radius: 0 10px 10px 0;
    margin: 20px 0;
}
:root:not(.light-mode) .tip-box,
:root[data-theme="dark"] .tip-box {
    background: rgba(0, 210, 106, 0.1);
}
.tip-box p {
    margin: 0;
    color: var(--text-secondary);
}
.tip-box strong {
    color: var(--green);
}

.warning-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 15px 18px;
    border-radius: 0 10px 10px 0;
    margin: 20px 0;
}
:root:not(.light-mode) .warning-box,
:root[data-theme="dark"] .warning-box {
    background: rgba(245, 158, 11, 0.1);
}
.warning-box p {
    margin: 0;
    color: var(--text-secondary);
}
.warning-box strong {
    color: #d97706;
}

.info-box {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: 15px 18px;
    border-radius: 0 10px 10px 0;
    margin: 20px 0;
}
:root:not(.light-mode) .info-box,
:root[data-theme="dark"] .info-box {
    background: rgba(59, 130, 246, 0.1);
}
.info-box p {
    margin: 0;
    color: var(--text-secondary);
}
.info-box strong {
    color: #2563eb;
}

/* Quick Reference Box */
.quick-ref {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}
.quick-ref h4 {
    margin: 0 0 15px;
    color: var(--text-primary);
}

/* Stat Display */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.stat-row:last-child {
    border-bottom: none;
}
.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Checklist */
.checklist {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 18px;
    margin: 20px 0;
}
.checklist h4 {
    margin: 0 0 12px;
    color: var(--text-primary);
}
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.checklist-item::before {
    content: "☐";
    color: var(--green);
    font-size: 1rem;
    margin-top: 1px;
}

/* Source/Carrier Cards */
.source-card,
.carrier-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
}
.source-card h4,
.carrier-card h4 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.source-card .rating,
.carrier-card .rating {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}
.source-card .rating span,
.carrier-card .rating span {
    font-size: 0.9rem;
}
.source-card .stats,
.carrier-card .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0;
    font-size: 0.85rem;
}
.source-card .stat,
.carrier-card .stat {
    background: var(--bg-secondary);
    padding: 8px 10px;
    border-radius: 6px;
}
.source-card .stat-label,
.carrier-card .stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
}
.source-card .stat-value,
.carrier-card .stat-value {
    color: var(--text-primary);
    font-weight: 600;
}
.source-card p,
.carrier-card p {
    margin: 10px 0 0;
    font-size: 0.9rem;
}
.carrier-card .best-for {
    color: var(--green);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

/* Day Schedule Grid */
.day-schedule {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin: 20px 0;
}
.day-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
    font-size: 0.75rem;
}
.day-card .day {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.day-card .activity {
    color: var(--text-secondary);
}
.day-card.best {
    background: var(--green);
    color: #fff;
}
.day-card.best .day,
.day-card.best .activity {
    color: #fff;
}

/* Guide Toggle (Collapsible Sections) */
.guide-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}
.guide-toggle:hover {
    border-color: var(--green);
}
.guide-toggle-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.guide-toggle-arrow {
    transition: transform 0.2s;
    color: var(--text-muted);
}
.guide-toggle.open {
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}
.guide-toggle.open .guide-toggle-arrow {
    transform: rotate(180deg);
}
.guide-content-collapsible {
    display: none;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    margin-bottom: 20px;
}
.guide-content-collapsible.open {
    display: block;
}

/* Guide Links Grid */
.guide-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.guide-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}
.guide-link:hover {
    border-color: var(--green);
}
.guide-link .icon {
    font-size: 1rem;
}

/* Responsive Adjustments for Guide Styles */
@media (max-width: 480px) {
    .day-schedule {
        grid-template-columns: repeat(4, 1fr);
    }
    .source-card .stats,
    .carrier-card .stats {
        grid-template-columns: 1fr;
    }
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}
