/* E-bike Finder - Professional Light Theme */

:root {
    /* Background Colors */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-glass: #f1f3f5;
    --bg-row-hover: #f8f9fa;

    /* Primary Teal Palette */
    --accent-blue: #40C4C4;
    --accent-teal: #40C4C4;
    --primary-400: #5cd0d0;
    --primary-500: #40C4C4;
    --primary-600: #35a8a8;
    --primary-700: #2d9191;

    /* Accent Colors */
    --accent-green: #10b981;
    --accent-purple: #8b5cf6;
    --accent-orange: #f59e0b;
    --accent-amber: #f59e0b;
    --accent-amber-dark: #d97706;
    --accent-red: #ef4444;

    /* Rich Gray Scale */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Borders */
    --border-color: #e5e7eb;
    --border-color-light: #f3f4f6;

    /* Enhanced Shadow System */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-teal: 0 4px 14px rgba(64, 196, 196, 0.35);
    --shadow-amber: 0 4px 14px rgba(245, 158, 11, 0.35);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    font-size: 14px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-blue);
}

/* Hero - Enhanced with gradient */
.hero {
    text-align: center;
    padding: 48px 0 32px;
    background: linear-gradient(135deg, rgba(64, 196, 196, 0.06) 0%, rgba(255, 255, 255, 0) 60%);
    border-bottom: 1px solid var(--border-color-light);
    margin-bottom: 8px;
}

.hero h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--gray-900);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto;
}

/* Controls Bar */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
    border-color: var(--primary-500);
    background: var(--gray-50);
    box-shadow: 0 0 0 3px rgba(64, 196, 196, 0.12);
}

.filter-count {
    background: var(--accent-blue);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-count.hidden {
    display: none;
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Filter Panel */
.filter-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}

.filter-panel.hidden {
    display: none;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* New filter row layout */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.filter-row .filter-group {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

.filter-group-full {
    flex: 1 1 100% !important;
    max-width: 100% !important;
}

.filter-group label {
    display: block;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.filter-group label .unit {
    color: var(--text-muted);
    font-weight: 400;
}

.filter-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-input:hover {
    border-color: var(--text-muted);
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-input-sm {
    width: 70px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.filter-input-sm:hover {
    border-color: var(--text-muted);
}

.filter-input-sm:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Hide number input spinners */
.filter-input-sm::-webkit-outer-spin-button,
.filter-input-sm::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-input-sm[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
}

.range-inputs input {
    width: 70px;
}

.range-inputs span {
    color: var(--text-muted);
}

.range-sep {
    color: var(--text-muted);
    padding: 0 2px;
}

/* ========================================
   Histogram Range Slider - Premium Design
   ======================================== */

.filter-row-sliders {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 16px;
}

.range-slider-group {
    min-width: unset !important;
    max-width: unset !important;
    flex: unset !important;
}

.range-slider-container {
    position: relative;
    padding-top: 4px;
}

/* Histogram Chart */
.histogram-chart {
    width: 100%;
    height: 32px;
    display: block;
    margin-bottom: 2px;
}

.histogram-chart path {
    fill: rgba(64, 196, 196, 0.15);
    stroke: none;
}

.histogram-chart path.histogram-active {
    fill: url(#histogram-gradient);
}

/* Dual Range Wrapper */
.dual-range-wrapper {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
}

/* Hide default range inputs but keep functional */
.range-input {
    position: absolute;
    width: 100%;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 3;
    margin: 0;
    padding: 0;
}

/* Custom thumb styling */
.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 4;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.range-input.range-min::-webkit-slider-thumb {
    background: linear-gradient(135deg, #40C4C4 0%, #35a8a8 100%);
}

.range-input.range-max::-webkit-slider-thumb {
    background: linear-gradient(135deg, #40C4C4 0%, #35a8a8 100%);
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.range-input::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

/* Firefox thumb styling */
.range-input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease;
}

.range-input.range-min::-moz-range-thumb {
    background: linear-gradient(135deg, #40C4C4 0%, #35a8a8 100%);
}

.range-input.range-max::-moz-range-thumb {
    background: linear-gradient(135deg, #40C4C4 0%, #35a8a8 100%);
}

/* Track styling */
.slider-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.slider-range {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #40C4C4 0%, #35a8a8 100%);
    border-radius: 2px;
    z-index: 2;
    transition: left 0.05s, right 0.05s;
}

/* Range Values Display */
.range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.range-values .min-value,
.range-values .max-value {
    padding: 2px 6px;
    background: var(--bg-glass);
    border-radius: 4px;
    min-width: 36px;
    text-align: center;
}

.checkbox-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-blue);
    width: 16px;
    height: 16px;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    box-shadow: var(--shadow-teal);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    box-shadow: 0 6px 20px rgba(64, 196, 196, 0.45);
    transform: translateY(-1px);
}

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

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

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    box-shadow: var(--shadow-sm);
}

/* Table Container */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
}

/* Product Table - Professional Light Theme */
.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.product-table th {
    background: var(--accent-teal);
    color: #ffffff;
    font-weight: 500;
    text-align: left;
    padding: 14px 10px;
    border-bottom: 2px solid var(--accent-teal);
    white-space: nowrap;
    position: sticky;
    top: 0;
    cursor: help;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.product-table th.sortable:hover {
    color: #e0f7f7;
}

.product-table th.sortable::after {
    content: '';
    margin-left: 4px;
}

.product-table th.sort-asc::after {
    content: ' ▲';
    font-size: 0.7rem;
    color: var(--accent-blue);
}

.product-table th.sort-desc::after {
    content: ' ▼';
    font-size: 0.7rem;
    color: var(--accent-blue);
}

.product-table td {
    padding: 16px 10px;
    border-bottom: 1px solid var(--border-color-light);
    vertical-align: middle;
    font-size: 0.875rem;
}

.product-table tbody tr {
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.product-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(64, 196, 196, 0.12) 0%, rgba(64, 196, 196, 0.04) 100%);
    border-left-color: var(--primary-500);
}

/* Column Widths - Adjusted for readability */
.col-brand {
    width: 110px;
    min-width: 100px;
}

.col-model {
    width: 140px;
    min-width: 120px;
}

.col-image {
    width: 90px;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

.col-motor {
    width: 55px;
}

.col-battery {
    width: 65px;
}

.col-range {
    width: 50px;
}

.col-speed {
    width: 40px;
}

.col-wheel {
    width: 45px;
}

.col-weight {
    width: 45px;
}

.col-frame {
    width: 45px;
}

.col-susp {
    width: 45px;
}

.col-gears {
    width: 40px;
}

.col-brake {
    width: 45px;
}

.col-price {
    width: 70px;
}

.col-discount {
    width: 40px;
}

.col-rating {
    width: 35px;
}

.col-action {
    width: 40px;
}

/* Spec columns */
.brand-cell,
.model-cell,
.spec-cell {
    color: var(--text-secondary);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
    font-size: 0.875rem;
}

.brand-cell {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.model-cell {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: normal;
    line-height: 1.3;
}

/* Table Cell Content */
.thumb-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    display: block;
    padding: 4px;
}

.thumb-img:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--accent-blue);
}

.product-title-cell {
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-title-cell a {
    color: inherit;
    text-decoration: none;
}

.product-title-cell a:hover {
    color: var(--accent-blue);
}

.price-current {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.price-original {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.8rem;
    display: block;
    margin-top: 2px;
}

.discount-cell {
    font-weight: 700;
    font-size: 0.95rem;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.discount-high {
    color: #dc2626;
    background: #fee2e2;
}

.discount-medium {
    color: #d97706;
    background: #fef3c7;
}

.discount-low {
    color: var(--text-secondary);
}

.rating-stars {
    color: #f59e0b;
    font-size: 1rem;
}

.rating-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.reviews-count {
    color: var(--text-secondary);
}

.value-score-cell {
    font-weight: 600;
    color: var(--accent-blue);
}

/* Suspicious Value Indicator - flags unreasonable values from source data */
.suspicious-value {
    color: var(--accent-orange);
    cursor: help;
    font-weight: 600;
}

/* JavaScript-powered instant tooltip container */
.suspicious-tooltip {
    position: fixed;
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    max-width: 280px;
    text-align: left;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.suspicious-tooltip.visible {
    opacity: 1;
}

/* Badges */
.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Premium Quality Badges - Compact icon indicators */
.premium-badges {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
    vertical-align: middle;
}

.premium-badge {
    display: inline-block;
    font-size: 0.7rem;
    cursor: help;
    opacity: 0.85;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.premium-badge:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* Individual badge colors (for potential future styling) */
.badge-torque {
    color: #f59e0b;
}

.badge-hydraulic {
    color: #10b981;
}

.badge-ul {
    color: #3b82f6;
}

.badge-smart {
    color: #8b5cf6;
}

.badge-cells {
    color: #ef4444;
}

.badge-prime {
    background: #00a8e1;
    color: white;
}

.badge-bestseller {
    background: var(--accent-green);
    color: white;
}

.badge-choice {
    background: white;
    color: var(--accent-orange);
    border: 1.5px solid var(--accent-orange);
}

.badge-deal {
    background: var(--accent-red);
    color: white;
}

.badge-variant {
    background: var(--accent-purple);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    margin-right: 4px;
}

.variation-row {
    background: rgba(139, 92, 246, 0.05);
}

/* Stock Status Badges */
.stock-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-in-stock,
.stock-badge.in-stock {
    background: #f0fdf4;
    color: #15803d;
    border: 2px solid #86efac;
}

.badge-out-of-stock,
.stock-badge.out-of-stock {
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #fca5a5;
}

.badge-reorder,
.stock-badge.reorder {
    background: #fffbeb;
    color: #d97706;
    border: 2px solid #fcd34d;
}

.badge-low-stock,
.stock-badge.low-stock {
    background: #fef3c7;
    color: #b45309;
    border: 2px solid #fde68a;
}

/* Group column */
.col-group {
    width: 40px;
    text-align: center;
    padding: 4px !important;
}

.group-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    text-align: center;
}

/* Buy Button */
.buy-btn-sm {
    display: inline-block;
    padding: 8px 16px;
    background: var(--accent-blue);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.buy-btn-sm:hover {
    background: #2a9d9d;
    box-shadow: 0 4px 12px rgba(64, 196, 196, 0.4);
    transform: translateY(-1px);
}

/* Loading & Empty States */
.loading {
    text-align: center;
    padding: 60px 40px;
}

.loading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 16px;
}

.empty-state.hidden {
    display: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    margin-top: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.pagination.hidden {
    display: none;
}

.pagination .page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.pagination .page-range {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 8px;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer */
.footer {
    margin-top: 60px;
    padding: 32px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: var(--bg-secondary);
}

.disclaimer {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-select,
    .filter-btn {
        width: 100%;
    }

    .col-value,
    .col-badges {
        display: none;
    }
}

/* ========================================
   Auth Modal - Premium Design
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
    text-align: center;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

/* Auth Steps */
.auth-step {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-step.hidden {
    display: none;
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.auth-step h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-step p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.auth-step form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.auth-step input[type="email"] {
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s;
    text-align: center;
}

.auth-step input[type="email"]:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(64, 196, 196, 0.15);
}

.auth-step input[type="email"]::placeholder {
    color: var(--text-muted);
}

.btn-full {
    width: 100%;
}

.auth-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    width: 100%;
}

.auth-error.hidden {
    display: none;
}

.auth-benefit {
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
}

.auth-hint {
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
    margin-top: 0.75rem !important;
    margin-bottom: 0.5rem !important;
    opacity: 0.8;
}

.auth-subtext {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Header Sign In Link (when not authenticated) */
.header-signin {
    margin-left: auto;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-teal) 0%, #35a8a8 100%);
    color: white;
    text-decoration: none;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(64, 196, 196, 0.25);
    border: none;
    cursor: pointer;
}

.header-signin:hover {
    background: linear-gradient(135deg, #35a8a8 0%, #2d9191 100%);
    box-shadow: 0 4px 16px rgba(64, 196, 196, 0.4);
    transform: translateY(-1px);
}

.header-signin:active {
    transform: translateY(0);
}

/* User Badge in Header (when authenticated) */
.user-badge {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem 0.5rem 0.5rem;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 28px;
    font-size: 0.875rem;
    margin-left: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.user-badge:hover {
    border-color: var(--accent-teal);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.user-badge .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-teal) 0%, #35a8a8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(64, 196, 196, 0.3);
}

.user-badge .email {
    color: var(--text-primary);
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-badge .provider-icon {
    font-size: 0.75rem;
    opacity: 0.8;
}

.sign-out-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.35rem 0.65rem;
    margin-left: 0.25rem;
    border-radius: 14px;
    transition: all 0.2s ease;
}

.sign-out-btn:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.05);
}

/* Amazon Link Locked State */
.amazon-link-locked {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
}

.amazon-link-locked:hover {
    color: var(--accent-teal);
}

/* Responsive auth modal */
@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .auth-icon {
        font-size: 2.5rem;
    }

    .auth-step h2 {
        font-size: 1.25rem;
    }
}