/* --- VARIABLES & THEMING --- */
:root {
    --bg-color: #000;
    --text-color: #fff;
    --navbar-bg: rgba(0, 0, 0, 0.6);
    --card-bg: #000;
    --card-border: rgba(255, 255, 255, 0.1);
    --headline-color: #fff;
    --meta-color: #bbb;
    --body-text-color: #ddd;
    --overlay-bg: linear-gradient(to bottom, #1a1a1a, #000);
    --btn-bg: rgba(255, 255, 255, 0.1);
    --btn-border: rgba(255, 255, 255, 0.2);
    --btn-hover: rgba(255, 255, 255, 0.2);
    --icon-fill: white;
    --logo-filter: invert(1);
    --scroll-hint-color: rgba(255, 255, 255, 0.5);
    --menu-bg: #111;
    --menu-text: #fff;
    --menu-border: #333;
}

body.light-mode {
    --bg-color: #fff;
    --text-color: #333;
    --navbar-bg: rgba(255, 255, 255, 0.9);
    --card-bg: #fff;
    --card-border: rgba(0, 0, 0, 0.1);
    --headline-color: #000;
    --meta-color: #666;
    --body-text-color: #333;
    --overlay-bg: linear-gradient(to bottom, #f0f0f0, #fff);
    /* Light gradient */
    --btn-bg: rgba(0, 0, 0, 0.05);
    --btn-border: rgba(0, 0, 0, 0.1);
    --btn-hover: rgba(0, 0, 0, 0.1);
    --icon-fill: #333;
    --logo-filter: invert(0);
    --scroll-hint-color: rgba(0, 0, 0, 0.5);
    --menu-bg: #fff;
    --menu-text: #333;
    --menu-border: #eee;
}

/* --- RESET & BASICS --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
}

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

/* --- HEADER --- */
/* Floating header for navigation */
.navbar {
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    height: 60px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--card-border);
    transition: background 0.3s;
}

.navbar .logo {
    height: 30px;
    display: block;
    filter: var(--logo-filter);
    transition: filter 0.3s;
}

/* Hamburger Menu */
.menu-icon {
    position: absolute;
    left: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-icon span {
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    transition: background-color 0.3s;
}

/* --- MAIN CONTAINER (SCROLL SNAP) --- */
.main-container {
    height: 100vh;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.main-container::-webkit-scrollbar {
    display: none;
}

/* --- NEWS CARD (FULL SCREEN) --- */
.news-card {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #111;
    /* Keep base dark, overlay handles look? No, this is behind everything. */
    background-color: var(--bg-color);
    /* Match body bg */
}

/* Background Image as layers */
.news-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    filter: blur(20px);
    z-index: 1;
}

/* The Active Content Card (Phone-like on Desktop) */
.news-content-wrapper {
    position: relative;
    z-index: 2;
    width: 400px;
    height: auto;
    min-height: 450px;
    max-height: calc(100vh - 100px);

    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--card-border);
    margin-top: 60px;
    transition: background-color 0.3s, border 0.3s;
}

.news-main-image {
    width: 100%;
    height: 250px;
    min-height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Gradient overlay for text readability */
.text-overlay {
    padding: 15px 20px;
    background: var(--overlay-bg);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    transition: background 0.3s;
}

/* Headline */
.headline {
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--headline-color);
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.0);
    /* Remove shadow in light mode if needed, let's keep it subtle or var it */
}

/* Meta Data */
.meta-info {
    font-size: 11px;
    color: var(--meta-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Body Text */
.article-body {
    font-size: 14px;
    line-height: 1.4;
    color: var(--body-text-color);
    margin-bottom: 15px;
    display: block;
    overflow-y: auto;
    scrollbar-width: none;
}

/* Footer / Read More Button */
.read-more-btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--text-color);
    border-radius: 30px;
    text-decoration: none;
    font-size: 13px;
    backdrop-filter: blur(5px);
    align-self: flex-start;
    transition: background 0.3s, color 0.3s;
    margin-top: auto;
}

.read-more-btn:hover {
    background: var(--btn-hover);
}

/* Action Buttons (Right Side) */
.actions-container {
    position: absolute;
    right: calc(50% - 280px);
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);

    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

.action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--btn-bg);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--btn-border);
    transition: transform 0.2s, background 0.3s;
}

.action-btn:hover {
    transform: scale(1.1);
    background: var(--btn-hover);
}

.action-btn svg {
    width: 24px;
    height: 24px;
    fill: var(--icon-fill);
    transition: fill 0.3s;
}

/* --- MOBILE RESPONSIVENESS --- */
@media screen and (max-width: 600px) {
    .news-content-wrapper {
        width: 94%;
        margin: 80px auto 20px auto;
        /* Top margin for header, bottom for spacing */
        height: auto;
        min-height: 50vh;
        /* Ensure reasonable size */
        max-height: calc(100vh - 120px);
        border-radius: 20px;
        /* Rounded corners as requested */
        border: 1px solid var(--card-border);
    }

    .news-main-image {
        height: 250px;
        /* Fixed height for consistency */
        min-height: 250px;
    }

    .text-overlay {
        flex: 0;
        /* Do NOT stretch to fill empty space */
        padding: 20px;
        padding-bottom: 20px;
    }

    .actions-container {
        right: 15px;
        bottom: 120px;
    }
}

/* Hide Pagination (Infinite Scroll feel implies we might not need traditional pagination, 
   but for now we hide it or stick it at the very bottom of the snap list) */
.pagination {
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    color: var(--text-color);
}

/* Spinner animation for infinite scroll */
.spinner {
    border: 4px solid var(--btn-border);
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

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

/* --- SCROLL HINT PILOT --- */
.scroll-hint {
    position: absolute;
    bottom: 15px;
    /* Pushed low to sit below the larger card */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--scroll-hint-color);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 5;
    animation: bounce 2s infinite;
    pointer-events: none;
    transition: color 0.3s;
}

.scroll-hint svg {
    width: 24px;
    height: 24px;
    fill: var(--scroll-hint-color);
    margin-top: 5px;
    transition: fill 0.3s;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}