/* Modern Design System - Linear/Vercel Aesthetic */
:root {
    --primary: #ef4444; 
    --primary-dark: #dc2626;
    --secondary: #3b82f6;
    --accent: #f59e0b;
    --success: #10b981;
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --text-main: #000000;
    --text-muted: #666666;
    --border: #eaeaea;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --nav-height: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; }
body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    line-height: 1.5; 
    overflow-x: hidden;
}

/* View Management */
#home-view, #stats-detail-view, #forum-view, #login-view, #profile-view, #thread-detail-view { transition: opacity 0.3s ease; }
#stats-detail-view, #forum-view, #login-view, #profile-view, #thread-detail-view { display: none; }

/* Live Ticker Bar */
#live-ticker {
    background: #000;
    color: #fff;
    padding: 8px 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    position: relative;
    z-index: 10;
    letter-spacing: 0.05em;
}

/* HEADER & NAVIGATION */
#site-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    height: var(--nav-height);
}

#header-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#site-logo {
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
    color: #000;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

#nav-menu {
    display: flex;
    list-style: none;
    gap: 2px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link:hover { color: #000; background: #f5f5f7; }
.nav-link.active { color: var(--primary); background: rgba(239, 68, 68, 0.05); }

.mobile-auth-item { display: none; }

/* HERO SECTION */
#hero-section {
    padding: 100px 1.5rem 60px;
    text-align: center;
    background: radial-gradient(circle at top, #fafafa 0%, #ffffff 100%);
}

#hero-content { max-width: 900px; margin: 0 auto; }

#hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, #000 0%, #666 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 3rem;
}

/* SEARCH BOX */
#search-container {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr auto;
    gap: 20px;
    align-items: flex-end;
}

.input-group { text-align: left; }
.label { display: block; font-size: 0.75rem; font-weight: 700; color: #888; margin-bottom: 8px; text-transform: uppercase; }
.form-input { width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 10px; outline: none; font-size: 0.95rem; background: #fff; }
.form-input:focus { border-color: #000; }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    font-size: 0.95rem;
}
.btn-primary { background: #000; color: #fff; }
.btn-primary:hover { background: #333; transform: scale(1.02); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: #000; }
.btn-outline:hover { background: #f5f5f7; border-color: #000; }

/* SECTIONS */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section-padding { padding: 100px 0; }
.section-title { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1rem; }
.section-subtitle { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 60px; }

/* GRID SYSTEM */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }

/* CARDS */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    transition: all 0.3s;
}
.card:hover { border-color: #000; transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* LOTTERY TABLES */
.lottery-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.lottery-table td { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.p-name { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; }
.p-num { font-weight: 700; font-size: 1.1rem; text-align: right; letter-spacing: 0.5px; }
.p-num.special { color: var(--primary); font-size: 1.5rem; }

/* IMPACT SECTION */
#impact-section { background: #000; color: #fff; }
.impact-stat { font-size: 3rem; font-weight: 800; color: var(--primary); margin-bottom: 8px; }

/* FORUM VIEW */
.forum-header { background: #fbfbfd; border-bottom: 1px solid var(--border); padding: 60px 0; margin-bottom: 40px; }
.thread-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px; transition: all 0.2s; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.thread-card:hover { border-color: #000; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.thread-title { font-size: 1.1rem; font-weight: 700; color: #000; text-decoration: none; margin-bottom: 8px; display: block; }
.thread-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.thread-stats { display: flex; gap: 15px; font-size: 0.85rem; color: var(--text-muted); }
.thread-stat-item { display: flex; align-items: center; gap: 5px; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.page-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: #000; font-weight: 600; transition: all 0.2s; }
.page-btn:hover, .page-btn.active { background: #000; color: #fff; border-color: #000; }

/* DETAIL PAGE SPECIFIC */
.stats-header { background: #fbfbfd; border-bottom: 1px solid var(--border); padding: 60px 0; margin-bottom: 60px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.data-table th { background: #f9f9f9; padding: 16px; text-align: left; font-size: 0.75rem; font-weight: 700; color: #888; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.data-table td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.data-table tr:last-child td { border-bottom: none; }
.num-badge { display: inline-block; width: 32px; height: 32px; line-height: 32px; text-align: center; background: #000; color: #fff; border-radius: 50%; font-weight: 700; font-size: 0.85rem; }

/* FOOTER */
#site-footer { background: #000; color: #fff; padding: 80px 1.5rem 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4rem; margin-bottom: 60px; }
.footer-col h4 { margin-bottom: 24px; font-size: 0.9rem; color: #888; text-transform: uppercase; letter-spacing: 0.1em; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: #fff; text-decoration: none; opacity: 0.6; font-size: 0.9rem; transition: 0.2s; }
.footer-links a:hover { opacity: 1; }

#mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--text-main); }

/* RESPONSIVE */
@media (max-width: 1024px) {
    #search-container { grid-template-columns: 1fr 1fr; }
    .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    #mobile-menu-btn { display: block; }
    #nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-md);
        border-bottom: 1px solid var(--border);
        gap: 5px;
        z-index: 999;
    }
    #nav-menu.active { display: flex; }
    #mobile-menu-btn { z-index: 1001; position: relative; }
    .nav-link { display: block; padding: 12px 16px; font-size: 1rem; border-radius: var(--radius-md); text-align: center; }
    #search-container { grid-template-columns: 1fr; }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    #hero-title { font-size: 2.8rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    
    #auth-actions { display: none !important; }
    .mobile-auth-item { display: block; border-top: 1px solid #f0f0f0; margin-top: 8px; padding-top: 8px; }
    
    .thread-card { flex-direction: column; align-items: flex-start; gap: 15px; }
    .thread-stats { width: 100%; justify-content: flex-start; border-top: 1px solid var(--border); padding-top: 15px; margin-top: 5px; }
}