/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Custom Properties for consistent theming */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --accent-color: #f59e0b;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-light: #ffffff;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    color: var(--primary-hover);
    transform: scale(1.05);
}

/* Search Container */
.search-container {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
}

.search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.search-button {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.search-button:hover {
    color: var(--primary-color);
}

.search-button::before {
    content: "🔍";
    font-size: 1.25rem;
}

/* Search Results */
.search-results-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

.search-results-container.show {
    display: block;
}

.search-results-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.search-results-item:last-child {
    border-bottom: none;
}

.search-results-item:hover,
.search-results-item.active {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

/* Navigation */
.categories {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.category {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
}

.category:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

/* Mobile Menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger-menu .line {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    border-radius: 2px;
    transition: var(--transition);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 1001;
    min-width: 200px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
    color: var(--text-primary);
}

.dropdown-menu-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

/* Hero Slideshow */
.slideshow-container {
    position: relative;
    max-width: 1200px;
    margin: 2rem auto;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.slide {
    display: none;
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.slide.active {
    display: block;
}

.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 1rem;
}

.slideshow-nav button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-weight: bold;
    box-shadow: var(--shadow);
}

.slideshow-nav button:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* Hero Section */
.hero-section {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.hero-section p {
    font-size: 1.125rem;
    opacity: 1;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
    font-weight: 500;
    color: var(--text-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Hot Deals Banner */
.hot-deals-banner {
    margin-bottom: 2rem;
}

.hot-deals-banner h2 {
    color: var(--text-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.hot-deals-banner p {
    color: var(--text-light);
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Main content sections on gradient background */
.container > section h2 {
    color: var(--text-light);
}

/* Card Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Modern Card Design */
.box {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.2);
}

.box img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.box h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.box p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
}

/* Button Styles */
.merged-box {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.merged-button {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    flex: 1;
    justify-content: center;
    font-weight: 600;
}

.promo-code {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.merged-button:hover {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: var(--text-light);
}

.copy-icon {
    font-size: 1rem;
    color: var(--secondary-color);
    transition: var(--transition);
}

.merged-button:hover .copy-icon {
    color: var(--text-light);
}

.redirect-button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.redirect-button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.redirect-icon {
    transition: var(--transition);
}

.redirect-button:hover .redirect-icon {
    transform: translateX(2px);
}

/* CTA Button Styles */
.cta-button {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}
.cta-button:hover {
    background: var(--primary-hover);
}

/* Copied Message */
.copied-message {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-color);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    display: none;
    z-index: 1002;
}

.copied-message::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--secondary-color);
}

.copied-message.show {
    display: block;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    20%, 80% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 3rem 2rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.social-icons a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.25rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.social-icons a:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

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

/* Footer sections for blog and article pages */
.footer-section {
    margin-bottom: 2rem;
    text-align: left;
}

.footer-section h3 {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.footer-section p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section ul li a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Multi-column footer layout for blog/article pages */
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: left;
}

/* Override text-center for footer with sections */
.footer .footer-content:has(.footer-section) {
    text-align: left;
}

/* Popular Categories Section */
.popular-categories {
    margin: 3rem 0;
    text-align: center;
}
.popular-categories h2 {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.category-card {
    padding: 1.5rem;
    color: var(--text-light);
    border-radius: var(--border-radius);
    display: block;
    text-decoration: none;
    transition: var(--transition);
}
.category-card h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-light);
}
.category-card p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
    color: var(--text-light) !important;
}
.bg-budgeting {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.bg-shopping {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.bg-home {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .categories {
        display: none;
    }
    
    .hamburger-menu {
        display: flex;
    }
    
    .search-container {
        max-width: 100%;
        margin: 0;
        order: -1;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .merged-box {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .merged-button,
    .redirect-button {
        width: 100%;
        justify-content: center;
    }
    
    .slide {
        height: 250px;
    }
    
    .social-icons {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .page-content {
        padding: 2rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .header {
        padding: 1rem;
    }
    
    .page-content {
        padding: 1.5rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .social-icons {
        flex-direction: column;
        align-items: center;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s infinite;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.hidden { display: none; }
.flex { display: flex; }
.block { display: block; }

/* Info Section Styles to improve readability on gradient background */
.info-section {
    margin-top: 4rem;
}
.info-section .feature i {
    color: var(--text-light);
}
.info-section .feature h3 {
    color: var(--text-light);
}
.info-section .feature p {
    color: var(--text-light);
}

/* Popular Categories: improve card text readability */
.popular-categories a h3 {
    color: var(--text-light);
    font-weight: 600;
}
.popular-categories a p {
    color: var(--text-light) !important;
    opacity: 1 !important;
}
