:root {
    --pink-bright: #ff5cb8;
    --pink-soft: #ff9ad9;
    --pink-dark: #2a0719;
    --pink-bg: #130712;
    --purple-light: #a970ff;
    --purple-soft: #7f52d6;
    --text-main: #fff4fb;
    --text-soft: #efc8de;
    --card-bg: rgba(255, 255, 255, 0.07);
    --card-bg-strong: rgba(255, 255, 255, 0.12);
    --border-soft: rgba(255, 255, 255, 0.14);
    --shadow-main: 0 20px 45px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    overflow: hidden;
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(255, 92, 184, 0.14), transparent 28%),
        radial-gradient(circle at 80% 18%, rgba(169, 112, 255, 0.16), transparent 24%),
        radial-gradient(circle at 15% 75%, rgba(255, 92, 184, 0.12), transparent 20%),
        linear-gradient(135deg, #120510 0%, #190716 32%, #080b18 100%);
    font-family: 'Quicksand', sans-serif;
    color: var(--text-main);
}

.background-scene {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.28;
}

.orb-1 {
    width: 340px;
    height: 340px;
    left: -80px;
    top: -80px;
    background: rgba(255, 92, 184, 0.45);
}

.orb-2 {
    width: 460px;
    height: 460px;
    right: -140px;
    top: 80px;
    background: rgba(169, 112, 255, 0.28);
}

.orb-3 {
    width: 340px;
    height: 340px;
    left: 35%;
    bottom: -140px;
    background: rgba(255, 133, 209, 0.22);
}

.floating-books {
    position: absolute;
    inset: 0;
}

.book {
    --size: 78px;
    position: absolute;
    width: var(--size);
    height: calc(var(--size) * 0.62);
    border-radius: 14px 8px 8px 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 92, 184, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
    opacity: 0.4;
    animation: floatBook 18s ease-in-out infinite;
}

.book::before,
.book::after,
.book span::before,
.book span::after {
    position: absolute;
}

.book::before,
.book span::before,
.book span::after {
    content: "";
}

.book::before {
    inset: 0;
    border-radius: 14px 8px 8px 14px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 12%, transparent 12% 100%);
}

.book::after {
    content: attr(data-title);
    left: 12px;
    right: 12px;
    top: 12px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: rgba(255, 235, 248, 0.9);
    text-shadow: 0 0 10px rgba(255, 92, 184, 0.22);
}

.book span::before {
    left: 14px;
    right: 18px;
    bottom: 12px;
    height: 2px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 7px 0 rgba(255, 255, 255, 0.14);
}

.book span::after {
    inset: -10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.book-1 { --size: 86px; left: 22%; top: 14%; transform: rotate(-16deg); animation-delay: -2s; }
.book-2 { --size: 62px; left: 73%; top: 20%; transform: rotate(18deg); animation-delay: -7s; }
.book-3 { --size: 74px; left: 63%; top: 58%; transform: rotate(-12deg); animation-delay: -11s; }
.book-4 { --size: 58px; left: 34%; top: 68%; transform: rotate(14deg); animation-delay: -5s; }
.book-5 { --size: 92px; left: 83%; top: 78%; transform: rotate(-20deg); animation-delay: -14s; }
.book-6 { --size: 66px; left: 10%; top: 46%; transform: rotate(12deg); animation-delay: -9s; }
.book-7 { --size: 80px; left: 47%; top: 18%; transform: rotate(10deg); animation-delay: -4s; }
.book-8 { --size: 58px; left: 66%; top: 82%; transform: rotate(-11deg); animation-delay: -13s; }
.book-9 { --size: 88px; left: 39%; top: 30%; transform: rotate(-8deg); animation-delay: -6s; }
.book-10 { --size: 72px; left: 88%; top: 34%; transform: rotate(15deg); animation-delay: -10s; }
.book-11 { --size: 54px; left: 26%; top: 80%; transform: rotate(-13deg); animation-delay: -15s; }
.book-12 { --size: 74px; left: 58%; top: 8%; transform: rotate(9deg); animation-delay: -3s; }
.book-13 { --size: 64px; left: 74%; top: 60%; transform: rotate(-14deg); animation-delay: -12s; }
.book-14 { --size: 82px; left: 17%; top: 84%; transform: rotate(12deg); animation-delay: -1s; }
.book-15 { --size: 96px; left: 46%; top: 74%; transform: rotate(-9deg); animation-delay: -8s; }
.book-16 { --size: 60px; left: 92%; top: 12%; transform: rotate(10deg); animation-delay: -16s; }

@keyframes floatBook {
    0%, 100% { translate: 0 0; }
    25% { translate: 18px -22px; }
    50% { translate: -12px -44px; }
    75% { translate: 14px -12px; }
}

.layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    height: 100vh;
    padding: 18px;
}

.glass-panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.sidebar {
    min-height: 0;
}

.sidebar-inner {
    position: sticky;
    top: 0;
    height: calc(100vh - 36px);
    overflow-y: auto;
    border-radius: 28px;
    padding: 22px 18px;
    color: #ffd1e7;
    background:
        linear-gradient(180deg, rgba(255, 214, 235, 0.28) 0%, rgba(255, 132, 201, 0.12) 45%, rgba(122, 72, 145, 0.18) 100%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.sidebar h2 {
    text-align: center;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 24px;
    color: #ffe5f3;
    text-shadow: 0 0 18px rgba(255, 92, 184, 0.28);
}

.menu-btn {
    width: 100%;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(255, 92, 184, 0.88), rgba(169, 112, 255, 0.88));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    font-weight: 700;
    padding: 15px 16px;
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    box-shadow: 0 10px 24px rgba(255, 92, 184, 0.18);
}

.menu-btn:hover,
.chat-input-wrap button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 92, 184, 0.34);
    border-color: rgba(255, 255, 255, 0.26);
}

.sidebar-card,
.status-box {
    background: rgba(255, 240, 248, 0.14);
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffd7ea;
    margin-top: 18px;
    font-size: 0.97rem;
    backdrop-filter: blur(10px);
}

.sidebar-card hr,
.status-box hr {
    border: 0.5px solid rgba(255, 196, 225, 0.34);
    margin: 12px 0;
}

.main-content {
    min-height: 0;
    overflow-y: auto;
    padding: 10px 10px 26px 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    scroll-behavior: smooth;
}

.hero-container {
    text-align: center;
    padding: 2.8rem 1.4rem;
    border-radius: 34px;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 0 24px rgba(255, 92, 184, 0.42);
}

.hero-subtitle {
    color: var(--pink-soft);
    font-size: 1.08rem;
    margin-top: 12px;
    opacity: 0.95;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 8px;
}

.message {
    border-radius: 24px;
    padding: 18px 20px;
    max-width: min(980px, 88%);
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(145deg, rgba(169, 112, 255, 0.2), rgba(255, 92, 184, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
}

.message.assistant {
    align-self: flex-start;
}

.message-content {
    white-space: pre-wrap;
    line-height: 1.62;
    font-size: 1.02rem;
}

.chat-input-wrap {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 12px;
    padding: 12px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(15, 19, 36, 0.82), rgba(37, 13, 37, 0.72));
}

.chat-input-wrap input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    outline: none;
    border-radius: 16px;
    padding: 15px 16px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.07);
    color: white;
}

.chat-input-wrap input::placeholder {
    color: rgba(255, 228, 240, 0.6);
}

.chat-input-wrap button {
    background: linear-gradient(135deg, #ff5cb8, #a970ff);
    color: white;
    border: none;
    border-radius: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 8;
    max-width: 360px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(20, 25, 45, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(14px);
}

.hidden {
    display: none;
}

.typing::after {
    content: "";
    display: inline-block;
    width: 1ch;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 92, 184, 0.7), rgba(169, 112, 255, 0.7));
    border-radius: 999px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 980px) {
    body { overflow: auto; }
    .layout { grid-template-columns: 1fr; height: auto; }
    .sidebar-inner { position: relative; height: auto; }
    .main-content { overflow: visible; padding-right: 0; }
    .chat-input-wrap { position: static; grid-template-columns: 1fr; }
    .message { max-width: 100%; }
    .book { opacity: 0.22; }
}
