* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-container {
    display: flex;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 850px;
    overflow: hidden;
    min-height: 500px;
    margin: 0 auto; /* Ortalamak için */
}

/* Sol Profil Bölümü */
.profile-sidebar {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 40px 30px;
    width: 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.profile-avatar i {
    font-size: 60px;
    color: white;
}

.profile-name {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 600;
}

/* 🏷️ Müvəqqəti ləqəb (hərrac mükafatı) — chat.css-dəki .user-title-badge ilə
   eyni məlumatı (activeTitle) göstərir, profil kartına uyğun bir az böyük. */
.profile-title-badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.profile-title-badge[hidden] {
    display: none;
}

/* 🎨 Müvəqqəti profil fon teması (hərrac mükafatı) — .profile-sidebar-in
   default bənövşəyi qradientini əvəz edir, effekt bitəndə avtomatik geri qayıdır. */
.profile-sidebar.theme-cosmic {
    background: radial-gradient(circle at 30% 20%, #3a1f6e 0%, #0d0821 70%), linear-gradient(135deg, #1b0e3a, #050310);
}

.profile-sidebar.theme-fire {
    background: linear-gradient(135deg, #ff5f1f 0%, #7a0d0d 100%);
}

.profile-sidebar.theme-underwater {
    background: linear-gradient(135deg, #0077b6 0%, #023047 100%);
}

.profile-sidebar.theme-stars {
    background: radial-gradient(circle, #ffffff 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(135deg, #1a1a3a, #0a0a1f);
}

.profile-sidebar.theme-royal {
    background: linear-gradient(135deg, #7b2ff7 0%, #b8860b 100%);
}

.profile-email {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 30px;
    word-break: break-word;
}

/* #81 Bal tarixçəsi qrafiki — xarici kitabxana yox, sadə əl ilə çəkilmiş SVG */
.balance-chart-wrap {
    margin-top: 6px;
}

#balanceChartSvg {
    width: 100%;
    height: 90px;
    display: block;
    overflow: visible;
}

.balance-chart-range {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

/* #80 Profil "bio" */
.profile-bio-section {
    position: relative;
    width: 100%;
    max-width: 260px;
    margin: -18px auto 24px;
}

.profile-bio-text {
    font-size: 13.5px;
    opacity: 0.85;
    line-height: 1.5;
    word-break: break-word;
    padding: 0 26px;
    min-height: 20px;
}

.profile-bio-text:empty::before {
    content: "Haqqında hələ bir şey yazılmayıb";
    opacity: 0.6;
    font-style: italic;
}

.profile-bio-edit-btn {
    position: absolute;
    top: -2px;
    right: 0;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    color: white;
    cursor: pointer;
    font-size: 11px;
}

.profile-bio-edit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.profile-bio-edit {
    margin-top: 10px;
}

.profile-bio-edit.hidden {
    display: none;
}

.profile-bio-edit textarea {
    width: 100%;
    resize: none;
    border-radius: 10px;
    border: none;
    padding: 10px 12px;
    font-size: 13.5px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.92);
    color: #333;
    min-height: 60px;
}

.profile-bio-edit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

.profile-bio-count {
    font-size: 11px;
    opacity: 0.75;
    margin-right: auto;
}

.profile-bio-cancel-btn,
.profile-bio-save-btn {
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}

.profile-bio-cancel-btn {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.profile-bio-save-btn {
    background: white;
    color: #2575fc;
}

.change-photo-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.change-photo-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.remove-photo-btn {
    margin-top: 8px;
    background: rgba(229, 62, 62, 0.18);
    border: 2px solid rgba(229, 62, 62, 0.35);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.remove-photo-btn:hover {
    background: rgba(229, 62, 62, 0.3);
    border-color: rgba(229, 62, 62, 0.6);
}

.remove-photo-btn.hidden {
    display: none;
}

/* Sağ Menü Bölümü */
.profile-menu {
    padding: 40px;
    width: 65%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
}

.menu-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.menu-card:hover {
    background: #edf2ff;
    border-color: #d0d7ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.menu-card i:first-child {
    font-size: 20px;
    color: #6a11cb;
    width: 24px;
}

.menu-card span {
    font-size: 17px;
    font-weight: 500;
    flex-grow: 1;
}

.menu-card .arrow {
    color: #adb5bd;
    font-size: 14px;
}

/* Hesabı sil butonu */
.menu-card.danger {
    margin-top: 20px;
    background: #fff5f5;
    border-color: #ffe3e3;
}

.menu-card.danger i:first-child {
    color: #fa5252;
}

.menu-card.danger span {
    color: #c92a2a;
    font-weight: 600;
}

.menu-card.danger:hover {
    background: #ffe3e3;
    border-color: #ffc9c9;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
        display: block; /* Mobilde block yapıyoruz */
    }
    
    .profile-container {
        flex-direction: column;
        max-width: 100%;
        min-height: auto;
        margin: 0 auto; /* Ortalamak için */
    }
    
    .profile-sidebar, .profile-menu {
        width: 100%;
    }
    
    .profile-sidebar {
        padding: 30px 20px;
    }
    
    .profile-menu {
        padding: 30px 25px;
    }
}
/* PROFIL SEKLI - FIX */
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* şəkli kəsərək doldurur */
    border-radius: 50%;     /* tam yumru edir */
    display: block;
}

/* Büyük ekranlar için ek ortalama */
@media (min-width: 1200px) {
    .profile-container {
        max-width: 900px;
    }
}
.chat-input {
  transition:
    opacity .2s ease,
    transform .25s ease;
}

/* =========================
   #100 Tünd rejim (məhdud versiya — yalnız index/chat/profile.html-ə,
   chat.css-dəki `body[data-theme="dark"]` naxışının EYNİsi, HƏMİN
   localStorage açarı ("chatDarkMode") ilə paylaşılır ki, bir səhifədə
   aktivləşdirsən digərində də tətbiq olunsun). İşıqlı görünüşə HEÇ
   TOXUNMUR, yalnız aktivləşəndə üstələyir.
========================= */
.profile-theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 20;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(106, 92, 255, 0.12);
    color: #6a5cff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body[data-theme="dark"] {
    --profile-dark-bg: linear-gradient(135deg, #101120, #181933);
    --profile-dark-surface: #1e1f30;
    --profile-dark-surface-alt: #262739;
    --profile-dark-border: rgba(255, 255, 255, .08);
    --profile-dark-text: #f1f2f8;
}

body[data-theme="dark"] {
    background: var(--profile-dark-bg);
    color: var(--profile-dark-text);
}

body[data-theme="dark"] .profile-container {
    background: var(--profile-dark-surface);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .menu-card {
    background: var(--profile-dark-surface-alt);
    border-color: var(--profile-dark-border);
}

body[data-theme="dark"] .menu-card:hover {
    background: #2f3147;
    border-color: rgba(106, 92, 255, 0.4);
}

body[data-theme="dark"] .menu-card span {
    color: var(--profile-dark-text);
}

body[data-theme="dark"] .menu-card .arrow {
    color: #6b6d8a;
}

body[data-theme="dark"] .menu-card.danger {
    background: rgba(250, 82, 82, 0.1);
    border-color: rgba(250, 82, 82, 0.25);
}

body[data-theme="dark"] .menu-card.danger:hover {
    background: rgba(250, 82, 82, 0.18);
}

body[data-theme="dark"] .badges-title,
body[data-theme="dark"] .journey-stat-value,
body[data-theme="dark"] .badge-progress-label {
    color: var(--profile-dark-text);
}

body[data-theme="dark"] .profile-theme-toggle {
    background: rgba(241, 242, 248, 0.1);
    color: #f1f2f8;
}
