/* Home Page Styles - Version: 4.5.5 */
/* Updated: 2026-01-06 - v2.44.38: Strengthen mobile styles with body prefix for higher specificity */

/* ========================================
   HERO SECTION - Dark Futuristic Style
   ======================================== */
.hero {
    position: relative;
    min-height: 350px;
    background: linear-gradient(180deg, var(--dark-bg-primary, #0f0f23) 0%, var(--dark-bg-secondary, #1a1a3e) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: clip;    /* Contain glow orbs horizontally while preserving sticky */
    overflow-y: visible; /* Allow dropdowns to extend beyond hero */
    color: white;
    padding: 0;
}

/* Animated Grid Background */
.hero-grid-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image:
        linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }
    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px);
    }
}

/* Glowing Orbs */
.hero-glow-orb {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
}

.hero-glow-orb.purple {
    background: #764ba2;
    left: 10%;
    top: -20%;
}

.hero-glow-orb.blue {
    background: #667eea;
    right: 10%;
    bottom: -20%;
}

/* Hero Content Container */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 40px 20px;
    max-width: 1200px;  /* Increased from 900px for wider search bar */
    margin: 0 auto;
    width: 100%;
}

/* AI Chip Badge */
.ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border: 1px solid rgba(102, 126, 234, 0.5);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 25px;
    color: white;
}

.ai-chip-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Main Title */
.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
    color: white;
}

/* Gradient Text Effect */
.gradient-text {
    background: var(--gradient-shine);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shine 3s linear infinite;
}

@keyframes shine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Subtitle */
.hero p {
    font-size: 1.2rem;
    color: #a0a0c0;
    margin-bottom: 35px;
    font-weight: 400;
}

/* Platform Badges */
.platforms-section {
    background: white;
    padding: 2rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-top: -2rem;
}

.platforms-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.platform-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-radius: 0.75rem;
    transition: all 0.2s;
}

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

.platform-logo {
    width: 47px;
    height: 47px;
    border-radius: 0.5rem;
    object-fit: contain;
    background: white;
    padding: 4px;
    border: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.platform-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
}

.platform-info p {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Stats Section */
.stats-section {
    background: var(--gray-50);
    padding: 3rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Section Styles */
.section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.section-header h2 span,
.highlight-text {
    color: var(--theme-primary);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--gray-600);
}

/* Article Cards */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.article-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-200);
}

.article-content {
    padding: 1.5rem;
}

.article-category {
    display: inline-block;
    background: var(--primary-light);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-excerpt {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Tutorial Cards */
.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tutorial-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 2px solid transparent;
}

.tutorial-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.tutorial-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.tutorial-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.tutorial-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.tutorial-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.difficulty-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.75rem;
}

.difficulty-easy { background: var(--difficulty-easy-bg); color: var(--difficulty-easy-text); }
.difficulty-medium { background: var(--difficulty-medium-bg); color: var(--difficulty-medium-text); }
.difficulty-hard { background: var(--difficulty-hard-bg); color: var(--difficulty-hard-text); }

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.category-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    text-decoration: none;
    color: var(--gray-900);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    background: var(--primary-color);
    color: white;
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.category-name {
    font-weight: 600;
    font-size: 0.875rem;
}

/* CTA Section */
.cta-section {
    background: var(--gradient-primary);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-white {
    background: white;
    color: var(--primary-color);
}

.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Contained CTA Card Section */
.cta-card-section {
    padding: 2rem 0;
    background: var(--gray-50);
}

.cta-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--gradient-primary);
    color: white;
    padding: 2rem 1.5rem;
    border-radius: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.cta-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.cta-card p {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

.cta-card .btn-large {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
}

.btn-outline-white {
    border: 2px solid white;
    color: white;
    background: transparent;
}

.btn-outline-white:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .cta-card {
        padding: 1.5rem 1rem;
        border-radius: 1rem;
    }

    .cta-card h2 {
        font-size: 1.25rem;
    }
}

/* Recent Products Grid */
.recent-products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
}

/* Last Searches Grid */
.last-searches-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

/* Pagination Styles */
.pagination-container {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 0.375rem;
    color: #666;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background: #f5f5f5;
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

.pagination-numbers {
    display: flex;
    gap: 0.25rem;
}

.pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 0.375rem;
    color: #666;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-number:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.pagination-number.active {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
    font-weight: 700;
}

.pagination-info {
    font-size: 0.875rem;
    color: #666;
    text-align: center;
}

/* RTL Support for Pagination */
/* Only flip the arrow icons, keep button structure natural for RTL */
[dir="rtl"] .pagination-btn svg {
    transform: scaleX(-1);
}

/* Responsive */
/* Desktop - Maintain card size, reduce columns */
@media (max-width: 1200px) {
    .recent-products-grid,
    .last-searches-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet - Still maintain card size, fewer columns */
@media (max-width: 1024px) {
    .recent-products-grid,
    .last-searches-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Mobile - Maintain card size, 2 columns */
@media (max-width: 768px) {
    .section {
        padding: 2rem 0;
    }

    .hero {
        min-height: 400px;
    }

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

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

    .hero-glow-orb {
        width: 200px;
        height: 200px;
    }

    .ai-chip {
        font-size: 0.75rem;
        padding: 8px 16px;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .articles-grid,
    .tutorials-grid {
        grid-template-columns: 1fr;
    }

    /* v2.44.40: Product grid mobile styles REMOVED from here
       Now controlled by home.blade.php inline styles using #products ID selector
       to avoid CSS specificity battles with product-card.blade.php component */

    .pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .pagination-btn {
        width: 100%;
        justify-content: center;
    }
}

/* v2.44.40: 480px product grid mobile styles REMOVED - now in home.blade.php */

/* ========================================
   NEW SECTIONS - v3.4.0
   ======================================== */

/* Why Shop With Us - Features Section */
.features-section {
    background: var(--gray-50);
}

.features-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.features-grid .feature-card {
    flex: 0 0 calc(25% - 1.5rem);
    max-width: calc(25% - 1.125rem);
}

.feature-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

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

.feature-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.feature-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.feature-desc {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* Popular Searches Section */
.popular-searches-section {
    background: var(--gray-50);
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.search-tag {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 2rem;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.search-tag:hover {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Community Tips Section */
.community-tips-section {
    background: white;
}

.community-tips-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.community-tip-card {
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: 1rem;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.community-tip-card:hover {
    background: white;
    border-color: var(--theme-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.tip-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
    color: white;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tip-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.tip-content {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.tip-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.tip-author {
    font-weight: 500;
}

.tip-helpful {
    color: var(--theme-primary);
}


/* ========================================
   RESPONSIVE - NEW SECTIONS
   ======================================== */

/* Tablet */
@media (max-width: 1024px) {
    .features-grid .feature-card {
        flex: 0 0 calc(50% - 1rem);
        max-width: calc(50% - 0.75rem);
    }

    .community-tips-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .features-grid {
        gap: 1rem;
    }

    .features-grid .feature-card {
        flex: 0 0 calc(50% - 0.5rem);
        max-width: calc(50% - 0.5rem);
    }

    .feature-card {
        padding: 1.5rem 1rem;
    }

    .feature-icon {
        width: 56px;
        height: 56px;
    }

    .feature-icon svg {
        width: 24px;
        height: 24px;
    }

    .feature-title {
        font-size: 1rem;
    }

    .feature-desc {
        font-size: 0.8125rem;
    }

    .community-tips-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .community-tip-card {
        padding: 1.25rem;
    }

    .tip-title {
        font-size: 0.9375rem;
    }

    .search-tags {
        gap: 0.5rem;
    }

    .search-tag {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* Very Small Mobile */
@media (max-width: 480px) {
    .features-grid .feature-card {
        flex: 0 0 calc(50% - 0.5rem);
        max-width: calc(50% - 0.5rem);
    }
}

/* ========================================
   MOBILE SECTION REORDERING - v4.5.0
   Move "Why Shop With Us?" below "Recently Discovered" on mobile
   ======================================== */

/* Desktop: wrapper has no effect on layout */
.home-sections-wrapper {
    display: contents;
}

/* Mobile: reorder sections using flexbox */
@media (max-width: 768px) {
    .home-sections-wrapper {
        display: flex;
        flex-direction: column;
    }

    .home-sections-wrapper .features-section {
        order: 2; /* Move "Why Shop With Us?" after Recently Discovered */
    }

    .home-sections-wrapper .recently-discovered-section {
        order: 1; /* Show "Recently Discovered Products" first on mobile */
    }
}
