@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap');

:root {
    /* Light Mode Clean Colors */
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    
    /* Brand Colors */
    --primary: #3b82f6;
    --wa-green: #25D366;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    
    /* Text Colors */
    --text-dark: #0f172a;
    --text-body: #334155;
    --text-muted: #64748B;
    
    /* UI Elements */
    --border-light: #e2e8f0;
    --border-radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --transition: 0.2s ease-in-out;
}

/* ========================================= */
/* DARK MODE ENGINE (Persistent Slate Theme) */
/* ========================================= */
[data-theme="dark"] {
    --bg-light: #0f172a;
    --bg-card: #1e293b;
    
    --text-dark: #f8fafc;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-light: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.6);
}

[data-theme="dark"] .ad-slot { background: #1e293b; border-color: #334155; color: #64748b; }
[data-theme="dark"] .light-bg { background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 100%); }
[data-theme="dark"] .icon-btn { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .icon-btn:hover { background: #475569; color: #fff; }
[data-theme="dark"] .whatsapp-text { background: rgba(37, 211, 102, 0.15); color: #4ade80; }
[data-theme="dark"] .whatsapp-text:hover { background: rgba(37, 211, 102, 0.3); }
[data-theme="dark"] .filter-chip { background: #334155; border-color: #475569; color: #e2e8f0; }
[data-theme="dark"] .filter-chip:hover { background: #475569; }
[data-theme="dark"] .scroll-chip:hover:not(.active) { background: #334155; }
[data-theme="dark"] .search-container input { background: #1e293b; color: #f8fafc; border-color: #334155; }
[data-theme="dark"] .search-container input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.25); }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', 'Noto Color Emoji', 'Segoe UI Emoji', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Subtle background glow */
.light-bg {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -2;
    background: radial-gradient(circle at 50% 0%, #ffffff 0%, #f8fafc 100%);
}
.glow-orb { position: fixed; border-radius: 50%; filter: blur(100px); opacity: 0.15; z-index: -1; }
.orb-1 { width: 300px; height: 300px; background-color: var(--primary); top: -50px; right: -50px; }
.orb-2 { width: 400px; height: 400px; background-color: var(--wa-green); bottom: 100px; left: -100px; }

/* Top Nav */
.top-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.5rem; max-width: 1200px; margin: 0 auto;
}
.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text-dark); }
.logo span { color: var(--primary); }
.premium-btn {
    background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff;
    border: none; padding: 0.4rem 0.8rem; border-radius: 20px; font-size: 0.8rem;
    font-weight: 700; display: flex; align-items: center; gap: 0.2rem; cursor: pointer;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2); transition: var(--transition);
}
.premium-btn:hover { transform: scale(1.05); }

/* Main Container */
.app-container { max-width: 1200px; margin: 0 auto; padding: 1rem 1.5rem 2rem; }
.pb-mobile { padding-bottom: 80px; } /* Space for bottom bar */

/* 1. Hero Section */
.hero-section { text-align: center; margin-bottom: 2rem; animation: slideDown 0.4s ease-out; }
h1 { font-size: 2.2rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.5rem; letter-spacing: -0.03em; }
.subtitle { color: var(--text-body); font-size: 1.05rem; margin-bottom: 1.5rem; }

.search-container {
    position: relative; max-width: 600px; margin: 0 auto 1.5rem; display: flex; align-items: center;
}
.search-icon { position: absolute; left: 1rem; color: var(--text-muted); font-size: 1.2rem; }
.search-container input {
    width: 100%; padding: 1rem 1rem 1rem 2.8rem; border-radius: 24px;
    border: 1px solid var(--border-light); background: var(--bg-card);
    font-family: inherit; font-size: 1rem; color: var(--text-dark);
    box-shadow: var(--shadow-sm); transition: var(--transition);
}
.search-container input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

.quick-tags { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.tag-btn {
    background: var(--bg-card); border: 1px solid var(--border-light);
    padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.9rem; font-weight: 600;
    color: var(--text-body); cursor: pointer; transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.tag-btn:hover { border-color: var(--text-muted); transform: translateY(-1px); }

/* Monetization Slots */
.ad-slot {
    width: 100%; min-height: 60px; background: #f1f5f9;
    border: 1px dashed #cbd5e1; border-radius: 12px; display: flex;
    justify-content: center; align-items: center; color: #94a3b8; font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 1px; margin: 2rem 0;
}

/* Sections */
.content-section { margin-bottom: 2rem; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1rem; }
.section-header h2 { font-size: 1.2rem; font-weight: 700; color: var(--text-dark); }
.view-all { font-size: 0.85rem; color: var(--primary); text-decoration: none; font-weight: 600; }

/* 2. Trending Grid (Cards) */
.trending-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.reply-card {
    background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--border-radius);
    padding: 1.25rem; display: flex; flex-direction: column; justify-content: space-between;
    box-shadow: var(--shadow-sm); transition: var(--transition);
}
.reply-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #cbd5e1; }
.reply-text { font-size: 1.05rem; line-height: 1.5; color: var(--text-dark); margin-bottom: 1rem; }
.card-actions { display: flex; gap: 0.5rem; border-top: 1px solid var(--border-light); padding-top: 0.8rem; flex-wrap: wrap; }
.icon-btn {
    background: #f1f5f9; border: none; padding: 0.5rem 0.8rem; border-radius: 8px;
    color: var(--text-body); display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem;
    font-weight: 600; font-family: inherit; cursor: pointer; transition: var(--transition); flex: 1; justify-content: center;
    white-space: nowrap;
}
.icon-btn:hover { background: #e2e8f0; color: var(--text-dark); }
.whatsapp-text { background: rgba(37, 211, 102, 0.1); color: #005c4b; }
.whatsapp-text:hover { background: rgba(37, 211, 102, 0.2); }

/* 3. Category Grid */
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
@media(min-width: 600px) { .category-grid { grid-template-columns: repeat(4, 1fr); } }
.category-card {
    background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px;
    padding: 1rem 0.5rem; text-align: center; text-decoration: none; color: var(--text-body);
    box-shadow: var(--shadow-sm); transition: var(--transition); display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.category-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cat-icon { 
    font-size: 2.2rem; 
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.08));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.category-card:hover .cat-icon {
    filter: drop-shadow(0 8px 12px rgba(0,0,0,0.15));
}

/* Custom Emoji Emotion Physics based strictly on their Category Target */
.category-card[href="funny-replies.html"]:hover .cat-icon { animation: emojiLaugh 0.4s ease-in-out infinite; }
.category-card[href="love-messages.html"]:hover .cat-icon { animation: emojiHeartbeat 0.6s ease-in-out infinite; }
.category-card[href="sad-status.html"]:hover .cat-icon { animation: emojiSadShake 1.2s ease-in-out infinite; }
.category-card[href="attitude-replies.html"]:hover .cat-icon { animation: emojiSwagger 0.8s ease-in-out infinite; }
.category-card[href="birthday-wishes.html"]:hover .cat-icon { animation: emojiBounce 0.4s ease-in-out infinite alternate; }
.category-card[href="festival-wishes.html"]:hover .cat-icon { animation: emojiPop 0.5s ease-in-out infinite alternate; }
.category-card[href="sorry-messages.html"]:hover .cat-icon { animation: emojiBow 0.8s ease-in-out infinite; }

/* The Keyframe Math behind the Emotions */
@keyframes emojiLaugh {
    0%, 100% { transform: scale(1.3) rotate(0deg); }
    25% { transform: scale(1.3) rotate(-15deg); }
    75% { transform: scale(1.3) rotate(15deg); }
}
@keyframes emojiHeartbeat {
    0%, 100% { transform: scale(1.25); }
    50% { transform: scale(1.45); }
}
@keyframes emojiSwagger {
    0%, 100% { transform: scale(1.3) translateX(0); }
    50% { transform: scale(1.3) translateX(4px) rotate(8deg); }
}
@keyframes emojiSadShake {
    0%, 100% { transform: scale(1.2) rotate(0deg) translateY(0); }
    50% { transform: scale(1.2) rotate(-3deg) translateY(3px); }
}
@keyframes emojiBounce {
    0% { transform: scale(1.25) translateY(0); }
    100% { transform: scale(1.25) translateY(-6px); }
}
@keyframes emojiPop {
    0% { transform: scale(1.2) rotate(-8deg); }
    100% { transform: scale(1.35) rotate(8deg); }
}
@keyframes emojiBow {
    0%, 100% { transform: scale(1.25) rotate(0deg); }
    50% { transform: scale(1.25) rotate(-12deg) translateY(2px); }
}
.cat-title { font-size: 0.85rem; font-weight: 700; letter-spacing: -0.01em; }

/* 4. Situation Grid */
.situation-grid { display: flex; flex-direction: column; gap: 0.5rem; }
@media(min-width: 600px) { .situation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; } }
.sit-btn {
    width: 100%; text-align: left; background: var(--bg-card); border: 1px solid var(--border-light);
    padding: 1rem 1.25rem; border-radius: 12px; font-size: 1rem; font-weight: 600; color: var(--text-dark);
    cursor: pointer; display: flex; justify-content: space-between; box-shadow: var(--shadow-sm); transition: var(--transition);
}
.sit-btn:hover { border-color: var(--text-muted); }
.sit-btn::after { content: 'navigate_next'; font-family: 'Material Icons Round'; color: var(--text-muted); }

/* Quick Filters & Horizontal Scroll Bar */
.filter-scroll-bar {
    display: flex;
    overflow-x: auto;
    gap: 0.8rem;
    padding: 0.5rem 0 1rem 0;
    margin-bottom: 1rem;
    /* Hide scrollbar for cleaner look */
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

.filter-scroll-bar::-webkit-scrollbar {
    display: none;
}

.scroll-chip {
    white-space: nowrap;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 0.6rem 1.25rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-body);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.scroll-chip.active {
    background: var(--text-dark);
    color: #fff;
    border-color: var(--text-dark);
}

.scroll-chip:hover:not(.active) {
    background: #f1f5f9;
}

/* Inline Situation Filters */
.quick-filters { display: flex; gap: 0.4rem; margin-top: 1rem; flex-wrap: wrap; }
.filter-chip {
    background: #f1f5f9; border: 1px solid #e2e8f0; padding: 0.3rem 0.6rem; border-radius: 12px;
    font-size: 0.75rem; color: var(--text-body); cursor: pointer; transition: 0.2s; font-family: inherit; font-weight: 600;
}
.filter-chip:hover { background: #e2e8f0; }

/* 6. SEO Content block */
.seo-content { margin: 2rem 0; padding: 1.5rem; background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border-light); }
.seo-content h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-dark); }
.seo-content p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* 8. Sticky Bottom Bar for Mobile */
.mobile-bottom-bar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 1200px; background: var(--bg-card);
    border-top: 1px solid var(--border-light); display: flex; justify-content: space-around;
    padding: 0.7rem 0 0.5rem; z-index: 100; box-shadow: 0 -4px 10px rgba(0,0,0,0.03);
    border-radius: 16px 16px 0 0;
}
.bottom-tab {
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
    text-decoration: none; color: var(--text-muted); font-size: 0.7rem; font-weight: 600;
}
.bottom-tab.active { color: var(--primary); }
.bottom-tab .material-icons-round { font-size: 1.5rem; }

/* Hidden utility */
.hidden { display: none !important; }

/* Tooltip standard css */
.tooltip { position: relative; }
.tooltip::after {
    content: attr(data-tooltip); position: absolute; top: -35px; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: #fff; padding: 4px 8px; border-radius: 6px; font-size: 0.75rem;
    white-space: nowrap; opacity: 0; pointer-events: none; transition: 0.2s;
}
.tooltip:hover::after { opacity: 1; }

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

/* =========================================
   RESPONSIVE SCALING SYSTEM (Desktop vs Mobile)
   ========================================= */
@media(min-width: 768px) {
    /* Auto-scale typography and padding for massive desktop monitors */
    h1 { font-size: 3rem; margin-bottom: 1rem; }
    .subtitle { font-size: 1.2rem; }
    .hero-section { padding-top: 3rem; padding-bottom: 2rem; }
    
    /* Make search bar thicker and longer */
    .search-container { max-width: 700px; }
    .search-container input { padding: 1.2rem 1.2rem 1.2rem 3rem; font-size: 1.1rem; }
    .search-icon { font-size: 1.5rem; left: 1.2rem; }

    /* Space out grid cards dynamically */
    .trending-grid { gap: 1.5rem; }
    .reply-card { padding: 1.5rem; }
}

@media(max-width: 400px) {
    /* Extreme shrink down for tiny phones like iPhone SE */
    h1 { font-size: 1.8rem; }
    .category-grid { grid-template-columns: repeat(1, 1fr); } 
}

/* ========================================= */
/* META AI INFINITE SCROLL ANIMATIONS */
/* ========================================= */

.meta-ai-loading {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #3b82f6) !important;
    background-size: 300% 300% !important;
    animation: metaAiGradient 2s ease infinite, metaAiPulse 1s ease-in-out infinite alternate !important;
    color: white !important;
    border: none !important;
    font-weight: 700 !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;
    pointer-events: none; /* Prevent spam clicking */
}

@keyframes metaAiGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes metaAiPulse {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(139, 92, 246, 0.3); }
    100% { transform: scale(1.03); box-shadow: 0 0 25px rgba(139, 92, 246, 0.8), 0 0 40px rgba(236, 72, 153, 0.4); }
}

.shimmer-ai-card {
    opacity: 0;
    animation: metaAiCardBirth 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

@keyframes metaAiCardBirth {
    0% { 
        opacity: 0; 
        transform: translateY(20px) scale(0.95); 
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.3); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
        box-shadow: var(--shadow-sm); 
        border-color: var(--border-light); 
    }
}
