:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #ec4899;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* Source Colors */
    --flipkart: #2874f0;
    --myntra: #ff3f6c;
    --ajio: #000000;
    --amazon: #ff9900;
    --jiomart: #0078ad;
    --croma: #18181b;
    --default-source: #475569;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding-bottom: 40px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header - Premium Gradient */
.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px 0;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.site-header h1 {
    font-size: 1.75rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#last-updated {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 6px;
}

/* Sticky Controls */
.sticky-controls {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.controls-wrapper {
    display: flex;
    gap: 10px;
}

.search-box {
    flex: 2;
}

.filter-box {
    flex: 1;
}

input,
select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Grid - 2 columns on mobile */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Mobile: 2 columns */
    gap: 12px;
    margin-top: 20px;
}

@media (min-width: 600px) {
    .deals-grid {
        gap: 16px;
    }
}

@media (min-width: 768px) {
    .deals-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .deals-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Card */
.deal-card {
    background: var(--card-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.deal-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

.img-container {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
}

.deal-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Source-specific badge colors */
.badge-flipkart {
    background: var(--flipkart);
}

.badge-myntra {
    background: var(--myntra);
}

.badge-ajio {
    background: var(--ajio);
}

.badge-amazon {
    background: var(--amazon);
    color: #000;
}

.badge-jiomart {
    background: var(--jiomart);
}

.badge-croma {
    background: var(--croma);
}

.badge-shopsy {
    background: linear-gradient(135deg, #ff6b35 0%, #f7c02e 100%);
}

.badge-firstcry {
    background: #ff5722;
}

.badge-default {
    background: var(--default-source);
}

.card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

@media (min-width: 600px) {
    .card-body {
        padding: 16px;
    }
}

.deal-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 2.3rem;
    color: var(--text);
}

@media (min-width: 600px) {
    .deal-title {
        font-size: 1rem;
        min-height: 2.6rem;
    }
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #059669;
}

@media (min-width: 600px) {
    .current-price {
        font-size: 1.25rem;
    }
}

/* Timestamp styling */
.deal-timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.deal-timestamp::before {
    content: '🕐';
    font-size: 0.65rem;
}

/* CTA Button */
.btn-deal {
    margin-top: auto;
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

@media (min-width: 600px) {
    .btn-deal {
        padding: 12px;
        font-size: 0.9rem;
    }
}

.btn-deal:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    padding-bottom: 20px;
}

.page-btn {
    padding: 10px 20px;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border);
    color: var(--text-light);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-light);
    font-size: 0.875rem;
    background: white;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* Loading */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 1rem;
}

/* SEO Content Section */
.seo-content {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 40px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

.seo-content h2 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 16px;
}

.seo-content h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 12px;
}

.seo-content p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 16px;
}

.seo-content ul {
    list-style: none;
    padding: 0;
}

.seo-content li {
    color: var(--text-light);
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.seo-content li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* No results message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}