/* ============================================= */
/* ========== PROFİL SİSTEMİ STİLLERİ ========= */
/* ============================================= */

/* Profil Modal Overlay */
.profile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.profile-overlay.active {
    display: flex;
    opacity: 1;
}

/* Profil Container */
.profile-container {
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(145deg, rgba(15, 15, 25, 0.98), rgba(5, 5, 15, 0.99));
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 24px;
    padding: 0;
    position: relative;
    box-shadow: 
        0 0 100px rgba(0, 255, 204, 0.15),
        0 30px 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(0.8) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-overlay.active .profile-container {
    transform: scale(1) translateY(0);
}

/* Scrollbar stillemesi */
.profile-container::-webkit-scrollbar {
    width: 6px;
}

.profile-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.profile-container::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 204, 0.5);
    border-radius: 3px;
}

/* Profil Header (Banner Area) */
.profile-header {
    position: relative;
    padding: 40px 30px 30px;
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.1), rgba(0, 102, 255, 0.1));
    border-bottom: 1px solid rgba(0, 255, 204, 0.2);
}

/* Kapatma Butonu */
.profile-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.profile-close:hover {
    border-color: #ff3366;
    color: #ff3366;
    transform: rotate(90deg);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.4);
}

/* Avatar ve Kullanıcı Bilgisi */
.profile-user-info {
    display: flex;
    align-items: center;
    gap: 25px;
}

.profile-avatar-wrapper {
    position: relative;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ffcc, #0066ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: #000;
    font-weight: bold;
    border: 4px solid rgba(0, 255, 204, 0.5);
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(0, 255, 204, 0.5);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-edit-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: #00ffcc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 14px;
    cursor: pointer;
    border: 3px solid rgba(15, 15, 25, 1);
    transition: all 0.3s ease;
}

.avatar-edit-icon:hover {
    transform: scale(1.1);
    background: #00ddaa;
}

/* Kullanıcı Detayları */
.profile-user-details {
    flex: 1;
}

.profile-username {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.profile-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.2), rgba(0, 102, 255, 0.2));
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #00ffcc;
    margin-bottom: 10px;
}

.profile-title i {
    font-size: 0.9rem;
}

.profile-member-since {
    font-size: 0.8rem;
    color: #666;
}

/* Seviye ve XP Bölümü */
.profile-level-section {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.level-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.level-badge {
    display: flex;
    align-items: center;
    gap: 15px;
}

.level-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00ffcc, #0066ff);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #000;
    box-shadow: 0 5px 20px rgba(0, 255, 204, 0.3);
}

.level-info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.level-info span {
    font-size: 0.85rem;
    color: #888;
}

.xp-stats {
    text-align: right;
}

.xp-current {
    font-size: 1.4rem;
    font-weight: bold;
    color: #00ffcc;
}

.xp-needed {
    font-size: 0.8rem;
    color: #666;
}

/* XP Progress Bar */
.xp-progress-container {
    position: relative;
}

.xp-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ffcc, #0066ff);
    border-radius: 6px;
    transition: width 0.5s ease;
    position: relative;
}

.xp-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: xpShine 2s infinite;
}

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

.xp-progress-text {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 0.75rem;
    color: #888;
}

/* Rozetler Bölümü */
.profile-badges-section {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-title i {
    color: #00ffcc;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.badge-item:hover {
    background: rgba(0, 255, 204, 0.1);
    border-color: rgba(0, 255, 204, 0.3);
    transform: translateY(-3px);
}

.badge-item.locked {
    opacity: 0.4;
    filter: grayscale(100%);
}

.badge-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.badge-item:hover .badge-icon {
    transform: scale(1.1);
}

.badge-name {
    font-size: 0.7rem;
    color: #aaa;
    text-align: center;
    line-height: 1.2;
}

/* İstatistikler */
.profile-stats-section {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(0, 255, 204, 0.05);
    border-color: rgba(0, 255, 204, 0.2);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: #00ffcc;
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Aksiyon Butonları */
.profile-actions {
    padding: 25px 30px;
    display: flex;
    gap: 15px;
}

.profile-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.profile-btn.primary {
    background: linear-gradient(135deg, #00ffcc, #00ddaa);
    border: none;
    color: #000;
}

.profile-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 204, 0.4);
}

.profile-btn.secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.profile-btn.secondary:hover {
    border-color: #ff3366;
    color: #ff3366;
}

.profile-btn.danger {
    background: transparent;
    border: 1px solid rgba(255, 51, 102, 0.3);
    color: #ff3366;
}

.profile-btn.danger:hover {
    background: rgba(255, 51, 102, 0.1);
    border-color: #ff3366;
}

/* ============================================= */
/* ========== AVATAR SEÇİM MODAL ============= */
/* ============================================= */

.avatar-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.avatar-modal.active {
    display: flex;
    opacity: 1;
}

.avatar-modal-content {
    background: linear-gradient(145deg, rgba(20, 20, 30, 0.98), rgba(10, 10, 20, 0.99));
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.avatar-modal-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.3rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.avatar-option {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #333, #222);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.avatar-option:hover {
    transform: scale(1.1);
    border-color: rgba(0, 255, 204, 0.5);
}

.avatar-option.selected {
    border-color: #00ffcc;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
}

.avatar-save-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #00ffcc, #00ddaa);
    border: none;
    border-radius: 12px;
    color: #000;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 204, 0.4);
}

/* ============================================= */
/* ========== ŞİFRE DEĞİŞTİRME MODAL ========= */
/* ============================================= */

.password-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.password-modal.active {
    display: flex;
    opacity: 1;
}

.password-modal-content {
    background: linear-gradient(145deg, rgba(20, 20, 30, 0.98), rgba(10, 10, 20, 0.99));
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
}

.password-modal-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.3rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.password-form .input-group {
    margin-bottom: 20px;
}

.password-form .input-group label {
    display: block;
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.password-form .input-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.password-form .input-group input:focus {
    outline: none;
    border-color: #00ffcc;
    background: rgba(0, 255, 204, 0.05);
}

.password-form-btns {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.password-form-btns button {
    flex: 1;
    padding: 14px;
    border-radius: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.password-cancel-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.password-cancel-btn:hover {
    border-color: #ff3366;
    color: #ff3366;
}

.password-save-btn {
    background: linear-gradient(135deg, #00ffcc, #00ddaa);
    border: none;
    color: #000;
}

.password-save-btn:hover {
    transform: translateY(-2px);
}

/* ============================================= */
/* ========== XP & LEVEL UP TOAST ============ */
/* ============================================= */

.game-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: linear-gradient(145deg, rgba(15, 15, 25, 0.98), rgba(5, 5, 15, 0.99));
    border: 2px solid #00ffcc;
    border-radius: 20px;
    padding: 30px 50px;
    z-index: 99999999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    box-shadow: 
        0 0 60px rgba(0, 255, 204, 0.4),
        0 0 120px rgba(0, 255, 204, 0.2);
}

.game-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.game-toast.level-up {
    border-color: #ffd700;
    box-shadow: 
        0 0 60px rgba(255, 215, 0, 0.4),
        0 0 120px rgba(255, 215, 0, 0.2);
}

.game-toast-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: bounceIn 0.6s ease;
}

.game-toast.xp .game-toast-icon {
    color: #00ffcc;
}

.game-toast.level-up .game-toast-icon {
    color: #ffd700;
}

.game-toast.badge .game-toast-icon {
    color: #9933ff;
}

.game-toast-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.game-toast-message {
    font-size: 1rem;
    color: #aaa;
}

.game-toast-xp {
    font-size: 2rem;
    font-weight: bold;
    color: #00ffcc;
    margin-top: 10px;
}

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

/* ============================================= */
/* ========== MOBİL UYUMLULUK ================ */
/* ============================================= */

@media (max-width: 600px) {
    .profile-container {
        border-radius: 20px;
        max-height: 95vh;
    }

    .profile-header {
        padding: 30px 20px 25px;
    }

    .profile-user-info {
        flex-direction: column;
        text-align: center;
    }

    .profile-avatar {
        width: 90px;
        height: 90px;
        font-size: 36px;
    }

    .profile-username {
        font-size: 1.5rem;
    }

    .profile-level-section,
    .profile-badges-section,
    .profile-stats-section,
    .profile-actions {
        padding: 20px;
    }

    .level-display {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .xp-stats {
        text-align: center;
    }

    .badges-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .badge-item {
        padding: 12px 8px;
    }

    .badge-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .stat-item {
        padding: 15px 10px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .profile-actions {
        flex-direction: column;
    }

    .avatar-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .avatar-option {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .game-toast {
        width: 90%;
        padding: 25px 30px;
    }

    .game-toast-icon {
        font-size: 2.5rem;
    }

    .game-toast-title {
        font-size: 1.2rem;
    }
}

/* --- LİDERLİK TABLOSU STİLLERİ --- */
.leaderboard-header-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 15px;
    color: #888;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto; /* Liste uzunsa kaydır */
    max-height: 50vh;
    padding-right: 5px; 
}

/* Kaydırma çubuğu güzelleştirme */
.leaderboard-list::-webkit-scrollbar { width: 4px; }
.leaderboard-list::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
    border-color: var(--accent);
}

/* Kendi ismin parlasın */
.leaderboard-item.is-me {
    border: 1px solid var(--accent);
    background: rgba(0, 255, 204, 0.05);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.1);
}

/* --- SIRALAMA RENKLERİ --- */
.lb-rank {
    font-size: 1.1rem;
    font-weight: bold;
    width: 30px;
    color: #555;
    text-align: center;
}

/* 1. Altın */
.leaderboard-item.rank-1 { border: 1px solid #ffd700; background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent); }
.rank-1 .lb-rank { color: #ffd700; text-shadow: 0 0 10px #ffd700; font-size: 1.4rem; }

/* 2. Gümüş */
.leaderboard-item.rank-2 { border: 1px solid #c0c0c0; background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent); }
.rank-2 .lb-rank { color: #c0c0c0; text-shadow: 0 0 8px #c0c0c0; font-size: 1.3rem; }

/* 3. Bronz */
.leaderboard-item.rank-3 { border: 1px solid #cd7f32; background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent); }
.rank-3 .lb-rank { color: #cd7f32; text-shadow: 0 0 8px #cd7f32; font-size: 1.2rem; }

/* Kullanıcı Bilgileri */
.lb-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.lb-avatar {
    width: 38px;
    height: 38px;
    background: #222;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid rgba(255,255,255,0.1);
}

.lb-info {
    display: flex;
    flex-direction: column;
}

.lb-username {
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
}

.lb-title {
    font-size: 0.7rem;
    color: #888;
}

.lb-level {
    width: 80px;
    text-align: right;
    font-size: 0.9rem;
    color: #ccc;
    font-family: monospace;
}

.lb-xp {
    width: 100px;
    text-align: right;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent);
    text-shadow: 0 0 5px rgba(0,255,204,0.3);
}