/**
 * Homepage Non-Critical Styles
 * Loaded after LCP for better performance
 */

/* Search Enhancements */
#searchInput:focus::placeholder {
    opacity: 0.5 !important;
}

.badges {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.badge {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

/* Smart Dropdown */
.smart-dropdown {
    position: absolute;
    top: 115%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
    display: none;
    z-index: 960; /* Above page content, below mega menu (1000) */
    max-height: 450px;
    overflow-y: auto;
    animation: slideDown 0.2s ease;
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recent-searches {
    position: absolute;
    top: 115%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
    display: none;
    z-index: 995; /* Sits above most content, still below mega menu (1000) */
    animation: slideDown 0.2s ease;
}

.recent-searches.show {
    display: block;
}

.section-header {
    padding: 16px 20px;
    background: linear-gradient(to bottom, #ffffff, #fafafa);
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #059669;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-recent {
    color: #ef4444;
    cursor: pointer;
    font-size: 0.7rem;
    text-transform: none;
    letter-spacing: normal;
}

.clear-recent:hover {
    text-decoration: underline;
}

.dropdown-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
}
.dropdown-item:hover { 
    background: #f0fdf4;
    transform: translateX(4px);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(to bottom, #10b981, #059669);
    transform: scaleX(0);
    transition: transform 0.2s ease;
    transform-origin: left;
}
.dropdown-item:hover::before {
    transform: scaleX(1);
}
.dropdown-img { 
    width: 44px; 
    height: 44px; 
    border-radius: 8px; 
    object-fit: cover; 
    background: #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.dropdown-icon {
    width: 40px; 
    height: 40px; 
    border-radius: 10px; 
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #059669;
    flex-shrink: 0;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.15);
    transition: all 0.2s ease;
}
.dropdown-item:hover .dropdown-icon {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

/* Category Grid */
.category-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-top: 3rem;
    width: 100%;
}

.category-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    width: 180px; 
    flex-shrink: 0;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(16, 185, 129, 0.2);
}

.cat-icon {
    width: 64px;
    height: 64px;
    background: var(--light-gray);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    transition: all 0.3s;
}

.category-card:hover .cat-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.cat-name { font-weight: 600; font-size: 1rem; color: var(--dark); }

/* Premium Section */
.premium-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.business-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid #f3f4f6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

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

.card-img-wrapper {
    height: 220px;
    position: relative;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.verified-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
}

.card-content { padding: 1.75rem; }

.biz-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.biz-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
    line-height: 1.3;
}

.biz-location {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.biz-btn {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: center;
    background: var(--light-gray);
    color: var(--dark);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    text-decoration: none;
}

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

/* Featured / Stats Section */
.featured-wrapper {
    background: linear-gradient(145deg, #10b981 0%, #065f46 100%);
    border-radius: 2rem;
    padding: 5rem 2rem;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(16, 185, 129, 0.25);
    margin: 0 auto;
}

.featured-wrapper::before {
    content: '';
    position: absolute;
    top: -100px; left: -100px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.featured-wrapper::after {
    content: '';
    position: absolute;
    bottom: -50px; right: -50px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 4rem 0;
    position: relative;
    z-index: 2;
}

.stat-item h3 { font-size: 3rem; font-weight: 600; margin-bottom: 0.5rem; letter-spacing: -0.03em; }
.stat-item p { font-size: 0.9rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }

.cta-btn {
    background: white;
    color: #065f46;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    display: inline-block;
    transition: all 0.2s;
    position: relative;
    z-index: 2;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* Newsletter */
.newsletter { background: white; border-top: 1px solid #f3f4f6; }
.newsletter-content { max-width: 600px; margin: 0 auto; text-align: center; }

.newsletter-icon-circle {
    width: 64px; height: 64px; 
    background: #ecfdf5; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: 0 auto 1.5rem; 
    color: var(--primary); 
    font-size: 1.75rem;
}

.feature-cards {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 3rem 0;
}
.feature-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--gray);
    font-weight: 500;
}
.feature-mini i {
    width: 48px; height: 48px;
    background: #f3f4f6;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}
.feature-mini:hover i {
    background: var(--primary);
    color: white;
}

.subscribe-form {
    display: flex;
    gap: 12px;
    margin: 2rem auto 0;
    max-width: 480px; 
    width: 100%;
}
.subscribe-form input {
    flex: 1;
    padding: 14px 24px;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    outline: none;
    transition: all 0.2s;
    font-size: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.subscribe-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.subscribe-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.subscribe-form button:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* Responsive */
@media (max-width: 1024px) {
    .category-grid { 
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 1rem;
    }
    .category-card { 
        width: 100%;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 900px) {
    .category-grid { 
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
    .premium-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 880px) {
    .premium-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .category-card { 
        width: 100%;
        max-width: none;
        padding: 1.5rem 1rem;
    }
    .cat-icon { width: 56px; height: 56px; font-size: 1.3rem; }
    .stats-grid { 
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    .stat-item h3 { font-size: 2rem; }
    .stat-item p { font-size: 0.8rem; }
    .featured-wrapper { padding: 3.5rem 1.5rem; border-radius: 1.5rem; }
    .subscribe-form { flex-direction: column; max-width: 100%; }
    .subscribe-form button { padding: 14px; width: 100%; }
}

@media (max-width: 640px) {
    .category-grid { 
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .category-card { padding: 1.25rem 0.75rem; }
    .cat-icon { width: 50px; height: 50px; font-size: 1.2rem; border-radius: 16px; }
    .cat-name { font-size: 0.85rem; }
    .stats-grid { 
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .category-card { padding: 1rem 0.5rem; }
    .cat-icon { width: 45px; height: 45px; font-size: 1.1rem; }
    .stat-item h3 { font-size: 1.75rem; }
    .stat-item p { font-size: 0.75rem; }
    .featured-wrapper { padding: 3rem 1.25rem; }
}
