@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600&display=swap');

:root {
    --fon-tun: #140436;
    --brend: #941FB5;
    --brend-xira: #632270;
    --qogoz: #F8F4FB;
    --matn-tun: #1B0836;
    --chiziq: #C9B8DA;
    --oq: #FFFFFF;

    --shrift-sarlavha: 'Fraunces', serif;
    --shrift-matn: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--shrift-matn);
    color: var(--matn-tun);
    background: var(--qogoz);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: var(--shrift-sarlavha);
    font-weight: 600;
    margin: 0 0 0.5em;
}

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

a:hover {
    text-decoration: underline;
}

/* --- Nota chizig'i motivi - saytning "signature" elementi --- */
.nota-chiziqlar {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 7px,
        rgba(255, 255, 255, 0.08) 7px,
        rgba(255, 255, 255, 0.08) 8px
    );
    background-size: 100% 40px;
}

.nota-ajratuvchi {
    height: 40px;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 7px,
        var(--chiziq) 7px,
        var(--chiziq) 8px
    );
    margin: 3rem 0;
    opacity: 0.5;
}

/* --- Header --- */
.sayt-header {
    background: var(--fon-tun);
    padding: 1rem 2rem;
}

.sayt-nav {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logotip {
    font-family: var(--shrift-sarlavha);
    font-size: 1.4rem;
    color: var(--oq);
    font-weight: 700;
}

.nav-havolalar {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-havolalar a,
.chiqish-forma button {
    color: var(--oq);
    opacity: 0.85;
    font-size: 0.95rem;
}

.nav-havolalar a:hover,
.chiqish-forma button:hover {
    opacity: 1;
    text-decoration: none;
}

.nav-foydalanuvchi {
    display: none;
}

.profil-menyu {
    position: relative;
    margin-left: 1rem;
}

.profil-belgi {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: var(--qogoz);
    color: var(--fon-tun);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.profil-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 0.5rem;
    z-index: 20;
}

.profil-dropdown-ichki {
    background: var(--oq);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(20, 4, 54, 0.2);
    padding: 0.4rem 0;
    min-width: 170px;
}

.profil-menyu:hover .profil-dropdown,
.profil-menyu:focus-within .profil-dropdown {
    display: block;
}

.profil-dropdown a,
.profil-dropdown .chiqish-forma button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 1rem;
    color: var(--matn-tun);
    background: none;
    border: none;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    opacity: 1;
}

.profil-dropdown a:hover,
.profil-dropdown .chiqish-forma button:hover {
    background: var(--qogoz);
    text-decoration: none;
}

.profil-dropdown .chiqish-forma {
    margin: 0;
}

.chiqish-forma {
    display: inline;
    margin: 0;
}

.chiqish-forma button {
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

/* --- Asosiy konteyner --- */
.sayt-asosiy {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- Tugmalar --- */
.tugma {
    display: inline-block;
    background: var(--brend);
    color: var(--oq);
    padding: 0.75rem 1.75rem;
    border-radius: 4px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tugma:hover {
    background: var(--brend-xira);
    text-decoration: none;
}

/* --- Xabarlar --- */
.xabarlar {
    list-style: none;
    padding: 0;
}

.xabar {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.xabar-success {
    background: #E3F5E1;
    color: #1F6B1B;
}

.xabar-error {
    background: #FBE2E8;
    color: #8B1834;
}

/* --- Footer --- */
.sayt-footer {
    background: var(--fon-tun);
    color: var(--oq);
    padding: 2rem;
    text-align: center;
}

.ijtimoiy-tarmoqlar {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.ijtimoiy-tarmoqlar a {
    color: var(--oq);
    opacity: 0.85;
}

/* --- Formalar (kirish/royxatdan o'tish) --- */
.forma-konteyner {
    max-width: 420px;
    margin: 2rem auto;
    background: var(--oq);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(20, 4, 54, 0.08);
}

.forma-maydon {
    margin-bottom: 1rem;
}

.forma-maydon label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: var(--brend-xira);
}

.forma-maydon input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--chiziq);
    border-radius: 4px;
    font-family: var(--shrift-matn);
    font-size: 1rem;
}

.forma-konteyner button[type="submit"] {
    width: 100%;
    background: var(--brend);
    color: var(--oq);
    border: none;
    padding: 0.85rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.forma-konteyner button[type="submit"]:hover {
    background: var(--brend-xira);
}

/* --- Kompozitor haqida sahifasi --- */
.kompozitor-hero {
    background: var(--fon-tun);
    color: var(--oq);
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 3rem;
    border-radius: 8px;
    flex-wrap: wrap;
}

.kompozitor-rasm {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--brend);
    flex-shrink: 0;
}

.kompozitor-hero h1 {
    color: var(--oq);
    font-size: 2.2rem;
}

.kompozitor-unvon {
    color: var(--chiziq);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
}

.biografiya, .yutuqlar, .mashhur-asarlar {
    margin: 2rem 0;
}

.yutuqlar-royxati {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.yutuq-kartochka {
    flex: 0 0 200px;
    background: var(--oq);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(20, 4, 54, 0.08);
    text-align: center;
}

.yutuq-kartochka img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.yutuq-kartochka p {
    padding: 0.75rem;
    margin: 0;
    font-size: 0.9rem;
    color: var(--brend-xira);
}

.mashhur-asarlar-royxati {
    font-family: var(--shrift-sarlavha);
    font-size: 1.2rem;
    padding-left: 1.5rem;
}

.mashhur-asarlar-royxati li {
    margin-bottom: 0.5rem;
}

.markazlashtirilgan-tugma {
    text-align: center;
    margin: 3rem 0;
}

/* --- Katalog sahifasi --- */
.katalog-hero {
    background: var(--fon-tun);
    color: var(--oq);
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 2.5rem;
}

.katalog-hero h1 {
    color: var(--oq);
}

.katalog-hero p {
    color: var(--chiziq);
}

.katalog-panjara {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.asar-kartochka {
    display: block;
    background: var(--oq);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(20, 4, 54, 0.08);
    color: var(--matn-tun);
    transition: transform 0.15s ease;
}

.asar-kartochka:hover {
    transform: translateY(-4px);
    text-decoration: none;
}

.asar-kartochka img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.asar-kartochka-placeholder {
    width: 100%;
    height: 220px;
    background: var(--qogoz);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--brend);
}

.asar-kartochka-matn {
    padding: 1rem;
}

.asar-kartochka-matn h3 {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.asar-narx {
    color: var(--brend);
    font-weight: 600;
    margin: 0;
}

/* --- Mening xaridlarim sahifasi --- */
.xaridlar-royxati {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.xarid-kartochka {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--oq);
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(20, 4, 54, 0.08);
}

.xarid-matn h3 {
    margin-bottom: 0.2rem;
    font-size: 1.1rem;
}

.xarid-sana {
    color: var(--brend-xira);
    font-size: 0.85rem;
    margin: 0 0 0.3rem;
}

.xarid-narx {
    color: var(--brend);
    font-weight: 600;
    margin: 0;
}

.tugma-xira {
    display: inline-block;
    background: var(--chiziq);
    color: var(--matn-tun);
    padding: 0.6rem 1.25rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* --- Asar tafsilot sahifasi --- */
.asar-tafsilot {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.asar-tafsilot-rasm img,
.asar-tafsilot-placeholder {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(20, 4, 54, 0.1);
}

.asar-tafsilot-placeholder {
    height: 320px;
    font-size: 4rem;
}

.asar-tafsilot-matn h1 {
    margin-bottom: 0.5rem;
}

.asar-tafsilot-narx {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--brend);
    margin-bottom: 1rem;
}

.asar-tafsilot-tavsif {
    margin-bottom: 1rem;
    color: var(--matn-tun);
}

.asar-tafsilot-meta {
    color: var(--brend-xira);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
    .asar-tafsilot {
        grid-template-columns: 1fr;
    }
}

/* --- Online reader --- */
.reader-konteyner {
    /* user-select: none - matn belgilashni butun reader konteynerida
       o'chiradi. Canvas'da matn umuman yo'q (rasm), lekin atrofdagi
       elementlarda ham tasodifiy belgilash bo'lmasin deb qo'yilgan. */
    user-select: none;
    -webkit-user-select: none;
    text-align: center;
}

.reader-boshqaruv {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.reader-ekran {
    background: var(--fon-tun);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
}

#sahifa-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    /* Canvas ustidan tortib olishni (drag) qiyinlashtirish */
    pointer-events: none;
}

.tayyorlanmoqda {
    text-align: center;
    padding: 4rem 1rem;
}

/* --- Checkout --- */
.checkout-asar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--chiziq);
}

.checkout-rasm {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
}

/* --- Natija sahifalari (muvaffaqiyat/xato) --- */
.natija-sahifa {
    text-align: center;
    padding: 4rem 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.natija-muvaffaqiyatli h1 {
    color: var(--brend);
}

.natija-xato h1 {
    color: #8B1834;
}
/* =========================
   RESPONSIVE / MOBILE
   ========================= */

@media (max-width: 768px) {
    .sayt-header {
        padding: 0.9rem 1rem;
    }

    .sayt-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .logotip {
        text-align: center;
        font-size: 1.25rem;
    }

    .nav-havolalar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.55rem 0.9rem;
    }

    .nav-havolalar a,
    .chiqish-forma button {
        font-size: 0.88rem;
    }

    .profil-menyu {
        margin-left: 0;
    }

    .profil-belgi {
        padding: 0.3rem 0.7rem;
        font-size: 0.8rem;
    }

    .sayt-asosiy {
        width: 100%;
        padding: 1.2rem 1rem;
    }

    .kompozitor-hero {
        padding: 1.5rem 1rem;
        gap: 1.3rem;
        text-align: center;
        justify-content: center;
    }

    .kompozitor-rasm {
        width: 150px;
        height: 150px;
    }

    .kompozitor-hero h1 {
        font-size: 1.7rem;
    }

    .kompozitor-unvon {
        font-size: 0.9rem;
    }

    .katalog-hero {
        padding: 1.7rem 1rem;
        margin-bottom: 1.5rem;
    }

    .katalog-hero h1 {
        font-size: 1.8rem;
    }

    .katalog-panjara {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.9rem;
    }

    .asar-kartochka img,
    .asar-kartochka-placeholder {
        height: 180px;
    }

    .asar-kartochka-matn {
        padding: 0.8rem;
    }

    .asar-kartochka-matn h3 {
        font-size: 0.95rem;
    }

    .asar-narx {
        font-size: 0.95rem;
    }

    .xarid-kartochka {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .xarid-kartochka .tugma,
    .xarid-kartochka .tugma-xira {
        width: 100%;
        text-align: center;
    }

    .asar-tafsilot {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .asar-tafsilot-rasm {
        max-width: 320px;
        width: 100%;
        margin: 0 auto;
    }

    .asar-tafsilot-matn h1 {
        font-size: 1.8rem;
    }

    .asar-tafsilot-narx {
        font-size: 1.35rem;
    }

    .forma-konteyner {
        width: 100%;
        max-width: none;
        margin: 1rem 0;
        padding: 1.3rem;
    }

    .reader-boshqaruv {
        flex-wrap: wrap;
        gap: 0.7rem;
    }

    .reader-ekran {
        padding: 0.7rem;
    }

    .checkout-asar {
        align-items: flex-start;
    }

    .checkout-rasm {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    .natija-sahifa {
        padding: 2.5rem 1rem;
    }

    .sayt-footer {
        padding: 1.5rem 1rem;
    }

    .ijtimoiy-tarmoqlar {
        flex-wrap: wrap;
        gap: 0.7rem 1rem;
    }
}

@media (max-width: 480px) {
    .sayt-header {
        padding: 0.8rem 0.7rem;
    }

    .nav-havolalar {
        gap: 0.45rem 0.7rem;
    }

    .nav-havolalar a,
    .chiqish-forma button {
        font-size: 0.8rem;
    }

    .sayt-asosiy {
        padding: 1rem 0.75rem;
    }

    .katalog-panjara {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }

    .asar-kartochka img,
    .asar-kartochka-placeholder {
        height: 150px;
    }

    .asar-kartochka-matn {
        padding: 0.7rem;
    }

    .asar-kartochka-matn h3 {
        font-size: 0.88rem;
    }

    .asar-narx {
        font-size: 0.9rem;
    }

    .kompozitor-hero {
        padding: 1.3rem 0.8rem;
    }

    .kompozitor-rasm {
        width: 125px;
        height: 125px;
    }

    .kompozitor-hero h1 {
        font-size: 1.45rem;
    }

    .tugma {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }

    .profil-dropdown {
        right: -20px;
    }

    .nota-ajratuvchi {
        margin: 2rem 0;
    }
}
