/* ========================================================= */
/* GLOBAL RANG O'ZGARUVCHILARI (VARIANTS) */

/* ========================================================= */

/* TUNGI REJIM (Default) */
:root, .dark-mode {
    /* Umumiy Ilova Ranglari */
    --bg-color-main: #0a0a0f; /* Asosiy fon */
    --bg-color-card: #11121a; /* Kartalar/O'rta fon */
    --text-color-primary: #d6e7ff; 
    --text-color-secondary: #aaaaaa;
    --primary-color: #00ffff; /* Neon Blue (Aktiv/Asosiy accent) */
    --secondary-color: #ff00ff; /* Neon Purple */
    --settings-border: #22222e; /* Sozlamalar orasidagi to'siq */

    /* Auth/Login/Register Ranglari */
    --auth-bg-start: #1A0A47; /* Chuqur binafsha (Asosiy) */
    --auth-bg-end: #170A37; /* Chuqur binafsha (Oxiri) */
    --input-bg: rgba(255, 255, 255, 0.08);
    --input-border: rgba(0, 255, 255, 0.5); 
    --button-bg: linear-gradient(90deg, #00ffff 0%, #ff00ff 100%);

    /* DinX (Musiqa) Ranglari */
    --dinx-bg: var(--bg-color-main);
    --dinx-card: var(--bg-color-card);
    --dinx-accent: #00ffff;
    --dinx-muted: var(--text-color-secondary);
}

/* YORUG' REJIM */
.light-mode {
    /* Umumiy Ilova Ranglari */
    --bg-color-main: #f5f8ff;
    --bg-color-card: #ffffff;
    --text-color-primary: #0f172a;
    --text-color-secondary: #666666;
    --primary-color: #007aff; /* iOS Blue */
    --secondary-color: #ff3b30; /* iOS Red */
    --settings-border: #e0e0e8;

    /* Auth/Login/Register Ranglari */
    --auth-bg-start: #f5f8ff;
    --auth-bg-end: #ffffff;
    --input-bg: #f0f4f9;
    --input-border: #cccccc; 
    --button-bg: linear-gradient(90deg, #007aff 0%, #5ac8fa 100%);

    /* DinX (Musiqa) Ranglari */
    --dinx-bg: #f5f8ff;
    --dinx-card: #ffffff;
    --dinx-accent: #007aff;
    --dinx-muted: var(--text-color-secondary);
}

/* Ikonka Ranglari (Sozlamalar) */
.icon-circle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 15px;
}
.red-icon { background-color: #ff3b30; color: white; }
.gold-icon { background-color: #ffcc00; color: white; }
.lightblue-icon { background-color: #5ac8fa; color: white; }
.button-icon-circle { background-color: #34c759; color: white; }


/* ========================================================= */
/* UMUMIY USLUBLAR */
/* ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: var(--bg-color-main);
    color: var(--text-color-primary);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}
button:active {
    opacity: 0.7;
}

/* ========================================================= */
/* AUTHENTIFIKATSIYA SAHIFALARI (LOGIN/REGISTER) */
/* ========================================================= */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--auth-bg-start) 0%, var(--auth-bg-end) 100%);
}

.container {
    width: 90%;
    max-width: 380px;
    padding: 30px;
    background-color: var(--bg-color-card);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.logo {
    color: var(--primary-color);
    font-size: 2.5em;
    text-shadow: 0 0 10px var(--primary-color);
    margin-bottom: 5px;
}

.title {
    font-size: 1.1em;
    color: var(--text-color-secondary);
    margin-bottom: 25px;
}

.login-link a, .title a {
    color: var(--secondary-color);
    font-weight: bold;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: var(--text-color-secondary);
}

.password-wrapper {
    position: relative;
}

input[type="text"], 
input[type="password"] {
    width: 100%;
    padding: 12px 40px 12px 15px; /* Padding for the eye icon */
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-color-primary);
    font-size: 1em;
    transition: border-color 0.3s;
}

input[type="text"]:focus, 
input[type="password"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: var(--text-color-secondary);
    cursor: pointer;
}

.forgot-password {
    display: block;
    text-align: right;
    font-size: 0.85em;
    margin-bottom: 25px;
    color: var(--text-color-secondary);
}

.auth-button {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--bg-color-main);
    background: var(--button-bg);
    border-radius: 8px;
    margin-top: 10px;
}

.back-to-home-link {
    display: block;
    margin-top: 20px;
    color: var(--text-color-secondary);
    font-size: 0.9em;
}

/* ========================================================= */
/* DINX/LIBRARY SAHIFALARI (MUSIQA) */
/* ========================================================= */

.dinx-body {
    padding-bottom: 110px; /* Mini pleer va bottom nav uchun joy */
    background-color: var(--dinx-bg);
}

.dinx-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--dinx-card);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 5;
}

.dinx-logo {
    font-size: 1.5em;
    color: var(--dinx-accent);
}

.search-container {
    flex-grow: 1;
    margin: 0 15px;
}

#search {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    background-color: var(--input-bg);
    color: var(--text-color-primary);
}

.header-icons .icon-btn {
    background: none;
    color: var(--text-color-primary);
    font-size: 1.2em;
    padding: 5px;
}

/* Qo'shiqlar ro'yxati */
.main-content {
    padding: 15px 0;
}

.track-list {
    padding: 0 15px;
}

.track {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--settings-border);
    cursor: pointer;
}

.track:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.track.active {
    background-color: rgba(0, 255, 255, 0.1);
    border-radius: 5px;
}

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

.track-info .title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-color-primary);
}

.track-info .artist {
    font-size: 12px;
    color: var(--dinx-muted);
}

.track-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.track-actions .duration {
    font-size: 12px;
    color: var(--dinx-muted);
}

.save-btn {
    background: none;
    color: var(--dinx-muted);
    font-size: 1.1em;
    padding: 5px;
}

.save-btn.saved {
    color: #ff3b30; /* Saqlangan bo'lsa qizil rang */
}

.no-tracks {
    text-align: center;
    color: var(--text-color-secondary);
    margin-top: 30px;
}

/* MINI PLAYER */
.mini-player {
    position: fixed;
    bottom: 60px; /* Bottom nav ustida */
    left: 0;
    right: 0;
    height: 50px;
    background: var(--dinx-card);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    z-index: 10;
}

.track-info-mini {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
}

.art-mini {
    width: 30px;
    height: 30px;
    background-color: var(--dinx-accent);
    border-radius: 4px;
    margin-right: 10px;
}

.text-mini {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-mini p {
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
}
.text-mini p:first-child {
    font-weight: bold;
}
.text-mini p:last-child {
    color: var(--dinx-muted);
}

.controls-mini {
    display: flex;
    gap: 5px;
}

.controls-mini .icon-btn, .controls-mini .play-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
}

.controls-mini .icon-btn {
    background: none;
    color: var(--text-color-primary);
}

.play-btn {
    background: var(--dinx-accent);
    color: var(--bg-color-main); /* Yengil fonga o'tadi */
    font-size: 1.3em;
}

/* BOTTOM NAVIGATSIYA */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--dinx-card);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--dinx-muted);
    font-size: 10px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--dinx-accent); 
}

/* ========================================================= */
/* SOZLAMALAR SAHIFASI (SETTINGS) */
/* ========================================================= */

.settings-container {
    width: 100%;
    max-width: 450px; /* Mobil kontener chegarasi */
    margin: 0 auto;
    background-color: var(--bg-color-main);
    min-height: 100vh;
    padding-bottom: 70px; /* Navigatsiya uchun joy */
}

.settings-container .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--dinx-card);
    border-bottom: 1px solid var(--settings-border);
}

.settings-container .header .back-button,
.settings-container .header .edit-button {
    font-size: 1em;
    color: var(--primary-color);
    cursor: pointer;
}

.settings-container .header .back-button i {
    font-size: 1.2em;
}

.profile-section {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-avatar-container {
    position: relative;
    margin-bottom: 15px;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.profile-info {
    color: var(--text-color-secondary);
    font-size: 0.85em;
    margin-top: 5px;
}

.menu-group {
    margin-bottom: 20px;
    background-color: var(--dinx-card);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 15px 20px 15px;
}

.list-item, .action-button {
    display: flex;
    align-items: center;
    padding: 15px;
    color: var(--text-color-primary);
    background: none;
    width: 100%;
    text-align: left;
    border: none;
    font-size: 1em;
    cursor: pointer;
    border-bottom: 1px solid var(--settings-border);
    transition: background-color 0.1s;
}

.list-item:last-child, .menu-group:last-child .list-item:last-child {
    border-bottom: none;
}

.list-item span, .action-button span {
    flex-grow: 1;
}

.list-item i.fa-chevron-right {
    color: var(--text-color-secondary);
    font-size: 0.8em;
}

/* Maxsus holatlar */
.list-item.user-name-display {
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
}
.list-item.user-name-display:hover {
    background: none;
}

.logout-group .list-item {
    color: #ff3b30;
    font-weight: bold;
}
.logout-group .list-item .icon-circle {
    background-color: #ff3b30;
}
.logout-group .list-item .icon-circle i {
    color: white;
}

/* Settings bottom nav ning faol rangini o'zgartirish */
.settings-container .bottom-nav .nav-item.active {
    color: var(--primary-color);
}

/* ========================================================= */
/* INDEX SAHIFASI USLUBLARI */
/* ========================================================= */
.main-header {
    background: linear-gradient(180deg, var(--header-start) 0%, var(--header-end) 100%);
    padding-bottom: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.lang-switcher a {
    color: var(--text-color-secondary);
    font-size: 0.9em;
    margin-left: 5px;
}

.menu-icon a {
    color: var(--primary-color);
    font-weight: bold;
}

#themeToggle {
    background: var(--input-bg);
    color: var(--text-color-primary);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
}

.hero-section {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.logo-title {
    font-size: 3.5em;
    margin: 10px 0;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 15px var(--primary-color);
    position: relative;
    z-index: 2;
}

.slogan {
    font-size: 1.1em;
    color: var(--text-color-secondary);
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.listen-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 30px;
    background: var(--button-bg);
    color: var(--bg-color-main);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.4);
    transition: transform 0.2s;
}

.language-links {
    margin-top: 20px;
}

.language-links span {
    display: inline-block;
    color: var(--text-color-secondary);
    padding: 5px 10px;
    border: 1px solid var(--text-color-secondary);
    border-radius: 20px;
    font-size: 0.8em;
    margin: 0 5px;
}

/* Info Section */
.info-section {
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    gap: 30px;
    text-align: center;
}

.content-box h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.features-list {
    list-style: none;
    text-align: left;
    padding-left: 0;
    color: var(--text-color-secondary);
}

.features-list li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.features-list li::before {
    content: '★';
    color: var(--secondary-color);
    position: absolute;
    left: 0;
}

.visual-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 150px;
}

.circle-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-color-main);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

/* Footer */
.contact-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    padding: 20px;
    background-color: var(--bg-color-card);
    border-top: 1px solid var(--settings-border);
    color: var(--text-color-secondary);
    font-size: 0.9em;
}

.contact-item {
    margin: 10px;
    flex-basis: 40%;
    text-align: center;
}

.contact-item p {
    margin: 5px 0;
}

/* ========================================================= */
/* RESPONSIVE DIZAYN (Kattaroq ekranlar uchun) */
/* ========================================================= */
@media (min-width: 768px) {
    .mobile-container {
        border-left: 1px solid var(--settings-border);
        border-right: 1px solid var(--settings-border);
    }
    
    .info-section {
        flex-direction: row;
        text-align: left;
        max-width: 1000px;
        margin: 0 auto;
    }

    .content-box, .visual-placeholder {
        flex: 1;
        padding: 0 20px;
    }

    .visual-placeholder {
        height: auto;
    }

    .contact-footer {
        flex-wrap: nowrap;
    }

    .contact-item {
        flex-basis: auto;
    }
}

/* joylashuv buzilishini oldini olish uchun asosiy stillar (Agar mavjud bo'lmasa, qo'shing) */

.profile-section {
    display: flex;
    flex-direction: column; /* Elementlarni ustma-ust qo'yish */
    align-items: center; /* Markazga tekislash */
    padding: 30px 0 20px 0;
}

.edit-button-inline {
    /* Ism bilan birga ko'rinishi uchun */
    background: none;
    border: none;
    color: var(--primary-color, #4fd1ff); /* Asosiy rangni o'rnating */
    cursor: pointer;
    font-size: 14px;
    margin-top: 5px; 
}


/* Profil bo'limini Flexbox bilan tartiblash */
.profile-section {
    display: flex;
    flex-direction: column; /* Vertikal joylashuv */
    align-items: center; /* Markazga tekislash */
    padding-top: 40px;
    position: relative; /* Tugmani shu bo'limga nisbatan joylashtirish uchun */
}

.user-name {
    font-size: 28px; /* Ism kattaroq bo'lishi uchun */
    margin: 10px 0;
    color: var(--text-color);
}

.edit-button-inline {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
    margin-top: -10px; /* Ismga yaqinroq ko'rinishi uchun */
}
