:root {
    --bg: #050505;
    --surface: rgba(255, 255, 255, 0.03);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --skeleton: rgba(255, 255, 255, 0.05);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    --radius-lg: 28px;
    --radius-md: 20px;
}

body.light-mode {
    --bg: #f2f2f7;
    --surface: rgba(255, 255, 255, 0.6);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
    --text: #1c1c1e;
    --text-dim: #8e8e93;
    --accent: #007aff;
    --accent-glow: rgba(0, 122, 255, 0.3);
    --skeleton: rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

/* Glass Background Blobs */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
    opacity: 0.6;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.blob-3 {
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, transparent 70%);
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 15%) scale(1.1); }
}

header {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 900px;
    height: 64px;
    background: var(--glass);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    z-index: 1000;
    border: 0.5px solid var(--glass-border);
    border-radius: 22px;
    display: flex;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.header-inner {
    width: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    transition: var(--transition);
}

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

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.header-logo .brand {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-text .sub-brand {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-btn {
    background: var(--surface);
    border: 0.5px solid var(--glass-border);
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--text);
    transition: var(--transition);
}

.theme-btn:hover {
    background: var(--text);
    color: var(--bg);
    transform: scale(1.05);
}

.home-link {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    background: var(--surface);
    padding: 8px 16px;
    border-radius: 12px;
    border: 0.5px solid var(--glass-border);
    transition: var(--transition);
}

.home-link:hover {
    background: var(--glass);
    transform: translateY(-1px);
}

main {
    padding-top: 110px;
    padding-bottom: 60px;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1320px;
    padding: 0 20px;
}

.live-status-bar {
    display: flex;
    align-items: center;
    background: var(--glass);
    border: 0.5px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
    padding: 8px 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
    transition: all 0.3s ease;
}

.live-status-bar.updating {
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
}

.live-indicator {
    display: flex;
    align-items: center;
    font-weight: 800;
    color: #ef4444;
    font-size: 13px;
    letter-spacing: 1px;
    margin-right: 16px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.ticker-wrap {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
    mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
}

.ticker {
    display: inline-flex;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
}

.ticker:hover {
    animation-play-state: paused;
}

.ticker__item {
    font-size: 14px;
    color: var(--text);
    padding: 0 24px;
    position: relative;
    font-weight: 500;
}

.ticker__item::after {
    content: '•';
    position: absolute;
    right: -4px;
    color: var(--text-dim);
}

.ticker__item:last-child::after {
    display: none;
}

@keyframes ticker {
    0% { transform: translateX(50%); }
    100% { transform: translateX(-100%); }
}

.breaking-badge {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #fff !important;
    backdrop-filter: blur(10px);
    display: inline-flex !important;
    align-items: center;
}
body.light-mode .breaking-badge {
    color: #b91c1c !important;
}

@keyframes slideUpFade {
    0% { opacity: 0; translate: 0 20px; }
    100% { opacity: 1; translate: 0 0; }
}

/* --- Layout structure --- */
.news-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(300px, 1fr);
    gap: 32px;
    margin-bottom: 40px;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.more-news-container {
    margin-top: 20px;
}

/* --- Cards Styling: Hero --- */
.hero-card {
    position: relative;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
    text-decoration: none;
    background: var(--glass);
    border: 0.5px solid var(--glass-border);
    transition: var(--transition);
}

.hero-card:hover {
    transform: scale(0.995);
}

.hero-card img {
    width: 100%;
    height: 480px;
    object-fit: cover;
    transition: var(--transition);
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    color: #fff;
}

body.light-mode .hero-content {
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
}

.trending-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 12px;
    display: inline-block;
    border: 0.5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero-content h2 {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

/* --- Grids --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.news-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* --- Shared Base Card --- */
.news-card {
    display: flex;
    background: var(--glass);
    border: 0.5px solid var(--glass-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    overflow: hidden;
    opacity: 0;
    animation: slideUpFade 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.news-card:hover {
    background: var(--surface);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

body.light-mode .news-card:hover { box-shadow: 0 10px 20px rgba(0,0,0,0.06); }

.meta {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.meta .dot {
    width: 3px;
    height: 3px;
    background: var(--accent);
    border-radius: 50%;
}

/* --- Vertical Grid Card --- */
.grid-card {
    flex-direction: column;
}
.grid-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
}
.grid-card .list-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.grid-card h3 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* --- Horizontal Sidebar Grid (List) --- */
.news-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 12px;
    background: transparent;
    border: none;
    border-bottom: 0.5px solid var(--glass-border);
    border-radius: 0;
    opacity: 0;
    animation: slideUpFade 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.sidebar-card:last-child {
    border-bottom: none;
}

.sidebar-card:hover {
    background: var(--glass);
    border-radius: var(--radius-md);
    transform: translateX(4px);
    border-bottom-color: transparent;
}

.sidebar-card img {
    width: 90px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-card .list-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.sidebar-card h3 {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Skeleton Loading */
@keyframes shimmer {
    0% { opacity: 0.4; background-color: var(--skeleton); }
    100% { opacity: 0.8; background-color: rgba(255, 255, 255, 0.08); }
}

.skeleton {
    background: var(--skeleton);
    animation: shimmer 1.5s infinite alternate;
    border-radius: 8px;
}

.sk-hero { height: 480px; width: 100%; border-radius: var(--radius-lg); margin-bottom: 32px; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.sk-item { display: flex; flex-direction: column; background: var(--glass); border-radius: var(--radius-md); border: 0.5px solid var(--glass-border); overflow: hidden; padding-bottom: 16px; }
.sk-img-grid { height: 170px; width: 100%; border-radius: 0; margin-bottom: 16px; }
.sk-text { height: 16px; margin: 0 16px 10px; border-radius: 4px; }
.sk-text-sm { height: 12px; margin-bottom: 0; width: 60%; }

.sk-item-sidebar { display: flex; gap: 16px; padding: 12px; border-bottom: 0.5px solid var(--glass-border); }
.sk-img-side { width: 90px; height: 70px; border-radius: 8px; flex-shrink: 0; }
.sk-item-sidebar .sk-text { margin: 0 0 10px 0; border-radius: 4px; }


/* SEO & Footer Styling */
.seo-content {
    margin-top: 60px;
    padding: 40px;
    background: var(--glass);
    border: 0.5px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.seo-content h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--accent);
}

.seo-content p {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.seo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.seo-item h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer {
    padding: 40px 0;
    text-align: center;
    border-top: 0.5px solid var(--glass-border);
    margin-top: 60px;
}

.footer p {
    font-size: 13px;
    color: var(--text-dim);
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* Mobile Optimizations */
@media (max-width: 992px) {
    .news-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .hero-card img { height: 400px; }
    .sk-hero { height: 400px; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .seo-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 18px; }
}

@media (max-width: 640px) {
    header { height: 60px; }
    main { padding-top: 80px; }
    .hero-card img { height: 320px; }
    .hero-content { padding: 20px; }
    .hero-content h2 { font-size: 24px; }
    
    .news-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .news-footer-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    
    .grid-card img { height: 120px; }
    .grid-card .list-content { padding: 12px; }
    .grid-card h3 { font-size: 14px; margin-bottom: 8px; }
    
    .sk-hero { height: 320px; }
    .sk-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .sk-img-grid { height: 120px; margin-bottom: 12px; }
    .sk-text { margin: 0 12px 8px; }
    
    .sidebar-card { gap: 12px; padding: 10px; }
    .sidebar-card img { width: 80px; height: 60px; border-radius: 6px; }
    .sidebar-card h3 { font-size: 13.5px; }
    
    .seo-content { padding: 24px; }
}

@media (max-width: 480px) {
    .news-grid { grid-template-columns: 1fr; }
    .news-footer-grid { grid-template-columns: 1fr; }
    
    .grid-card { flex-direction: row; padding: 12px; gap: 12px; align-items: center; }
    .grid-card img { width: 100px; height: 80px; border-radius: 8px; flex-shrink: 0; }
    .grid-card .list-content { padding: 0; justify-content: center; }
    .grid-card h3 { font-size: 15px; -webkit-line-clamp: 2; margin-bottom: 6px; }
    
    .sk-grid { grid-template-columns: 1fr; }
    .sk-item { flex-direction: row; padding: 12px; gap: 12px; align-items: center; }
    .sk-img-grid { width: 100px; height: 80px; border-radius: 8px; margin: 0; flex-shrink: 0; }
    .sk-item .sk-text { margin: 0 0 8px 0; }
    .sk-item .sk-text-sm { margin: 0; }
}