:root {
    --primary-color: #00BCD4;
    --primary-dark: #0097A7;
    --primary-light: #B2EBF2;
    --accent-cyan: #06A7BD;
    --hot-gradient-start: #FF6B6B;
    --hot-gradient-end: #FFB366;
    --warm-color: #FFB366;
    --cold-color: #6BB6FF;
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --warning-color: #FF9800;
}

[data-theme="light"] {
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-tertiary: #9E9E9E;
    --text-inverse: #FFFFFF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-tertiary: #EEEEEE;
    --bg-dark: #424242;
    --border-color: #E0E0E0;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --input-bg: #FFFFFF;
    --hover-bg: #F5F5F5;
    --card-bg: #FFFFFF;
}

[data-theme="dark"] {
    --text-primary: #E0E0E0;
    --text-secondary: #B0B0B0;
    --text-tertiary: #808080;
    --text-inverse: #212121;
    --bg-primary: #18191A;
    --bg-secondary: #242526;
    --bg-tertiary: #3A3B3C;
    --bg-dark: #18191A;
    --border-color: #3E4042;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.7);
    --input-bg: #3A3B3C;
    --hover-bg: #4E4F50;
    --card-bg: #242526;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.navbar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    transition: opacity 0.2s;
}

.logo-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    font-size: 2rem;
}

.nav-search {
    flex: 1;
    max-width: 600px;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    transition: all 0.2s;
    background-color: var(--input-bg);
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    position: relative;
    font-size: 0.9375rem;
}

.nav-link:hover {
    background-color: var(--hover-bg);
}

.icon {
    font-size: 1.125rem;
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    min-width: 1.125rem;
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--hover-bg);
}

.main-content {
    min-height: calc(100vh - 200px);
    padding: 1.5rem 0;
}

.hero-banner {
    background: linear-gradient(135deg, #00BCD4 0%, #0097A7 100%);
    border-radius: 1rem;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    color: white;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-banner h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero-banner p {
    font-size: 1.125rem;
    opacity: 0.95;
}

.filters-section {
    background-color: var(--card-bg);
    padding: 1.25rem;
    border-radius: 0.875rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.filters-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.filters-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-tab:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.filter-tab.active {
    background-color: var(--primary-color);
    color: white;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.filter-select {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    background-color: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.deals-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
}

.deals-main {
    min-width: 0;
}

.deals-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.deal-card {
    background-color: var(--card-bg);
    border-radius: 0.875rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    min-height: 160px;
    border: 1px solid var(--border-color);
}

.deal-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.deal-image-container {
    width: 200px;
    min-width: 200px;
    position: relative;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.deal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deal-temperature {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    min-width: 52px;
    padding: 0.625rem 0.5rem;
    border-radius: 0.625rem;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    border: 1px solid rgba(0,0,0,0.08);
}

.temperature-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.temperature-icon {
    font-size: 0.75rem;
}

.temperature-hot .temperature-value {
    color: #FF6B6B;
}

.temperature-warm .temperature-value {
    color: #FFB366;
}

.temperature-cold .temperature-value {
    color: #6BB6FF;
}

.deal-content {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.deal-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
    width: fit-content;
}

.deal-badge-free {
    background-color: #4CAF50;
    color: white;
}

.deal-header {
    margin-bottom: 0.75rem;
}

.deal-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.deal-meta-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.deal-store {
    font-weight: 600;
}

.deal-author::before {
    content: "•";
    margin-right: 0.5rem;
}

.deal-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.deal-price-section {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.price-current {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-original {
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.deal-discount {
    background: linear-gradient(135deg, var(--hot-gradient-start), var(--hot-gradient-end));
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 0.9375rem;
}

.deal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.deal-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.action-btn:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

.action-btn.active {
    color: var(--primary-color);
}

.action-btn .icon {
    font-size: 1rem;
}

.deal-time {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.deals-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-section {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.sidebar-deal {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.sidebar-deal:hover {
    background-color: var(--hover-bg);
}

.sidebar-deal-image {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    object-fit: cover;
    background-color: var(--bg-tertiary);
}

.sidebar-deal-info {
    flex: 1;
    min-width: 0;
}

.sidebar-deal-badge {
    display: inline-block;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
}

.sidebar-deal-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.sidebar-deal-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.sidebar-deal-old-price {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-left: 0.375rem;
}

.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.footer-section h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.banner-ad {
    margin: 0 0 1.5rem 0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
}

.banner-ad-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background-color: rgba(255, 183, 77, 0.95);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: #000;
    letter-spacing: 0.5px;
    z-index: 10;
}

.banner-ad-content {
    height: 120px;
    position: relative;
    cursor: pointer;
    display: block;
    text-decoration: none;
}

.banner-ad-background {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-ad-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 100%);
}

.banner-ad-info {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
}

.banner-ad-text {
    flex: 1;
}

.banner-ad-brand {
    font-size: 0.75rem;
    font-weight: 700;
    color: #FFF;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.banner-ad-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 0.25rem;
}

.banner-ad-description {
    font-size: 0.875rem;
    color: #FFF;
    opacity: 0.95;
}

.banner-ad-discount {
    background-color: var(--danger-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 1.125rem;
    font-weight: 800;
    color: #FFF;
    margin-right: 0.5rem;
}

.banner-ad-cta {
    background-color: #FFF;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #000;
}

.theme-selector {
    position: relative;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    background-color: var(--hover-bg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.theme-toggle .icon {
    font-size: 1rem;
}

.theme-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.theme-menu.active {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    border: none;
    background: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    text-align: left;
    transition: all 0.2s;
    position: relative;
}

.theme-option:hover {
    background-color: var(--hover-bg);
}

.theme-option.active {
    background-color: rgba(0, 188, 212, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.theme-option.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--primary-color);
}

.theme-icon {
    font-size: 1.125rem;
}

@media (max-width: 1024px) {
    .deals-container {
        grid-template-columns: 1fr;
    }

    .deals-sidebar {
        position: static;
        order: 2;
    }

    .sidebar-section {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .nav-content {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .nav-search {
        order: 3;
        flex-basis: 100%;
        max-width: 100%;
    }

    .hero-banner {
        padding: 2rem 1.5rem;
    }

    .hero-banner h1 {
        font-size: 1.75rem;
    }

    .hero-banner p {
        font-size: 1rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .deal-card {
        flex-direction: column;
        min-height: auto;
    }

    .deal-image-container {
        width: 100%;
        height: 180px;
    }

    .deal-content {
        padding: 1rem;
    }

    .price-current {
        font-size: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .theme-menu {
        right: auto;
        left: 0;
    }

    .deals-sidebar {
        display: none;
    }
}
