* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark-bg: #0a0a0f;
    --card-bg: #141419;
    --card-hover: #1c1c24;
    --text-light: #f8f9fa;
    --text-gray: #9ca3af;
    --border-color: #27272a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --primary-rgb: 99, 102, 241;
    --secondary-rgb: 139, 92, 246;
    
    --body-bg-start: #0a0a0f;
    --body-bg-mid: #141419;
    --body-bg-end: #0a0a0f;
}

[data-theme="orange"] {
    --primary-color: #FF6B00;
    --primary-light: #FF8533;
    --primary-dark: #E55D00;
    --secondary-color: #4A90E2;
    --primary-rgb: 255, 107, 0;
    --secondary-rgb: 74, 144, 226;
}

[data-theme="emerald"] {
    --primary-color: #10b981;
    --primary-light: #34d399;
    --primary-dark: #059669;
    --secondary-color: #14b8a6;
    --primary-rgb: 16, 185, 129;
    --secondary-rgb: 20, 184, 166;
}

[data-theme="rose"] {
    --primary-color: #f43f5e;
    --primary-light: #fb7185;
    --primary-dark: #e11d48;
    --secondary-color: #ec4899;
    --primary-rgb: 244, 63, 94;
    --secondary-rgb: 236, 72, 153;
}

[data-theme="cyan"] {
    --primary-color: #06b6d4;
    --primary-light: #22d3ee;
    --primary-dark: #0891b2;
    --secondary-color: #0ea5e9;
    --primary-rgb: 6, 182, 212;
    --secondary-rgb: 14, 165, 233;
}

[data-theme^="light-"] {
    --dark-bg: #ffffff;
    --card-bg: #f8f9fa;
    --card-hover: #f1f3f5;
    --text-light: #1a1a1a;
    --text-gray: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    
    --body-bg-start: #f8f9fa;
    --body-bg-mid: #ffffff;
    --body-bg-end: #f8f9fa;
}

[data-theme="light-indigo"] {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --primary-rgb: 99, 102, 241;
    --secondary-rgb: 139, 92, 246;
}

[data-theme="light-orange"] {
    --primary-color: #f97316;
    --primary-light: #fb923c;
    --primary-dark: #ea580c;
    --secondary-color: #f59e0b;
    --primary-rgb: 249, 115, 22;
    --secondary-rgb: 245, 158, 11;
}

[data-theme="light-emerald"] {
    --primary-color: #10b981;
    --primary-light: #34d399;
    --primary-dark: #059669;
    --secondary-color: #14b8a6;
    --primary-rgb: 16, 185, 129;
    --secondary-rgb: 20, 184, 166;
}

[data-theme="light-rose"] {
    --primary-color: #f43f5e;
    --primary-light: #fb7185;
    --primary-dark: #e11d48;
    --secondary-color: #ec4899;
    --primary-rgb: 244, 63, 94;
    --secondary-rgb: 236, 72, 153;
}

[data-theme="light-cyan"] {
    --primary-color: #06b6d4;
    --primary-light: #22d3ee;
    --primary-dark: #0891b2;
    --secondary-color: #0ea5e9;
    --primary-rgb: 6, 182, 212;
    --secondary-rgb: 14, 165, 233;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--body-bg-start) 0%, var(--body-bg-mid) 50%, var(--body-bg-end) 100%);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body[data-theme^="light-"] header {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body[data-theme^="light-"] .input-section,
body[data-theme^="light-"] .sellers-section,
body[data-theme^="light-"] .filters-section,
body[data-theme^="light-"] .summary-section,
body[data-theme^="light-"] .reviews-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

body[data-theme^="light-"] #productUrl {
    background: var(--dark-bg);
    border-color: var(--border-color);
}

body[data-theme^="light-"] .seller-chip,
body[data-theme^="light-"] .review-card,
body[data-theme^="light-"] .toggle-label,
body[data-theme^="light-"] .star-chip span,
body[data-theme^="light-"] .theme-option {
    background: var(--dark-bg);
    border-color: var(--border-color);
}

body[data-theme^="light-"] .seller-chip.selected,
body[data-theme^="light-"] .seller-chip.selected *,
body[data-theme^="light-"] .star-chip input[type="checkbox"]:checked + span,
body[data-theme^="light-"] .tab-btn.active,
body[data-theme^="light-"] .keyword-tag {
    color: #ffffff !important;
}

body[data-theme^="light-"] .theme-sidebar,
body[data-theme^="light-"] .theme-sidebar-header {
    background: var(--card-bg);
    border-color: var(--border-color);
}

body[data-theme^="light-"] .theme-sidebar-header {
    background: var(--dark-bg);
}

body[data-theme^="light-"] .close-sidebar {
    background: var(--card-bg);
}

body[data-theme^="light-"] ::selection {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--text-light);
}

/* Animated gradient background */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(var(--primary-rgb), 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(var(--secondary-rgb), 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(var(--primary-rgb), 0.04) 0%, transparent 50%);
    animation: gradientMove 20s ease infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes gradientMove {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(5%, -5%) rotate(120deg);
    }
    66% {
        transform: translate(-5%, 5%) rotate(240deg);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px;
    padding-bottom: 80px;
}

@media (min-width: 768px) {
    .container {
        padding: 20px;
        padding-bottom: 40px;
    }
}

header {
    text-align: center;
    padding: 24px 16px;
    background: rgba(20, 20, 25, 0.8);
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 12px;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    animation: slideDown 0.5s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-gray);
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

/* Multi-function FAB */
.multi-fab {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    position: relative;
}

.fab-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.scroll-icon {
    opacity: 0;
    transform: translateY(10px);
}

.multi-fab.scroll-mode .theme-icon {
    opacity: 0;
    transform: translateY(-10px);
}

.multi-fab.scroll-mode .scroll-icon {
    opacity: 1;
    transform: translateY(0);
}

.multi-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(var(--primary-rgb), 0.4);
}

.multi-fab:active {
    transform: scale(0.95);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Theme Sidebar */
.theme-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: var(--card-bg);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-sidebar.active {
    right: 0;
}

.theme-sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--dark-bg);
}

.theme-sidebar-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0;
}

.close-sidebar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text-light);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-sidebar:hover {
    background: var(--card-hover);
    transform: rotate(90deg);
}

.theme-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.theme-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.theme-sidebar-content::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

.theme-sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--dark-bg);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.theme-option:hover {
    border-color: var(--primary-color);
    transform: translateX(-4px);
    background: var(--card-hover);
}

.theme-option.active {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
}

.theme-option .theme-color {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.theme-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.theme-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-desc {
    font-size: 0.8rem;
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-check {
    font-size: 1.2rem;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-option.active .theme-check {
    opacity: 1;
}

.theme-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    padding: 0 4px;
}

.theme-divider::before,
.theme-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.theme-divider span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .theme-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .theme-fab {
        bottom: 80px;
    }
}

@media (min-width: 768px) {
    header {
        padding: 40px 20px;
        margin-bottom: 30px;
        top: 20px;
    }
    
    header h1 {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
}

.input-section {
    background: var(--card-bg);
    padding: 20px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.input-actions {
    display: flex;
    gap: 8px;
    width: 100%;
}

.input-actions .btn-secondary {
    width: auto;
    min-width: 56px;
    padding: 14px 18px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
}

.input-actions .btn-secondary:hover {
    background: var(--card-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.input-actions .btn-primary {
    flex: 1;
}

#productUrl {
    flex: 1;
    padding: 16px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--dark-bg);
    color: var(--text-light);
    font-size: 0.95rem;
    transition: var(--transition);
    width: 100%;
    min-width: 0;
}

#productUrl:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
    background: rgba(20, 20, 25, 0.8);
}

#productUrl::placeholder {
    color: var(--text-gray);
    opacity: 0.7;
}

.btn-primary, .btn-secondary {
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-primary::before, .btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before, .btn-secondary:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-sm), 0 0 16px rgba(var(--primary-rgb), 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3), 0 0 24px rgba(var(--primary-rgb), 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    margin-top: 0;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
}

.help-text {
    color: var(--text-gray);
    font-size: 0.8rem;
    line-height: 1.6;
    background: var(--dark-bg);
    padding: 12px;
    border-radius: 10px;
    border-left: 3px solid var(--primary-color);
}

.help-text strong {
    color: var(--text-light);
    display: block;
    margin-bottom: 6px;
}

/* Landscape mode - use horizontal layout for input */
@media (orientation: landscape) {
    .input-group {
        flex-direction: row;
        gap: 8px;
        align-items: stretch;
    }
    
    #productUrl {
        flex: 1 1 auto;
        min-width: 200px;
        font-size: 0.9rem;
    }
    
    .input-actions {
        flex-shrink: 0;
        width: auto;
    }
    
    .input-actions .btn-secondary {
        padding: 12px 16px;
        min-width: 48px;
    }
    
    .input-actions .btn-primary {
        min-width: 120px;
        padding: 12px 20px;
    }
}

@media (min-width: 768px) {
    .input-section {
        padding: 30px;
        margin-bottom: 30px;
    }
    
    .input-group {
        flex-direction: row;
        gap: 10px;
        align-items: stretch;
    }
    
    .input-actions {
        flex-shrink: 0;
    }
    
    .input-actions .btn-secondary {
        min-width: 56px;
        padding: 0 18px;
    }
    
    .input-actions .btn-primary {
        min-width: 140px;
    }
    
    #productUrl {
        font-size: 1rem;
    }
    
    .help-text {
        font-size: 0.9rem;
        padding: 16px;
    }
}

.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-right: 4px solid var(--primary-light);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin: 0 auto 20px;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: rgba(var(--primary-rgb), 0.4);
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-gray);
    font-size: 0.95rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.hidden {
    display: none !important;
}

.sellers-section, .filters-section, .summary-section, .reviews-section {
    background: var(--card-bg);
    padding: 20px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.5s ease-out both;
}

.sellers-section { animation-delay: 0.2s; }
.filters-section { animation-delay: 0.3s; }
.summary-section { animation-delay: 0.4s; }
.reviews-section { animation-delay: 0.5s; }

.sellers-section h2, .summary-section h2, .reviews-section h2 {
    margin-bottom: 16px;
    color: var(--primary-color);
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sellers-section h2 {
    justify-content: space-between;
}

.sellers-count {
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 500;
}

.sellers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px;
    scroll-behavior: smooth;
    align-items: flex-start;
}

.sellers-list::-webkit-scrollbar {
    width: 6px;
}

.sellers-list::-webkit-scrollbar-track {
    background: var(--dark-bg);
    border-radius: 3px;
}

.sellers-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.sellers-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

.seller-chip {
    background: var(--dark-bg);
    padding: 8px 14px;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    width: auto;
    max-width: fit-content;
}

.seller-chip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--primary-rgb), 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.seller-chip:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.seller-chip:hover::before {
    opacity: 1;
}

.seller-chip:active {
    transform: translateY(0) scale(0.98);
}

.seller-chip.selected {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
    border-color: var(--primary-color);
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.35);
}

.seller-chip.selected,
.seller-chip.selected * {
    color: #ffffff !important;
}

.seller-chip.selected::before {
    opacity: 0;
}

.seller-chip-icon {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.seller-chip.selected .seller-chip-icon {
    background: rgba(255, 255, 255, 0.25);
}

.seller-chip-name {
    white-space: nowrap;
}

.seller-price-badge {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
    white-space: nowrap;
    transition: var(--transition);
}

.seller-chip.selected .seller-price-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.seller-chip:hover .seller-price-badge {
    background: rgba(var(--primary-rgb), 0.25);
}

@media (min-width: 768px) {
    .sellers-section, .filters-section, .summary-section, .reviews-section {
        padding: 30px;
        margin-bottom: 30px;
    }
    
    .sellers-section h2, .summary-section h2, .reviews-section h2 {
        margin-bottom: 20px;
        font-size: 1.5rem;
    }
    
    .sellers-list {
        gap: 12px;
        max-height: 400px;
    }
    
    .seller-chip {
        padding: 9px 16px;
        font-size: 0.9rem;
    }
    
    .seller-chip-icon {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
    }
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.filters-section h3 {
    margin: 0;
    color: var(--secondary-color);
    font-size: 1.15rem;
    font-weight: 600;
}

.btn-apply {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    background: var(--secondary-color);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--secondary-rgb), 0.35);
}

.btn-apply:active {
    transform: translateY(0);
}

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    display: block;
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 10px;
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    background: var(--dark-bg);
    border-radius: 12px;
    transition: var(--transition);
    user-select: none;
}

.toggle-label:hover {
    background: var(--card-hover);
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
    background: var(--primary-color);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch::after {
    left: 22px;
}

.toggle-text {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Star Filters as Chips */
.star-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.star-chip {
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.star-chip input[type="checkbox"] {
    display: none;
}

.star-chip span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--dark-bg);
    padding: 6px 12px;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.star-chip:hover span {
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(var(--secondary-rgb), 0.25);
}

.star-chip input[type="checkbox"]:checked + span {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white !important;
    box-shadow: 0 2px 8px rgba(var(--secondary-rgb), 0.35);
}

.star-chip:active span {
    transform: scale(0.95);
}

@media (min-width: 768px) {
    .btn-apply {
        padding: 9px 24px;
        font-size: 0.9rem;
    }
    
    .toggle-text {
        font-size: 0.95rem;
    }
    
    .star-chip span {
        padding: 9px 18px;
        font-size: 0.9rem;
    }
}

.summary-content {
    animation: fadeInUp 0.5s ease-out;
}

.summary-merchant {
    padding: 16px;
    background: var(--dark-bg);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.summary-merchant-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--dark-bg);
    padding: 14px 12px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    animation: scaleIn 0.5s ease-out both;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card.positive::before {
    background: linear-gradient(90deg, var(--success-color), #32c971);
}

.stat-card.negative::before {
    background: linear-gradient(90deg, var(--danger-color), #f06060);
}

.stat-card.rating::before {
    background: linear-gradient(90deg, #FFD700, #FFA500);
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: currentColor;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1;
}

.stat-card.positive .stat-value {
    color: var(--success-color);
}

.stat-card.negative .stat-value {
    color: var(--danger-color);
}

.stat-card.rating .stat-value {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    color: var(--text-gray);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ai-summary {
    background: linear-gradient(135deg, rgba(var(--secondary-rgb), 0.1), rgba(var(--secondary-rgb), 0.05));
    padding: 18px;
    border-radius: 14px;
    margin-top: 16px;
    border: 1px solid rgba(var(--secondary-rgb), 0.25);
}

.ai-summary h4 {
    color: var(--secondary-color);
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.ai-summary p {
    line-height: 1.7;
    color: var(--text-light);
}

.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    align-items: center;
}

.keywords strong {
    color: var(--text-light);
    margin-right: 4px;
    font-size: 0.9rem;
}

.keyword-tag {
    background: var(--secondary-color);
    color: white !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.keyword-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--secondary-rgb), 0.35);
}

@media (min-width: 768px) {
    .summary-merchant {
        padding: 20px;
    }
    
    .summary-merchant-name {
        font-size: 1.2rem;
    }
    
    .summary-stats {
        gap: 12px;
    }
    
    .stat-card {
        padding: 18px 16px;
    }
    
    .stat-card .stat-value {
        font-size: 2rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.75rem;
    }
    
    .ai-summary {
        padding: 20px;
    }
    
    .keyword-tag {
        font-size: 0.85rem;
        padding: 7px 16px;
    }
}

.reviews-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.review-tabs {
    display: flex;
    gap: 8px;
    background: var(--dark-bg);
    padding: 6px;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.review-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.9rem;
    -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover {
    color: var(--text-light);
    background: var(--card-hover);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white !important;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.35);
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-card {
    background: var(--dark-bg);
    padding: 18px;
    border-radius: 14px;
    border-left: 4px solid var(--border-color);
    transition: var(--transition);
    animation: slideInLeft 0.4s ease-out both;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.review-card:nth-child(1) { animation-delay: 0.05s; }
.review-card:nth-child(2) { animation-delay: 0.1s; }
.review-card:nth-child(3) { animation-delay: 0.15s; }
.review-card:nth-child(4) { animation-delay: 0.2s; }
.review-card:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.review-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.review-card:active {
    transform: translateX(2px) scale(0.99);
}

.review-card.positive {
    border-left-color: var(--success-color);
    background: linear-gradient(90deg, rgba(39, 174, 96, 0.05), var(--dark-bg));
}

.review-card.negative {
    border-left-color: var(--danger-color);
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.05), var(--dark-bg));
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.review-rating {
    font-size: 1.1rem;
    line-height: 1;
}

.review-date {
    color: var(--text-gray);
    font-size: 0.8rem;
}

.review-seller {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: inline-block;
}

.review-comment {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .reviews-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .review-tabs {
        width: auto;
    }
    
    .reviews-list {
        gap: 15px;
    }
    
    .review-card {
        padding: 20px;
    }
    
    .tab-btn {
        font-size: 1rem;
        padding: 10px 24px;
    }
    
    .review-rating {
        font-size: 1.2rem;
    }
    
    .review-date {
        font-size: 0.9rem;
    }
    
    .review-seller {
        font-size: 0.9rem;
    }
    
    .review-comment {
        font-size: 1rem;
    }
}

footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-gray);
    margin-top: 40px;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Selection color */
::selection {
    background: rgba(var(--primary-rgb), 0.3);
    color: var(--text-light);
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Notification animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-100px);
    }
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Touch feedback for mobile */
@media (hover: none) {
    .seller-card:active,
    .btn-primary:active,
    .btn-secondary:active,
    .tab-btn:active,
    .review-card:active {
        opacity: 0.8;
    }
}

/* Improved mobile spacing */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    header {
        padding: 20px 12px;
        margin-bottom: 12px;
        border-radius: 16px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .input-section,
    .sellers-section,
    .filters-section,
    .summary-section,
    .reviews-section {
        padding: 16px 12px;
        margin-bottom: 12px;
        border-radius: 16px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
}

/* Pull to refresh hint / Progress bar */
@media (max-width: 768px) {
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
        z-index: 9999;
    }
}

/* Loading progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 10000;
    transform-origin: left;
    animation: progressBar 2s ease-in-out infinite;
}

@keyframes progressBar {
    0% {
        transform: scaleX(0);
    }
    50% {
        transform: scaleX(0.7);
    }
    100% {
        transform: scaleX(1);
        opacity: 0;
    }
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger-color);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideUpBounce 0.5s ease-out;
}

@keyframes slideUpBounce {
    0% {
        transform: translateX(-50%) translateY(100px);
    }
    60% {
        transform: translateX(-50%) translateY(-10px);
    }
    100% {
        transform: translateX(-50%) translateY(0);
    }
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--card-bg) 25%, var(--card-hover) 50%, var(--card-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 10px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 10px;
}

.skeleton-text:last-child {
    width: 60%;
}

/* Better tap targets for mobile */
@media (max-width: 768px) {
    button, a, .seller-card, .review-card, .tab-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Floating action button style (for future use) */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
    z-index: 99;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(var(--primary-rgb), 0.4);
}

.fab:active {
    transform: scale(0.95);
}

/* Smooth transitions for all interactive elements */
button, .seller-card, .review-card, .tab-btn, .stat-card, .keyword-tag {
    will-change: transform;
}

/* Better focus states for keyboard navigation */
button:focus-visible,
input:focus-visible,
.seller-card:focus-visible,
.review-card:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Improved text readability */
@media (max-width: 768px) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
}

/* Sticky header behavior */
@media (max-width: 768px) {
    header.scrolled {
        padding: 16px 12px;
        box-shadow: var(--shadow-lg);
    }
    
    header.scrolled h1 {
        font-size: 1.35rem;
    }
    
    header.scrolled .subtitle {
        display: none;
    }
}

/* Landscape mode optimizations */
@media (max-height: 600px) and (orientation: landscape) {
    header {
        position: relative;
        top: 0;
        padding: 12px 16px;
        margin-bottom: 12px;
    }
    
    header h1 {
        font-size: 1.25rem;
        margin-bottom: 4px;
    }
    
    .subtitle {
        font-size: 0.75rem;
        display: none;
    }
    
    .container {
        padding: 8px;
        padding-bottom: 60px;
    }
    
    .input-section {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .input-group {
        margin-bottom: 8px;
    }
    
    .help-text {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
