/* =============================================== */
/* POPUP.CSS - TÜM POPUPLAR (DÜZELTİLMİŞ Z-INDEX)
/* Konfeti popupların ÜSTÜNDE (z-index: 100010)
/* =============================================== */

/* =============================================== */
/* ORTAK ANİMASYONLAR
/* =============================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =============================================== */
/* SEVİYE DETAY POPUP (level-popup)
/* =============================================== */
.level-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100000;
    display: none;
    justify-content: center;
    align-items: center;
}

.level-popup.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.level-popup-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.level-popup-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.level-popup-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.level-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.level-popup-body {
    padding: 20px;
    max-height: calc(80vh - 70px);
    overflow-y: auto;
}

/* Popup içindeki görev kartları */
.level-requirement-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
}

.level-requirement-item:last-child {
    margin-bottom: 0;
}

.req-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.req-name {
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.req-name i {
    color: var(--primary-color);
    width: 20px;
}

.req-values {
    font-weight: 700;
    color: var(--primary-color);
}

.req-bar-container {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.req-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.3s;
}

.req-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: right;
}

/* =============================================== */
/* SEVİYE GEÇMİŞİ POPUP (level-history-popup)
/* =============================================== */
.level-history-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100001;
    display: none;
    justify-content: center;
    align-items: center;
}

.level-history-popup.active { 
    display: flex; 
    animation: fadeIn 0.3s ease;
}

.level-history-popup .level-popup-content {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.level-history-popup .level-popup-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.level-history-popup .level-popup-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-history-popup .level-popup-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.level-history-popup .level-popup-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.level-history-popup .level-popup-body {
    padding: 20px;
    max-height: calc(80vh - 70px);
    overflow-y: auto;
}

/* Seviye kartı */
.level-history-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-color);
}

.level-history-card.completed { border-left-color: #4CAF50; }
.level-history-card.current { border-left-color: var(--accent-color); background: rgba(230, 180, 80, 0.1); }

.level-name {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.level-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* =============================================== */
/* GÖREV TAMAMLAMA POPUP (task-complete-popup)
/* =============================================== */
.task-complete-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100002;
    display: none;
    justify-content: center;
    align-items: center;
}

.task-complete-popup.active { 
    display: flex; 
    animation: fadeIn 0.3s ease;
}

.task-popup-content {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 350px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: scaleIn 0.3s ease;
}

.task-popup-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-popup-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-popup-header h3 i {
    font-size: 1.3rem;
}

.task-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.task-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.task-popup-body {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.completed-task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    animation: slideIn 0.2s ease;
    animation-fill-mode: both;
}

.completed-task-item:last-child { 
    border-bottom: none; 
}

.completed-task-item:nth-child(1) { animation-delay: 0.1s; }
.completed-task-item:nth-child(2) { animation-delay: 0.2s; }
.completed-task-item:nth-child(3) { animation-delay: 0.3s; }
.completed-task-item:nth-child(4) { animation-delay: 0.4s; }

.task-item-icon {
    width: 40px;
    height: 40px;
    background: rgba(44, 85, 48, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.task-item-name { 
    flex: 1; 
    font-weight: 600;
    color: var(--text-dark);
}

.task-item-points { 
    font-weight: 700; 
    color: var(--accent-color);
    font-size: 1.1rem;
}

.task-popup-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-weight: 700;
    background: #f8f9fa;
    font-size: 1.1rem;
}

.total-points { 
    color: var(--primary-color); 
    font-size: 1.3rem;
    font-weight: 800;
}

/* =============================================== */
/* SERİ ARTIŞ POPUP (streak-popup)
/* =============================================== */
.streak-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100003;
    display: none;
    pointer-events: none;
}

.streak-popup.active { 
    display: block; 
}

.streak-popup-content {
    background: linear-gradient(135deg, #ff9800, #f44336);
    color: white;
    padding: 30px 40px;
    border-radius: 60px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(255, 152, 0, 0.4);
    position: relative;
    overflow: hidden;
    animation: streakPop 0.5s ease;
}

.streak-popup-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    animation: rotate 4s linear infinite;
    z-index: 0;
}

.streak-popup-header,
.streak-popup-body {
    position: relative;
    z-index: 1;
}

.streak-popup-header { 
    font-size: 4rem; 
    margin-bottom: 10px; 
    animation: flame 1s infinite; 
}

.streak-popup-body { 
    font-size: 1.5rem; 
    font-weight: 700; 
}

/* Farklı streak değerleri için renkler */
.streak-popup[data-streak="5"] .streak-popup-content {
    background: linear-gradient(135deg, #ff9800, #f44336);
}

.streak-popup[data-streak="10"] .streak-popup-content {
    background: linear-gradient(135deg, #f44336, #9c27b0);
}

.streak-popup[data-streak="15"] .streak-popup-content {
    background: linear-gradient(135deg, #9c27b0, #3f51b5);
}

.streak-popup[data-streak="20"] .streak-popup-content {
    background: linear-gradient(135deg, #3f51b5, #00bcd4);
}

@keyframes streakPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* =============================================== */
/* SEVİYE ATLAMA POPUP (level-up-popup)
/* =============================================== */
.level-up-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100004;
    display: none;
    justify-content: center;
    align-items: center;
}

.level-up-popup.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.level-up-content {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 30px;
    width: 90%;
    max-width: 350px;
    padding: 30px;
    text-align: center;
    color: white;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: levelUpPop 0.5s ease;
}

.level-up-header {
    font-size: 5rem;
    margin-bottom: 15px;
    animation: bounce 1s infinite;
}

.level-up-body h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.level-up-body p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.level-up-footer {
    margin-top: 20px;
}

.level-up-btn {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.level-up-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

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

/* =============================================== */
/* TEST SONUÇ MODAL (test-result-modal)
/* =============================================== */
.test-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100005;
    display: none;
    justify-content: center;
    align-items: center;
}

.test-result-modal.active { 
    display: flex; 
    animation: fadeIn 0.2s ease;
}

.test-result-content {
    background: white;
    border-radius: 24px;
    padding: 35px 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

/* =============================================== */
/* LİMİT UYARI MODAL (limit-warning-modal)
/* =============================================== */
.limit-warning-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100006;
    display: none;
    justify-content: center;
    align-items: center;
}

.limit-warning-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.limit-warning-content {
    background: white;
    border-radius: 24px;
    padding: 30px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}



/* TÜM POPUPLARI BİRAZ AŞAĞI ÇEK */
.task-complete-popup.active,
.level-up-popup.active,
.streak-popup.active,
.test-result-modal.active,
.limit-warning-modal.active {
    z-index: 1000000 !important;  /* 1 milyon */
}

/* Dark mode stilleri */
body.dark-mode .level-popup-content,
body.dark-mode .task-popup-content,
body.dark-mode .test-result-content,
body.dark-mode .limit-warning-content,
body.dark-mode .level-up-content {
    background: #2a2a2a;
    color: #f0f0f0;
}

body.dark-mode .level-requirement-item,
body.dark-mode .completed-task-item {
    background: #333;
    border-color: #444;
}

body.dark-mode .task-popup-footer {
    background: #333;
    border-color: #444;
}

body.dark-mode .level-history-card {
    background: #333;
    border-color: #444;
}

body.dark-mode .req-name,
body.dark-mode .task-item-name {
    color: #f0f0f0;
}

/* Mobil uyum */
@media (max-width: 768px) {
    .level-popup-content,
    .task-popup-content,
    .test-result-content,
    .limit-warning-content,
    .level-up-content {
        width: 95%;
        max-width: 320px;
    }
    
    .streak-popup-content {
        padding: 20px 30px;
    }
    
    .streak-popup-header {
        font-size: 3rem;
    }
    
    .streak-popup-body {
        font-size: 1.2rem;
    }
    
    .level-up-header {
        font-size: 4rem;
    }
    
    .level-up-body h2 {
        font-size: 1.5rem;
    }
}

