/* ==========================================================================
   CrazyNews - Ultimate Wacky & Viral News Design System
   Modern Glassmorphism, Dark/Light Mode, Vibrant Neon Accents, Mobile First
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Dark Theme Default */
    --bg-dark: #0b0f19;
    --bg-card: rgba(18, 26, 44, 0.75);
    --bg-card-hover: rgba(26, 38, 64, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(255, 255, 255, 0.1);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary-neon: #00f2fe;
    --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --accent-orange: #ff5e62;
    --accent-gradient: linear-gradient(135deg, #ff9966 0%, #ff5e62 100%);
    --purple-gradient: linear-gradient(135deg, #b92b27 0%, #1565c0 100%);
    --green-neon: #00e676;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px -5px rgba(0, 242, 254, 0.15);
    --shadow-card: 0 12px 28px rgba(0, 0, 0, 0.4);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 9999px;
    
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-dark: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --border-glass: rgba(226, 232, 240, 0.8);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --shadow-card: 0 10px 25px rgba(15, 23, 42, 0.08);
}

/* Base Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 94, 98, 0.07) 0%, transparent 40%);
    background-attachment: fixed;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

/* Main Container */
.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px 80px;
}

/* Header Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(11, 15, 25, 0.85);
    border-bottom: 1px solid var(--border-glass);
    padding: 12px 16px;
    margin-bottom: 20px;
    transition: var(--transition-fast);
}

[data-theme="light"] .navbar {
    background: rgba(241, 245, 249, 0.85);
}

.nav-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
    transition: var(--transition-bounce);
}

.brand-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.brand-title {
    font-size: 1.6rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00f2fe, #4facfe, #ff5e62);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 230, 118, 0.15);
    color: var(--green-neon);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(0, 230, 118, 0.3);
    text-transform: uppercase;
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: var(--green-neon);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 230, 118, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

/* Nav Actions & Controls */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 8px 16px 8px 36px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    width: 200px;
    transition: var(--transition-fast);
}

.search-input:focus {
    width: 260px;
    border-color: var(--primary-neon);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.9rem;
    opacity: 0.6;
}

.btn-icon {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition-bounce);
}

.btn-icon:hover {
    transform: translateY(-2px);
    border-color: var(--primary-neon);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
}

.btn-surprise {
    background: var(--accent-gradient);
    color: #ffffff;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(255, 94, 98, 0.3);
    transition: var(--transition-bounce);
}

.btn-surprise:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(255, 94, 98, 0.5);
}

/* Wacky News Ticker Bar */
.ticker-wrap {
    background: linear-gradient(90deg, #1565c0, #b92b27, #ff9966);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.ticker-label {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ticker-text {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: marquee 25s linear infinite;
}

/* Category Filter Chips Bar */
.categories-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 24px;
    scrollbar-width: none;
}

.categories-bar::-webkit-scrollbar {
    display: none;
}

.chip {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.chip:hover, .chip.active {
    background: var(--primary-gradient);
    color: #0b0f19;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
    transform: translateY(-2px);
}

/* Sort & View Options Header */
.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.feed-title {
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-glass);
    padding: 4px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-glass);
}

.btn-sort {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-sort.active {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* News Grid Layout */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* News Card Component */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-card);
    position: relative;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 242, 254, 0.3);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 242, 254, 0.15);
}

.card-media {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #1a2234;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img {
    transform: scale(1.06);
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    color: var(--primary-neon);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(0, 242, 254, 0.3);
}

.card-bookmark-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(11, 15, 25, 0.75);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.card-bookmark-btn.saved {
    color: #ffb703;
    background: rgba(255, 183, 3, 0.2);
    border: 1px solid #ffb703;
}

.card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.card-domain {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-neon);
    font-weight: 600;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.card-summary {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Reactions Bar */
.reactions-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-glass);
    flex-wrap: wrap;
}

.btn-reaction {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-bounce);
}

.btn-reaction:hover, .btn-reaction.voted {
    background: rgba(0, 242, 254, 0.15);
    color: var(--primary-neon);
    border-color: rgba(0, 242, 254, 0.4);
    transform: scale(1.05);
}

/* Social Share Bar */
.share-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-share {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    transition: var(--transition-bounce);
}

.btn-share:hover {
    transform: translateY(-2px) scale(1.1);
}

.btn-whatsapp { background: #25D366; }
.btn-facebook { background: #1877F2; }
.btn-twitter { background: #1DA1F2; }
.btn-copy { background: #64748b; }

.btn-read-more {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-neon);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-read-more:hover {
    text-decoration: underline;
}

/* Empty State & Loader */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2rem;
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-glass);
    border-top-color: var(--primary-neon);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--bg-card-hover);
    border: 1px solid var(--primary-neon);
    border-radius: var(--radius-lg);
    max-width: 540px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 242, 254, 0.2);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s var(--transition-bounce);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
}

.toast {
    background: #0f172a;
    color: #ffffff;
    border: 1px solid var(--primary-neon);
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive Rules */
@media (max-width: 768px) {
    .nav-content {
        flex-wrap: wrap;
    }
    
    .search-input {
        width: 140px;
    }
    .search-input:focus {
        width: 180px;
    }
    
    .btn-surprise span {
        display: none;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
}
