/* =========================================================
   DRAMA TREE TRACKER
   Final visual design
   ========================================================= */

:root {
    --bg: #f8f9f7;
    --bg-soft: #ffffff;
    --ink: #53604f;
    --ink-dark: #000000;
    --muted: #8b9188;

    --green: #708866;
    --green-dark: #53694c;
    --green-soft: rgba(112, 136, 102, 0.14);

    --blue: #48b9ea;
    --blue-dark: #367ee7;
    --purple: #7763ed;

    --glass: rgba(255, 255, 255, 0.72);
    --glass-strong: rgba(255, 255, 255, 0.9);
    --border: rgba(84, 102, 78, 0.24);
    --border-light: rgba(255, 255, 255, 0.82);

    --danger: #d85f67;
    --success: #5c9b68;
    --warning: #c79632;

    --sidebar-width: 450px;

    --shadow-soft:
        0 25px 70px rgba(68, 76, 59, 0.14);

    --shadow-card:
        0 18px 45px rgba(65, 76, 57, 0.12);

    --shadow-button:
        0 14px 28px rgba(75, 92, 65, 0.18);
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--ink-dark);

    background:
        radial-gradient(
            circle at 50% 43%,
            rgba(92, 185, 239, 0.16),
            transparent 25%
        ),
        radial-gradient(
            circle at 42% 46%,
            rgba(132, 101, 239, 0.10),
            transparent 27%
        ),
        radial-gradient(
            circle at 74% 30%,
            rgba(112, 136, 102, 0.08),
            transparent 24%
        ),
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f8f9f7 48%,
            #f4f6f2 100%
        );

    overflow-x: hidden;
}


/* =========================================================
   MAIN APP
   ========================================================= */

.app {
    min-height: 100vh;
    position: relative;
}

.app::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 43%, rgba(107, 179, 235, 0.10), transparent 24%),
        radial-gradient(circle at 43% 50%, rgba(137, 111, 236, 0.08), transparent 28%);
    z-index: 0;
}

/* =========================================================
   TOP BAR
   ========================================================= */

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 86px;
    padding: 17px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
    pointer-events: none;
}

.library-dashboard {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 13px 8px 9px;
    border: 1px solid rgba(83, 105, 76, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.52);
    color: var(--ink-dark);
    box-shadow: 0 8px 24px rgba(64, 77, 58, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.library-dashboard:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 30px rgba(64, 77, 58, 0.12);
}

.brand-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(112, 136, 102, 0.18), rgba(255, 255, 255, 0.82));
    font-size: 20px;
}

.library-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.library-summary strong {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.15px;
}

.library-summary span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 650;
}

.menu-button { pointer-events: auto; }

/* =========================================================
   BUTTONS
   ========================================================= */

button { font: inherit; }

.icon-button,
.small-icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(83, 105, 76, 0.18);
    background: rgba(255, 255, 255, 0.68);
    color: var(--ink-dark);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 8px 22px rgba(64, 77, 58, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.icon-button:hover,
.small-icon-button:hover {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(112, 136, 102, 0.36);
    transform: translateY(-1px);
    box-shadow: 0 11px 25px rgba(64, 77, 58, 0.12);
}

.icon-button:active,
.small-icon-button:active { transform: scale(0.95); }

.icon-button {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 22px;
}

.small-icon-button {
    width: 35px;
    height: 35px;
    border-radius: 11px;
    font-size: 17px;
}

.close-button:hover { color: var(--danger); }

/* =========================================================
   CLEAN SEARCH STAGE
   ========================================================= */

.search-stage {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 25px;  /* Agote aityu asile 105px 25px 55px */
    overflow: hidden;
    isolation: isolate;
}

.ambient {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(70px);
    z-index: -2;
}

.ambient-one {
    width: 430px;
    height: 430px;
    left: calc(50% - 330px);
    top: calc(50% - 250px);
    background: rgba(127, 104, 238, 0.12);
    animation: floatAmbientOne 8s ease-in-out infinite;
}

.ambient-two {
    width: 450px;
    height: 450px;
    right: calc(50% - 350px);
    bottom: calc(50% - 280px);
    background: rgba(75, 190, 235, 0.12);
    animation: floatAmbientTwo 9s ease-in-out infinite;
}

@keyframes floatAmbientOne {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-10px, -12px, 0) scale(1.035); }
}

@keyframes floatAmbientTwo {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(12px, 10px, 0) scale(1.04); }
}

/* =========================================================
   MAIN GLASS CIRCLE
   ========================================================= */

.search-orb {
    width: min(600px, 76vw);
    aspect-ratio: 1;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 31% 23%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.82) 27%, rgba(246, 249, 255, 0.68) 60%, rgba(239, 246, 251, 0.48) 100%);
    border: 10px solid rgba(255, 255, 255, 0.78);
    box-shadow:
        0 30px 80px rgba(81, 105, 139, 0.14),
        0 0 75px rgba(117, 126, 235, 0.13),
        0 0 110px rgba(70, 193, 237, 0.07),
        inset 0 0 65px rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.search-orb::before {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: conic-gradient(from 210deg, #9b83f5, #8f9df8, #75d7f2, #9b83f5);
    opacity: 0.78;
    z-index: -2;
    filter: blur(0.2px);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}

.search-orb::after {
    content: "";
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    border: 1px solid rgba(119, 129, 226, 0.16);
    pointer-events: none;
}

.orb-highlight {
    position: absolute;
    width: 48%;
    height: 48%;
    left: 9%;
    top: 4%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.70);
    filter: blur(22px);
    transform: rotate(-18deg);
    pointer-events: none;
}

.orb-inner-glow {
    position: absolute;
    width: 54%;
    height: 54%;
    right: 4%;
    bottom: 4%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(86, 196, 238, 0.14), rgba(124, 109, 239, 0.07) 45%, transparent 72%);
    filter: blur(24px);
    pointer-events: none;
}

/* =========================================================
   SEARCH CONTENT
   ========================================================= */

.search-content {
    width: min(82%, 500px);
    position: relative;
    z-index: 4;
    text-align: center;
}

.search-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(131, 116, 235, 0.12), rgba(93, 203, 239, 0.16));
    border: 1px solid rgba(132, 149, 224, 0.20);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.98), 0 13px 32px rgba(79, 102, 143, 0.09);
}

.search-icon svg { width: 45px; height: 45px; overflow: visible; }

.search-glass-circle {
    fill: rgba(105, 211, 239, 0.72);
    stroke: #6550a9;
    stroke-width: 4.2;
}

.search-glass-handle {
    fill: none;
    stroke: #6550a9;
    stroke-width: 7;
    stroke-linecap: round;
}

.search-content h1 {
    color: #29394f;
    font-size: clamp(31px, 4.3vw, 48px);
    line-height: 1.05;
    letter-spacing: -1.7px;
    font-weight: 800;
    margin-bottom: 11px;
}

.search-content p {
    color: #718096;
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 28px;
}

/* =========================================================
   PILL SEARCH BAR
   ========================================================= */

.search-box {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    padding: 6px 7px 6px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1.5px solid rgba(134, 156, 188, 0.62);
    box-shadow: 0 18px 42px rgba(76, 101, 133, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.search-box:focus-within {
    border-color: rgba(102, 126, 220, 0.68);
    box-shadow: 0 20px 45px rgba(74, 102, 141, 0.16), 0 0 0 5px rgba(112, 128, 231, 0.08);
}

.search-field-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #66758a;
}

.search-field-icon svg { width: 25px; height: 25px; overflow: visible; }

.search-field-circle {
    fill: none;
    stroke: #617086;
    stroke-width: 2.2;
}

.search-field-handle {
    fill: none;
    stroke: #617086;
    stroke-width: 2.4;
    stroke-linecap: round;
}

.search-box input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 13px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #34445a;
    font-size: 16px;
    font-weight: 500;
}

.search-box input::placeholder { color: #8793a2; opacity: 1; }
.search-box input::-webkit-search-cancel-button { cursor: pointer; }

.search-box button {
    min-width: 128px;
    height: 58px;
    padding: 0 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(145deg, #829a78, #657f5d);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 14px 28px rgba(75, 92, 65, 0.18);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.search-box button:hover {
    transform: translateY(-1px);
    filter: brightness(1.045);
    box-shadow: 0 18px 34px rgba(75, 92, 65, 0.23);
}

.search-box button:active { transform: scale(0.97); }

.find-arrow { font-size: 24px; font-weight: 400; line-height: 1; }

/* =========================================================
   MINIMAL STARS
   ========================================================= */

.search-spark {
    position: absolute;
    z-index: 1;
    color: #8172e9;
    font-size: 34px;
    line-height: 1;
    opacity: 0.82;
    filter: drop-shadow(0 7px 12px rgba(105, 91, 220, 0.13));
    pointer-events: none;
    animation: cleanSpark 5s ease-in-out infinite;
}

.spark-one { left: calc(50% - 350px); top: 31%; }

.spark-two {
    left: calc(50% + 325px);
    bottom: 28%;
    color: #6578e8;
    font-size: 29px;
    animation-delay: -2.5s;
}

@keyframes cleanSpark {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.68; }
    50% { transform: translateY(-5px) scale(1.06); opacity: 0.95; }
}

/* =========================================================
   SIDEBAR OVERLAY
   ========================================================= */

.sidebar-overlay {
    position: fixed;
    inset: 0;

    background: rgba(47, 57, 45, 0.20);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;

    z-index: 30;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;

    top: 0;
    right: 0;

    width: var(--sidebar-width);
    height: 100vh;

    z-index: 40;

    display: flex;
    flex-direction: column;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.97),
            rgba(246, 248, 244, 0.97)
        );

    border-left: 1px solid rgba(78, 98, 72, 0.16);

    box-shadow:
        -25px 0 70px rgba(67, 76, 58, 0.17);

    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);

    transform: translateX(100%);

    transition:
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.active {
    transform: translateX(0);
}


/* =========================================================
   SIDEBAR HEADER
   ========================================================= */

.sidebar-header {
    min-height: 82px;

    padding: 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid rgba(78, 98, 72, 0.12);

    background:
        rgba(255, 255, 255, 0.58);
}

.sidebar-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-title-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: rgba(112, 136, 102, 0.12);

    font-size: 22px;
}

.sidebar-header h2 {
    color: var(--ink-dark);

    font-size: 17px;
    font-weight: 800;

    letter-spacing: -0.25px;
}

.sidebar-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}


/* =========================================================
   INLINE FORMS
   ========================================================= */

.inline-form {
    display: flex;
    gap: 8px;

    padding: 13px 15px;

    background: rgba(112, 136, 102, 0.055);

    border-bottom: 1px solid rgba(78, 98, 72, 0.11);

    animation: slideDown 0.2s ease;
}

.inline-form input {
    flex: 1;
    min-width: 0;

    height: 40px;

    padding: 0 12px;

    outline: none;

    border-radius: 11px;

    border: 1px solid rgba(78, 98, 72, 0.18);

    background: rgba(255, 255, 255, 0.78);

    color: var(--ink-dark);

    font-size: 13px;
}

.inline-form input:focus {
    border-color: rgba(72, 139, 220, 0.55);

    box-shadow:
        0 0 0 3px rgba(72, 185, 234, 0.08);
}

.inline-form button {
    border: 0;
    border-radius: 11px;

    padding: 0 14px;

    background:
        linear-gradient(
            145deg,
            #829875,
            #637c5a
        );

    color: #ffffff;

    font-weight: 750;

    cursor: pointer;
}

.hidden {
    display: none !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   SEARCH STATUS
   ========================================================= */

.search-status {
    padding: 10px 18px;

    color: #7d8679;

    font-size: 12px;
    font-weight: 600;

    border-bottom: 1px solid rgba(78, 98, 72, 0.10);

    background: rgba(112, 136, 102, 0.035);
}


/* =========================================================
   TREE
   ========================================================= */

.tree-container {
    flex: 1;

    overflow-y: auto;

    padding: 12px 10px 25px;
}

.tree-container::-webkit-scrollbar {
    width: 7px;
}

.tree-container::-webkit-scrollbar-track {
    background: transparent;
}

.tree-container::-webkit-scrollbar-thumb {
    background: rgba(83, 105, 76, 0.16);
    border-radius: 20px;
}

.tree-container::-webkit-scrollbar-thumb:hover {
    background: rgba(83, 105, 76, 0.25);
}


/* =========================================================
   DETAILS / SUMMARY
   ========================================================= */

details {
    margin: 2px 0;
}

summary {
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}


/* =========================================================
   PLATFORM
   ========================================================= */

.platform-details {
    border-radius: 12px;
}

.platform-details > summary {
    min-height: 46px;

    padding: 7px 8px;

    display: flex;
    align-items: center;
    gap: 7px;

    border-radius: 12px;

    cursor: pointer;

    color: #5f6b5b;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.platform-details > summary:hover {
    background: rgba(112, 136, 102, 0.08);
    color: #3f4c3c;
}

.platform-details[open] > summary {
    background: rgba(112, 136, 102, 0.08);
    color: #3f4c3c;
}

.platform-chevron {
    width: 15px;

    color: #889286;

    font-size: 10px;

    transition: transform 0.2s ease;
}

.platform-details[open] .platform-chevron {
    transform: rotate(90deg);
}

.platform-icon {
    font-size: 17px;
    flex-shrink: 0;
}

.platform-name {
    flex: 1;
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 14px;
    font-weight: 700;
}

.platform-actions {
    display: flex;
    align-items: center;
    gap: 4px;

    margin-left: auto;
}

.tree-action {
    width: 28px;
    height: 28px;

    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    border: 1px solid transparent;

    background: transparent;

    color: #879084;

    font-size: 13px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.18s ease;
}

.tree-action:hover {
    background: rgba(112, 136, 102, 0.10);

    color: var(--green-dark);

    border-color: rgba(112, 136, 102, 0.14);

    transform: scale(1.06);
}

.delete-action:hover {
    background: rgba(216, 95, 103, 0.10);
    color: var(--danger);
    border-color: rgba(216, 95, 103, 0.14);
}

.priority-platform > summary {
    background:
        linear-gradient(
            90deg,
            rgba(112, 136, 102, 0.15),
            rgba(112, 136, 102, 0.045)
        );

    border: 1px solid rgba(112, 136, 102, 0.16);
}


/* =========================================================
   SUBSCRIPTION BADGE
   ========================================================= */

.subscription-badge {
    flex-shrink: 0;

    display: inline-flex;
    align-items: center;

    padding: 4px 8px;

    border-radius: 999px;

    background: rgba(92, 155, 104, 0.09);

    border: 1px solid rgba(92, 155, 104, 0.16);

    color: var(--success);

    font-size: 10px;
    font-weight: 750;

    white-space: nowrap;
}

.subscription-badge.expired {
    background: rgba(216, 95, 103, 0.08);

    border-color: rgba(216, 95, 103, 0.15);

    color: var(--danger);
}


/* =========================================================
   DRAMA LIST
   ========================================================= */

.drama-list {
    margin-left: 22px;

    padding: 3px 0 4px 14px;

    border-left: 1px dashed rgba(83, 105, 76, 0.24);
}

.drama-details {
    margin: 2px 0;
}

.drama-details > summary {
    min-height: 39px;

    padding: 6px 8px;

    display: flex;
    align-items: center;
    gap: 7px;

    border-radius: 9px;

    cursor: pointer;

    color: #687365;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.drama-details > summary:hover {
    background: rgba(112, 136, 102, 0.065);
    color: #43503f;
}

.drama-details[open] > summary {
    color: #3f4c3c;
}

.drama-chevron {
    width: 13px;

    color: #90988c;

    font-size: 9px;

    transition: transform 0.2s ease;
}

.drama-details[open] .drama-chevron {
    transform: rotate(90deg);
}

.drama-icon {
    font-size: 15px;
}

.drama-title {
    flex: 1;
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 13px;
}

.drama-actions {
    margin-left: auto;

    display: flex;
    align-items: center;
    gap: 3px;

    flex-shrink: 0;
}


/* =========================================================
   DRAMA STATS
   ========================================================= */

.drama-stats {
    margin: 2px 8px 9px 30px;

    padding: 12px;

    border-radius: 11px;

    background:
        rgba(255, 255, 255, 0.72);

    border: 1px solid rgba(83, 105, 76, 0.12);

    box-shadow:
        0 8px 22px rgba(64, 77, 58, 0.055);

    display: flex;
    flex-direction: column;
    gap: 9px;

    font-size: 12px;

    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.drama-url {
    color: #4a91c6;

    text-decoration: none;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drama-url:hover {
    text-decoration: underline;
}

.drama-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    color: #687365;
}

.drama-control-row label {
    display: flex;
    align-items: center;
    gap: 7px;

    cursor: pointer;
}

.drama-control-row input[type="checkbox"] {
    width: 15px;
    height: 15px;

    accent-color: var(--green);

    cursor: pointer;
}

.rating-select {
    height: 30px;

    padding: 0 8px;

    border-radius: 8px;

    border: 1px solid rgba(83, 105, 76, 0.16);

    outline: none;

    background: #ffffff;

    color: #53604f;

    font-size: 12px;

    cursor: pointer;
}

.added-time {
    color: #92988f;

    font-size: 10px;
}


/* =========================================================
   ADD DRAMA FORM
   ========================================================= */

.drama-form {
    margin: 7px 8px 10px 36px;

    padding: 11px;

    display: flex;
    flex-direction: column;
    gap: 7px;

    border-radius: 11px;

    background: rgba(255, 255, 255, 0.74);

    border: 1px solid rgba(83, 105, 76, 0.12);

    box-shadow:
        0 8px 22px rgba(64, 77, 58, 0.06);

    animation: fadeIn 0.2s ease;
}

.drama-form input {
    width: 100%;

    height: 36px;

    padding: 0 10px;

    outline: none;

    border-radius: 9px;

    border: 1px solid rgba(83, 105, 76, 0.16);

    background: rgba(255, 255, 255, 0.85);

    color: var(--ink-dark);

    font-size: 12px;
}

.drama-form input:focus {
    border-color: rgba(72, 139, 220, 0.52);

    box-shadow:
        0 0 0 3px rgba(72, 185, 234, 0.07);
}

.drama-form button {
    height: 36px;

    border: 0;
    border-radius: 9px;

    background:
        linear-gradient(
            145deg,
            #829875,
            #637c5a
        );

    color: #ffffff;

    font-size: 12px;
    font-weight: 750;

    cursor: pointer;
}


/* =========================================================
   EMPTY / NO RESULTS
   ========================================================= */

.empty-state,
.no-results {
    margin: 28px 12px;

    padding: 28px 18px;

    text-align: center;

    border-radius: 18px;

    background:
        rgba(255, 255, 255, 0.62);

    border: 1px solid rgba(83, 105, 76, 0.10);

    box-shadow:
        0 12px 30px rgba(64, 77, 58, 0.05);
}

.empty-icon,
.no-results-icon {
    margin-bottom: 12px;

    font-size: 31px;
}

.empty-state h3,
.no-results h3 {
    color: #4d594a;

    font-size: 15px;

    margin-bottom: 7px;
}

.empty-state p,
.no-results p {
    color: #90978d;

    font-size: 12px;
    line-height: 1.55;
}


/* =========================================================
   STATISTICS OVERLAY
   ========================================================= */

.stats-overlay {
    position: fixed;
    inset: 0;

    z-index: 60;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 22px;

    background: rgba(54, 63, 51, 0.20);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.stats-overlay.active {
    opacity: 1;
    visibility: visible;
}

.stats-modal {
    width: min(430px, 100%);

    padding: 20px;

    border-radius: 24px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.97),
            rgba(246, 248, 244, 0.97)
        );

    border: 1px solid rgba(83, 105, 76, 0.14);

    box-shadow:
        0 30px 90px rgba(56, 67, 51, 0.22);

    transform: translateY(12px) scale(0.98);

    transition:
        transform 0.25s ease;
}

.stats-overlay.active .stats-modal {
    transform: translateY(0) scale(1);
}

.stats-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}

.stats-heading {
    display: flex;
    align-items: center;
    gap: 11px;
}

.stats-modal-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background:
        linear-gradient(
            145deg,
            rgba(112, 136, 102, 0.17),
            rgba(72, 185, 234, 0.08)
        );

    font-size: 23px;
}

.stats-modal-header h2 {
    color: #44503f;

    font-size: 18px;

    margin-bottom: 2px;
}

.stats-modal-header p {
    color: var(--muted);

    font-size: 11px;
}


/* =========================================================
   STAT GRID
   ========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 9px;

    margin-bottom: 13px;
}

.stat-card {
    min-height: 95px;

    padding: 13px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    border-radius: 15px;

    background:
        rgba(255, 255, 255, 0.70);

    border: 1px solid rgba(83, 105, 76, 0.10);

    box-shadow:
        0 8px 22px rgba(64, 77, 58, 0.05);
}

.stat-icon {
    font-size: 18px;
    margin-bottom: 7px;
}

.stat-value {
    color: #465341;

    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    color: var(--muted);

    font-size: 10px;

    margin-top: 5px;
}


/* =========================================================
   INFORMATION ROWS
   ========================================================= */

.library-info {
    display: flex;
    flex-direction: column;
    gap: 1px;

    padding: 4px 0;

    border-top: 1px solid rgba(83, 105, 76, 0.12);
}

.info-row {
    min-height: 43px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 0 5px;

    color: #858d82;

    font-size: 12px;

    border-bottom: 1px solid rgba(83, 105, 76, 0.07);
}

.info-row strong {
    color: #596552;

    font-size: 12px;
    font-weight: 700;

    text-align: right;

    max-width: 55%;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-footer {
    margin-top: 15px;

    text-align: center;

    color: #969c93;

    font-size: 10px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 850px) {
    .search-orb {
        width: min(540px, 82vw);
    }



    .spark-one {
        left: calc(50% - 285px);
    }

    .spark-two {
        left: calc(50% + 255px);
    }
}


@media (max-width: 600px) {

    .top-bar {
        height: 72px;
        padding: 12px 14px;
    }

    .library-dashboard {
        padding-right: 10px;
        border-radius: 15px;
    }

    .brand-icon {
        width: 33px;
        height: 33px;
        font-size: 18px;
    }

    .library-summary strong {
        font-size: 12px;
    }

    .library-summary span {
        font-size: 8px;
    }

    .icon-button {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .search-stage {
        min-height: 100svh;

        padding:
            90px
            13px
            35px;
    }

    .search-orb {
        width: min(490px, 94vw);

        border-width: 7px;
    }

    .search-orb::before {
        inset: -13px;
    }

    .search-orb::after {
        inset: 25px;
    }

    .search-content {
        width: 84%;
    }

    .search-icon {
        width: 58px;
        height: 58px;

        margin-bottom: 14px;
    }

    .search-icon svg {
        width: 35px;
        height: 35px;
    }

    .search-content h1 {
        font-size: clamp(25px, 8vw, 34px);
    }

    .search-content p {
        font-size: 11px;
        margin-bottom: 18px;
    }

    .search-box {
        height: 58px;

        padding:
            5px
            5px
            5px
            15px;
    }

    .search-field-icon {
        font-size: 28px;
    }

    .search-box input {
        padding: 0 8px;
        font-size: 13px;
    }

    .search-divider {
        height: 27px;
    }

    .search-box button {
        min-width: 74px;
        height: 48px;

        padding: 0 12px;

        gap: 5px;

        font-size: 12px;
    }

    .find-arrow {
        font-size: 20px;
    }



    .search-spark {
        font-size: 27px;
    }

    .spark-one {
        left: calc(50% - 175px);
        top: 31%;
    }

    .spark-two {
        left: calc(50% + 150px);
        bottom: 29%;
        font-size: 23px;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-header {
        min-height: 76px;
        padding: 16px 14px;
    }

    .stats-overlay {
        align-items: flex-end;
        padding: 12px;
    }

    .stats-modal {
        border-radius: 21px;
        padding: 17px;
    }

    .tree-action {
        width: 29px;
        height: 29px;
        font-size: 12px;
    }
}


@media (max-width: 390px) {

    .library-summary span {
        display: none;
    }

    .search-content {
        width: 87%;
    }

    .search-content h1 {
        font-size: 25px;
    }

    .search-content p {
        font-size: 10px;
    }

    .search-box input {
        font-size: 12px;
    }

    .search-box button {
        min-width: 65px;
        padding: 0 9px;
    }

    .find-arrow {
        display: none;
    }
}


/* notunnnnnnnnnnnnnnnnnnnnnnnnnn */

/* =====================================================
    PROFILE MENU & LOGIN POPUP
    ===================================================== */
    .profile-menu {
    position: relative;
    display: flex;
    align-items: center;
    pointer-events: auto; /* This makes it clickable! */
    }

    #profile-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
    border: 2px solid #dadce0;
    }

    #profile-popup {
    position: absolute;
    top: 50px;
    right: 0;
    background-color: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: max-content;
    z-index: 999;
    }

    .google-sync-btn {
    background-color: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    padding: 10px 16px;
    border-radius: 4px;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    
    /* These 3 lines perfectly align the icon and text */
    display: flex;
    align-items: center;
    gap: 12px;
    }

    .logout-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    }












/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}