/* ===================================
   Component Styles
   =================================== */

/* === Header === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: var(--transition);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
}

.logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    -webkit-text-fill-color: white;
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    background: var(--surface-hover);
    transition: var(--transition);
}

.header-search input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-50);
    outline: none;
}

.header-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

.header-search .search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.header-search .search-results.active {
    display: block;
    animation: fadeInUp 0.2s ease;
}

.search-result-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--surface-hover);
}

.search-result-item .result-type {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 600;
}

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

.header-nav a {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.header-nav a:hover,
.header-nav a.active {
    background: var(--primary-50);
    color: var(--primary);
}

/* Mobile Menu Button */
.menu-toggle {
    display: none;
    background: none;
    font-size: 1.5rem;
    color: var(--text);
    padding: 4px;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: calc(100vh - var(--header-height));
    background: var(--surface);
    z-index: 999;
    padding: 20px;
    overflow-y: auto;
}

.mobile-menu.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.mobile-menu a {
    display: block;
    padding: 14px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
}

.mobile-menu a:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .header-search {
        display: none;
    }

    .header-nav {
        display: none;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }
}

/* === Coupon Card === */
.coupon-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-slow);
    position: relative;
}

.coupon-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.coupon-card-header {
    padding: 16px 16px 0;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
}

.coupon-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.coupon-card-body {
    padding: 12px 16px;
}

.coupon-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.coupon-card-title a:hover {
    color: var(--primary);
}

.coupon-card-discount {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
}

.coupon-card-conditions {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.coupon-card-expiry {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.coupon-card-expiry.expiring-soon {
    color: var(--warning);
    font-weight: 600;
}

.coupon-card-footer {
    padding: 12px 16px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.coupon-card-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.coupon-card-brand img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.coupon-copy-btn {
    margin-left: auto;
    padding: 8px 18px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.coupon-copy-btn:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-primary);
}

.coupon-copy-btn.copied {
    background: var(--success);
    box-shadow: none;
}

.coupon-deal-btn {
    margin-left: auto;
    padding: 8px 18px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.coupon-deal-btn:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-primary);
}

/* Platform accent border */
.coupon-card.platform-shopee { border-top: 3px solid var(--shopee); }
.coupon-card.platform-lazada { border-top: 3px solid var(--lazada); }
.coupon-card.platform-tiki { border-top: 3px solid var(--tiki); }

/* === Hero Section === */
.hero {
    background: var(--gradient-hero);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 900;
    color: white;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.92;
    margin-bottom: 24px;
    max-width: 600px;
}

.hero-search {
    max-width: 500px;
    position: relative;
}

.hero-search input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.hero-search input:focus {
    outline: none;
    background: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.hero-search .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.hero-stats {
    display: flex;
    gap: 32px;
    margin-top: 28px;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
}

.hero-stat-label {
    font-size: 0.82rem;
    opacity: 0.85;
}

@media (max-width: 768px) {
    .hero {
        padding: 32px 24px;
        border-radius: var(--radius-lg);
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .hero-stats {
        gap: 20px;
    }

    .hero-stat-value {
        font-size: 1.4rem;
    }
}

/* === Category Pills === */
.category-scroll-container {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 46px; /* reserve space for buttons */
}

.category-scroll-container .scroll-btn {
    position: absolute;
    z-index: 10;
    background: white;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text);
    transition: var(--transition);
}

.category-scroll-container .scroll-btn:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary);
}

.category-scroll-container .scroll-btn.left {
    left: 0;
}

.category-scroll-container .scroll-btn.right {
    right: 0;
}

@media (max-width: 1024px) {
    .category-scroll-container .scroll-btn {
        display: none;
    }
    .category-scroll-container {
        padding: 0;
    }
}

.category-pills {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-pills::-webkit-scrollbar {
    display: none;
}

.category-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}

.category-pill:hover,
.category-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary);
}

.category-pill .pill-icon {
    font-size: 1.1rem;
}

.category-pill .pill-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}

.category-pill:hover .pill-count,
.category-pill.active .pill-count {
    background: rgba(255, 255, 255, 0.2);
}

/* === Brand Card === */
.brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: var(--transition);
    text-align: center;
}

.brand-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-100);
}

.brand-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    object-fit: contain;
    margin-bottom: 10px;
    background: var(--surface-hover);
    padding: 6px;
}

.brand-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.brand-coupon-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === Countdown Timer === */
.countdown {
    display: flex;
    gap: 6px;
    align-items: center;
}

.countdown-unit {
    background: var(--secondary);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
}

.countdown-separator {
    color: var(--text-muted);
    font-weight: 700;
}

/* === Sale Calendar === */
.sale-event {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.sale-event:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

.sale-event-date {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.sale-event-day {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
}

.sale-event-month {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.9;
}

.sale-event-info {
    flex: 1;
}

.sale-event-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.sale-event-countdown {
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
}

/* === Newsletter === */
.newsletter-section {
    background: var(--gradient-dark);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.newsletter-section::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: rgba(255, 107, 53, 0.15);
    border-radius: 50%;
}

.newsletter-section h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    position: relative;
}

.newsletter-section p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
    position: relative;
}

.newsletter-form {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
    gap: 10px;
    position: relative;
}

.newsletter-form input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 0.95rem;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
}

.newsletter-form button {
    padding: 14px 28px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.newsletter-form button:hover {
    box-shadow: var(--shadow-primary);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .newsletter-section {
        padding: 32px 24px;
    }

    .newsletter-form {
        flex-direction: column;
    }
}

/* === Blog Card === */
.blog-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-slow);
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.blog-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--surface-hover);
}

.blog-card-body {
    padding: 16px;
}

.blog-card-category {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.blog-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-title a:hover {
    color: var(--primary);
}

.blog-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* === Footer === */
.footer {
    background: var(--secondary);
    color: rgba(255, 255, 255, 0.7);
    padding: 48px 0 24px;
    margin-top: 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-top: 12px;
}

.footer h4 {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-links a {
    display: block;
    padding: 5px 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.pagination .ellipsis {
    border: none;
    background: none;
}

/* === Breadcrumb === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* === Ranking List === */
.ranking-list {
    counter-reset: ranking;
}

.ranking-item {
    counter-increment: ranking;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: var(--transition);
    margin-bottom: 8px;
}

.ranking-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
}

.ranking-item::before {
    content: counter(ranking);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--background);
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-muted);
    flex-shrink: 0;
}

.ranking-item:nth-child(1)::before {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
}

.ranking-item:nth-child(2)::before {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: white;
}

.ranking-item:nth-child(3)::before {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    color: white;
}

.ranking-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.ranking-title a:hover {
    color: var(--primary);
}

.ranking-clicks {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

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

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