/* === Modern Variables & Reset === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #f4f6f8;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-primary: #2563eb; /* Modern Royal Blue */
    --accent-red: #e11d48; /* Premium Rose */
    --header-bg: rgba(255, 255, 255, 0.85);
    --border-color: #e2e8f0;
    --market-up: #10b981;
    --market-down: #ef4444;
    --premium-gold: #f59e0b;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    --skeleton-bg: #e2e8f0;
    --skeleton-shimmer: #f1f5f9;
}

[data-theme="dark"] {
    --bg-main: #0b1120; /* Deep Slate */
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --header-bg: rgba(11, 17, 32, 0.85);
    --border-color: #334155;
    
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.5);
    
    --skeleton-bg: #1e293b;
    --skeleton-shimmer: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* === Ticker === */
.ticker-wrap {
    background: linear-gradient(90deg, var(--accent-red), #be123c);
    color: #fff;
    padding: 8px 0;
    font-size: 0.8rem;
    font-weight: 700;
    overflow: hidden;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.ticker-label {
    background: #000;
    padding: 8px 20px;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    box-shadow: 10px 0 20px rgba(0,0,0,0.5);
}
.ticker-content {
    white-space: nowrap;
    padding-left: 100%;
    animation: ticker 35s linear infinite;
}
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* === Header (Glassmorphism) === */
header {
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
}

.logo {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    background: linear-gradient(45deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo span { color: var(--accent-primary); -webkit-text-fill-color: var(--accent-primary); }

.header-actions { display: flex; align-items: center; gap: 24px; }

.search-container { position: relative; }
.search-container i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted);
}
.search-container input {
    padding: 10px 15px 10px 40px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    transition: var(--transition);
    width: 200px;
    font-size: 0.9rem;
}
.search-container input:focus {
    width: 260px;
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-icon { color: var(--text-main); font-size: 1.3rem; transition: var(--transition); opacity: 0.7; }
.btn-icon:hover { opacity: 1; transform: scale(1.1); }

.btn-auth {
    background: var(--accent-primary);
    color: white;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}
.btn-auth:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.23);
}

/* === Navigation === */
nav {
    padding: 0 5%;
    overflow-x: auto;
    white-space: nowrap;
}
nav ul { display: flex; gap: 35px; }
nav ul li a {
    display: block;
    padding: 16px 0;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    position: relative;
    transition: var(--transition);
}
nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0%; height: 3px;
    background: var(--accent-primary);
    border-radius: 3px 3px 0 0;
    transition: var(--transition);
}
nav ul li a.active, nav ul li a:hover { color: var(--text-main); }
nav ul li a.active::after, nav ul li a:hover::after { width: 100%; }

/* === Main Layout === */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 40px 5%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}
@media (min-width: 1024px) { .container { grid-template-columns: 2.8fr 1fr; gap: 60px; } }

.utility-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.category-pills { display: flex; gap: 12px; }
.pill {
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: var(--transition);
}
.pill.active, .pill:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* === News Grid & Cards === */
.hero-section {
    position: relative;
    margin-bottom: 50px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 500px;
    background: #000;
    box-shadow: var(--shadow-lg);
}
.hero-slide {
    position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease; z-index: 1;
}
.hero-slide.active { opacity: 1; z-index: 2; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.hero-content {
    position: absolute; bottom: 0; left: 0; width: 100%;
    padding: 60px 50px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    color: white;
}
.hero-content h2 {
    font-size: 2.8rem; margin-top: 15px; margin-bottom: 15px; line-height: 1.1;
    font-weight: 800; letter-spacing: -1px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}
.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(37, 99, 235, 0.3);
}
.article-img { height: 200px; width: 100%; object-fit: cover; border-bottom: 1px solid var(--border-color); }
.article-body { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.article-meta {
    display: flex; justify-content: space-between;
    font-size: 0.8rem; color: var(--accent-primary);
    margin-bottom: 12px; font-weight: 700; text-transform: uppercase;
}
.article-title {
    font-size: 1.25rem; font-weight: 700; margin-bottom: 15px;
    line-height: 1.4; color: var(--text-main);
}
.article-excerpt { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 20px; flex-grow: 1; line-height: 1.6; }

/* === Sidebar Widgets === */
.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}
.widget-title {
    font-size: 1.2rem; font-weight: 800; margin-bottom: 25px;
    color: var(--text-main); border-left: 4px solid var(--accent-primary);
    padding-left: 15px; border-radius: 2px;
}
.market-item {
    display: flex; justify-content: space-between; padding: 14px 0;
    border-bottom: 1px solid var(--border-color); font-family: 'Courier New', monospace; font-size: 1.05rem;
}
.market-item:last-child { border-bottom: none; padding-bottom: 0; }
.trend-up { color: var(--market-up); background: rgba(16, 185, 129, 0.1); padding: 2px 8px; border-radius: 4px; font-weight: bold;}
.trend-down { color: var(--market-down); background: rgba(239, 68, 68, 0.1); padding: 2px 8px; border-radius: 4px; font-weight: bold;}

.top-story-list li {
    display: flex; gap: 15px; padding: 16px 0;
    border-bottom: 1px solid var(--border-color); align-items: center;
}
.top-story-list .rank { font-size: 2.2rem; font-weight: 900; color: var(--border-color); line-height: 1; }
.top-story-list .title { font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.top-story-list .title:hover { color: var(--accent-primary); }

/* === Modal (Glassmorphism) === */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    background: var(--bg-card);
    padding: 40px; border-radius: var(--radius-lg);
    width: 100%; max-width: 450px; position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(20px); transition: var(--transition);
}
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }
.close-modal {
    position: absolute; top: 20px; right: 25px;
    font-size: 1.5rem; cursor: pointer; color: var(--text-muted); transition: var(--transition);
}
.close-modal:hover { color: var(--accent-red); transform: rotate(90deg); }

.form-group input {
    width: 100%; padding: 14px 16px;
    border: 2px solid var(--border-color); border-radius: var(--radius-md);
    background: var(--bg-main); color: var(--text-main); font-size: 1rem;
    transition: var(--transition);
}
.form-group input:focus {
    outline: none; border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
.btn-submit {
    width: 100%; padding: 16px;
    background: var(--accent-primary); color: white;
    border-radius: var(--radius-md); font-weight: 700; font-size: 1.05rem;
    transition: var(--transition); margin-top: 10px;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}
.btn-submit:hover { background: #1d4ed8; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.23); }

/* === Skeleton Animation Polish === */
.skeleton {
    background: var(--skeleton-bg);
    background-image: linear-gradient(90deg, var(--skeleton-bg) 0px, var(--skeleton-shimmer) 40px, var(--skeleton-bg) 80px);
    background-size: 200vw 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-md);
}

/* === Premium Corporate Footer === */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 80px 5% 30px;
    margin-top: 80px;
    position: relative;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.02);
}

.footer-content {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    margin-bottom: 60px;
}

.footer-col h4 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    display: inline-block;
}

.footer-col p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-col ul li a {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.footer-col ul li a::before {
    content: "›";
    margin-right: 8px;
    color: var(--accent-primary);
    font-weight: bold;
    font-size: 1.2rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--accent-primary);
    transform: translateX(5px);
}

.footer-col ul li a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.footer-bottom {
    max-width: 1440px;
    margin: 0 auto;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}
