/* Star News - Space Theme CSS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    position: relative;
}

/* bg2.png - Very background with pulse zoom 40% and 360 degree spin */
html::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/images/bg2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: pulseAndSpin 360s linear infinite;
    transform-origin: center center;
    will-change: transform;
    z-index: -4;
}

/* star.png - On top of bg2.png, 10% opacity, fit, 3D skew reactive (more prominent) */
html::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/images/star.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: -3;
    pointer-events: none;
    transform-style: preserve-3d;
    transform: 
        perspective(800px) 
        rotateX(var(--star-rotate-x, 0deg)) 
        rotateY(var(--star-rotate-y, 0deg))
        skewX(var(--star-skew-x, 0deg))
        skewY(var(--star-skew-y, 0deg));
    transition: transform 0.05s ease-out;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

/* Starfield container - will be populated by JavaScript */
.starfield-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

/* Individual star */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: starMove linear infinite, starTwinkle ease-in-out infinite;
}

/* Shooting star */
.shooting-star {
    position: fixed;
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1), transparent);
    border-radius: 50%;
    z-index: -2;
    pointer-events: none;
    opacity: 0;
    animation: shootingStar linear;
}

/* Gradient fog/shift overlay with 90 second cycle */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle at 20% 50%, rgba(153, 69, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(0, 255, 255, 0.08) 0%, transparent 50%);
    animation: gradientShift 90s ease-in-out infinite, fogMove 90s ease-in-out infinite;
}

/* Combined pulse (120s) and spin (180s) - LCM is 360s for smooth sync */
@keyframes pulseAndSpin {
    /* Pulse cycle: 120s = 1/3 of 360s, so 3 pulses per full rotation */
    /* Spin cycle: 180s = 1/2 of 360s, so 2 rotations per animation */
    0% {
        transform: scale(1) rotate(0deg);
    }
    /* 60s mark: 1/6 of 360s - halfway through first pulse, 1/3 rotation */
    16.67% {
        transform: scale(1.2) rotate(60deg);
    }
    /* 120s mark: 1/3 of 360s - peak of first pulse, 2/3 rotation */
    33.33% {
        transform: scale(1.4) rotate(120deg);
    }
    /* 180s mark: 1/2 of 360s - back to scale 1, full rotation */
    50% {
        transform: scale(1) rotate(180deg);
    }
    /* 240s mark: 2/3 of 360s - peak of second pulse, 4/3 rotation */
    66.67% {
        transform: scale(1.4) rotate(240deg);
    }
    /* 300s mark: 5/6 of 360s - halfway through third pulse, 5/3 rotation */
    83.33% {
        transform: scale(1.2) rotate(300deg);
    }
    /* 360s mark: full cycle - back to start, 2 full rotations */
    100% {
        transform: scale(1) rotate(360deg);
    }
}

@keyframes gradientShift {
    0%, 100% {
        background: radial-gradient(circle at 20% 50%, rgba(153, 69, 255, 0.08) 0%, transparent 50%),
            radial-gradient(circle at 80% 50%, rgba(0, 255, 255, 0.08) 0%, transparent 50%);
    }
    33% {
        background: radial-gradient(circle at 80% 30%, rgba(153, 69, 255, 0.08) 0%, transparent 50%),
            radial-gradient(circle at 20% 70%, rgba(0, 255, 255, 0.08) 0%, transparent 50%);
    }
    66% {
        background: radial-gradient(circle at 50% 80%, rgba(153, 69, 255, 0.08) 0%, transparent 50%),
            radial-gradient(circle at 50% 20%, rgba(0, 255, 255, 0.08) 0%, transparent 50%);
    }
}

@keyframes starMove {
    0% {
        transform: translateX(100vw) translateY(var(--start-y));
    }
    100% {
        transform: translateX(-10px) translateY(var(--end-y));
    }
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.9;
    }
}

@keyframes shootingStar {
    0% {
        opacity: 0;
        transform: translateX(var(--shoot-start-x)) translateY(var(--shoot-start-y)) rotate(45deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(var(--shoot-end-x)) translateY(var(--shoot-end-y)) rotate(45deg);
    }
}

@keyframes fogMove {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    50% {
        opacity: 0.4;
        transform: translateY(-5px);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 50px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 8px 20px;
    color: #fff;
    width: 250px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn-watch {
    background: #ff4444;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-watch:hover {
    background: #ff6666;
    transform: translateY(-2px);
}

.btn-create {
    background: transparent;
    border: 2px solid #fff;
    padding: 8px 18px;
    border-radius: 5px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-create:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-login {
    background: #8b5cf6;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: #a78bfa;
    transform: translateY(-2px);
}

/* Breaking News Ticker */
.breaking-news-ticker {
    background: linear-gradient(90deg, #ff4444, #ff6b6b);
    padding: 10px 0;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.ticker-label {
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 20px;
    font-weight: bold;
    margin-right: 20px;
    white-space: nowrap;
}

.ticker-content {
    display: flex;
    animation: ticker 30s linear infinite;
}

.ticker-item {
    margin-right: 50px;
    white-space: nowrap;
}

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

    100% {
        transform: translateX(-50%);
    }
}

/* Main Content */
.main-content {
    padding: 40px 0;
}

.section-title {
    font-size: 3em;
    margin-bottom: 40px;
    text-align: center;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* News Widget */
.news-widget {
    background: rgba(20, 20, 40, 0.6);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.news-widget:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.widget-icon {
    background: rgba(0, 0, 0, 0.5);
    padding: 40px;
    text-align: center;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.widget-icon img {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.widget-icon h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.star-news-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9em;
    font-weight: bold;
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.star-news-badge span:first-child {
    color: #fff;
}

/* Widget Content */
.widget-content {
    padding: 30px;
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.6), rgba(42, 82, 152, 0.4));
}

.news-card {
    position: relative;
}

.category-badge {
    display: inline-block;
    background: rgba(139, 92, 246, 0.8);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-card h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    line-height: 1.3;
}

.news-card p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more {
    color: #60a5fa;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-block;
}

.read-more:hover {
    color: #93c5fd;
    transform: translateX(5px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .main-nav {
        flex-wrap: wrap;
    }

    .search-input {
        width: 100%;
        margin-bottom: 10px;
    }

    .section-title {
        font-size: 2em;
    }
}

/* Loading Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s ease-in-out infinite;
}
    letter-spacing: 1px;
}

.news-card h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    line-height: 1.3;
}

.news-card p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more {
    color: #60a5fa;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-block;
}

.read-more:hover {
    color: #93c5fd;
    transform: translateX(5px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .main-nav {
        flex-wrap: wrap;
    }

    .search-input {
        width: 100%;
        margin-bottom: 10px;
    }

    .section-title {
        font-size: 2em;
    }
}

/* Loading Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s ease-in-out infinite;
}