/**
 * Stream Cinema Caolina - Hlavní styly v2.2
 * AJAX kontrola + Animované hvězdy
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0a0e27;
    color: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ============================================================================
   ANIMOVANÁ NOČNÍ OBLOHA
   ============================================================================ */

.cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #000428 0%, #004e92 100%);
    z-index: 0;
}

/* Animované hvězdy - plynulý pohyb */
@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes move {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-100px) translateX(50px); }
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    z-index: 1;
}

/* Vrstva 1 - Malé hvězdy */
.stars::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20% 30%, white, transparent),
        radial-gradient(1px 1px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(1px 1px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(1px 1px at 15% 90%, white, transparent),
        radial-gradient(1px 1px at 45% 20%, white, transparent),
        radial-gradient(1px 1px at 75% 45%, white, transparent),
        radial-gradient(1px 1px at 10% 60%, white, transparent);
    background-size: 200px 200px, 250px 250px, 300px 300px;
    background-position: 0 0, 50px 50px, 100px 100px;
    animation: move 120s linear infinite, twinkle 3s ease-in-out infinite;
    opacity: 0.7;
}

/* Vrstva 2 - Střední hvězdy */
.stars::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 40% 40%, white, transparent),
        radial-gradient(2px 2px at 70% 20%, white, transparent),
        radial-gradient(2px 2px at 25% 65%, white, transparent),
        radial-gradient(2px 2px at 85% 75%, white, transparent),
        radial-gradient(2px 2px at 55% 85%, white, transparent);
    background-size: 250px 250px, 300px 300px;
    background-position: 0 0, 80px 80px;
    animation: move 100s linear infinite reverse, twinkle 5s ease-in-out infinite;
    opacity: 0.9;
}

/* Jasné hvězdy - třetí vrstva */
.nebula {
    position: fixed;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(88, 101, 242, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    z-index: 2;
}

/* Padající hvězdy */
@keyframes shooting {
    0% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(300px) translateY(300px);
        opacity: 0;
    }
}

.shooting-star {
    position: fixed;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8);
    z-index: 3;
    animation: shooting 3s linear;
    opacity: 0;
}

/* ============================================================================
   HORNÍ LIŠTA
   ============================================================================ */

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.95) 0%, rgba(0, 78, 146, 0.85) 100%);
    border-bottom: 1px solid rgba(88, 101, 242, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    backdrop-filter: blur(10px);
}

.logo {
    height: 50px;
    filter: drop-shadow(0 0 10px rgba(88, 101, 242, 0.5));
}

.download-buttons {
    display: flex;
    gap: 15px;
}

.top-download-btn {
    background: linear-gradient(135deg, #5865f2 0%, #7289da 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.top-download-btn:hover {
    background: linear-gradient(135deg, #7289da 0%, #99aab5 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(88, 101, 242, 0.5);
}

.top-download-btn.disabled {
    background: linear-gradient(135deg, #72767d 0%, #99aab5 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

.top-download-btn.disabled:hover {
    transform: none;
}

/* ============================================================================
   HLAVNÍ OBSAH
   ============================================================================ */

.container {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 30px 40px;
}

.page-title {
    text-align: center;
    margin-bottom: 50px;
    color: #7289da;
    font-size: 2.5em;
    text-shadow: 0 0 20px rgba(114, 137, 218, 0.5);
    animation: fadeInDown 1s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.9) 0%, rgba(0, 78, 146, 0.7) 100%);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 15px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.news-card:hover {
    transform: translateY(-8px);
    border-color: rgba(114, 137, 218, 0.6);
    box-shadow: 0 15px 50px rgba(88, 101, 242, 0.4);
}

.news-date {
    color: #99aab5;
    font-size: 0.85em;
    margin-bottom: 15px;
}

.news-title {
    color: #7289da;
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(114, 137, 218, 0.3);
}

.news-preview {
    color: #b9bbbe;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: #7289da;
    font-weight: 600;
    margin-top: 15px;
    display: inline-block;
}

/* ============================================================================
   HLASOVÁNÍ
   ============================================================================ */

.vote-container {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(88, 101, 242, 0.2);
}

.vote-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 2px solid;
}

.vote-btn.up {
    background: rgba(67, 181, 129, 0.1);
    border-color: rgba(67, 181, 129, 0.3);
    color: #43b581;
}

.vote-btn.up:hover:not(.disabled) {
    background: rgba(67, 181, 129, 0.2);
    border-color: #43b581;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(67, 181, 129, 0.3);
}

.vote-btn.down {
    background: rgba(240, 71, 71, 0.1);
    border-color: rgba(240, 71, 71, 0.3);
    color: #f04747;
}

.vote-btn.down:hover:not(.disabled) {
    background: rgba(240, 71, 71, 0.2);
    border-color: #f04747;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(240, 71, 71, 0.3);
}

.vote-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vote-count {
    font-size: 1.1em;
    font-weight: 700;
}

/* ============================================================================
   MODAL
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.95) 0%, rgba(0, 78, 146, 0.9) 100%);
    border: 1px solid rgba(88, 101, 242, 0.4);
    border-radius: 15px;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(240, 71, 71, 0.2);
    border: 2px solid rgba(240, 71, 71, 0.5);
    color: #f04747;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(240, 71, 71, 0.4);
    transform: rotate(90deg);
}

.modal-date {
    color: #99aab5;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.modal-title {
    color: #7289da;
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 25px;
    text-shadow: 0 0 15px rgba(114, 137, 218, 0.5);
}

.modal-description {
    color: #b9bbbe;
    line-height: 1.8;
    font-size: 1.1em;
    white-space: pre-wrap;
}

.modal-content button {
    transition: all 0.3s;
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

.no-news {
    text-align: center;
    padding: 100px 20px;
    color: #99aab5;
    font-size: 1.2em;
}

/* ============================================================================
   RESPONZIVITA
   ============================================================================ */

@media (max-width: 1024px) {
    .top-bar {
        height: auto;
        padding: 15px 20px;
    }
    
    .download-buttons {
        gap: 10px;
    }
    
    .top-download-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .container {
        padding-top: 140px;
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .page-title {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .logo {
        height: 35px;
    }
    
    .download-buttons {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .top-download-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
    
    .container {
        padding: 180px 15px 30px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .page-title {
        font-size: 1.8em;
    }
    
    .news-card {
        padding: 20px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .modal-title {
        font-size: 1.5em;
    }
    
    .vote-container {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5em;
    }
    
    .news-title {
        font-size: 1.3em;
    }
    
    .container {
        padding: 200px 10px 20px;
    }
}
