/* ==========================================
   KARTIKA - HİKAYE MODU STİLLERİ
   Popup, kampanya seçim, bölüm seçim, ilerleme
   ========================================== */

/* ==========================================
   HİKAYE POPUP / MODAL
   (Giriş sahnesi, hikaye kartı, çıkış sahnesi)
   ========================================== */

.story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.story-modal.hidden {
    display: none !important;
}

.story-modal.active {
    opacity: 1;
    pointer-events: all;
}

/* Overlay */
.story-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

/* İçerik Kutusu */
.story-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 2.5rem 3rem;
    max-width: 600px;
    width: 90%;
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.1);
    animation: storySlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes storySlideUp {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* İkon */
.story-modal-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
    animation: storyIconPulse 2s ease-in-out infinite;
}

@keyframes storyIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Metin */
.story-modal-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #e0e0e0;
    margin-bottom: 2rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Buton */
.story-modal-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.9rem 2.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.03em;
}

.story-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.story-modal-btn:active {
    transform: translateY(0);
}

/* ==========================================
   MODAL TİP VARYASYONLARI
   ========================================== */

/* Giriş Sahnesi */
.story-type-intro {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(102, 126, 234, 0.15);
}

.story-type-intro .story-modal-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.story-type-intro .story-modal-btn:hover {
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

/* Hikaye Kartı */
.story-type-storycard {
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.15);
}

.story-type-storycard .story-modal-text {
    font-style: italic;
    color: #d4c5a0;
}

/* Çıkış - Zafer */
.story-type-outro-win {
    border-color: rgba(39, 174, 96, 0.5);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(39, 174, 96, 0.15);
}

.story-type-outro-win .story-modal-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.story-type-outro-win .story-modal-btn:hover {
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

/* Çıkış - Yenilgi */
.story-type-outro-lose {
    border-color: rgba(231, 76, 60, 0.4);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(231, 76, 60, 0.1);
}

.story-type-outro-lose .story-modal-btn {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
}

.story-type-outro-lose .story-modal-btn:hover {
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.4);
}

/* ==========================================
   BÖLÜM SEÇİM EKRANI
   ========================================== */

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Bölüm Kartı */
.chapter-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 1.2rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.chapter-card:hover:not(.chapter-locked) {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

/* Durum: Tamamlandı */
.chapter-completed {
    border-color: rgba(39, 174, 96, 0.4);
    background: rgba(39, 174, 96, 0.08);
}

.chapter-completed:hover {
    border-color: rgba(39, 174, 96, 0.6) !important;
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.2) !important;
}

/* Durum: Mevcut (devam edilecek) */
.chapter-current {
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.08);
    animation: chapterPulse 2s ease-in-out infinite;
}

@keyframes chapterPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 15px 3px rgba(255, 215, 0, 0.15);
    }
}

/* Durum: Kilitli */
.chapter-locked {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* Bölüm Kartı İçerik */
.chapter-status {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.chapter-number {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.chapter-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

/* Zorluk Etiketleri */
.chapter-difficulty {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diff-easy {
    background: rgba(39, 174, 96, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.diff-normal {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.diff-hard {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* ==========================================
   İLERLEME ÇUBUĞU
   ========================================== */

.story-progress-bar {
    position: relative;
    width: 100%;
    height: 28px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.story-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.story-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.story-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* ==========================================
   ANA MENÜ - HİKAYE MODU BUTONU
   ========================================== */

.menu-card.story-mode-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.4);
}

.menu-card.story-mode-card:hover {
    border-color: #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* ==========================================
   RESPONSİVE
   ========================================== */

@media (max-width: 768px) {
    .story-modal-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
        max-width: 95%;
    }

    .story-modal-icon {
        font-size: 2.5rem;
    }

    .story-modal-text {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .chapter-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .chapter-card {
        padding: 1rem 0.8rem;
    }

    .chapter-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .story-modal-content {
        padding: 1.5rem 1.2rem;
    }

    .story-modal-text {
        font-size: 0.9rem;
    }

    .story-modal-btn {
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
    }

    .chapter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .chapter-status {
        font-size: 1.4rem;
    }

    .chapter-title {
        font-size: 0.85rem;
    }
}
