:root {
    --font-body: "Manrope", sans-serif;
    --font-display: "Playfair Display", serif;
    --bg: #d4d8de;
    --bg-tint: rgba(241, 244, 248, 0.28);
    --surface: rgba(240, 243, 247, 0.26);
    --surface-strong: rgba(246, 248, 251, 0.38);
    --surface-soft: rgba(255, 255, 255, 0.1);
    --shadow: 0 28px 80px rgba(40, 49, 70, 0.14);
    --text: #1a2232;
    --muted: #606d84;
    --heading: #111827;
    --accent: #45d2c5;
    --accent-2: #6698ff;
    --line: rgba(255, 255, 255, 0.18);
}

.darkmode {
    --bg: #020308;
    --bg-tint: rgba(7, 9, 15, 0.46);
    --surface: rgba(10, 13, 20, 0.54);
    --surface-strong: rgba(13, 17, 26, 0.72);
    --surface-soft: rgba(255, 255, 255, 0.05);
    --shadow: 0 30px 90px rgba(0, 0, 0, 0.68);
    --text: #e5e9f5;
    --muted: #8792a8;
    --heading: #fbfcff;
    --accent: #56e4d4;
    --accent-2: #6ea8ff;
    --line: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: var(--text);
    font-family: var(--font-body);
}

*::selection {
    background: rgba(86, 228, 212, 0.16);
    color: var(--heading);
}

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

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 26%),
        radial-gradient(circle at bottom right, rgba(102, 152, 255, 0.14), transparent 28%),
        linear-gradient(180deg, var(--bg-tint), rgba(255,255,255,0.02)),
        var(--bg);
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

input:focus,
button:focus,
.select:focus {
    outline: none;
}

.page-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -3;
}

.backdrop-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(44px);
}

.orb-one {
    width: 34rem;
    height: 34rem;
    top: -12rem;
    left: -10rem;
    background: rgba(86, 228, 212, 0.12);
}

.orb-two {
    width: 30rem;
    height: 30rem;
    right: -8rem;
    top: 18%;
    background: rgba(110, 168, 255, 0.14);
}

.backdrop-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 84px 84px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 88%);
}

.sidebar {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: min(22rem, calc(100vw - 2rem));
    height: calc(100vh - 2rem);
    padding: 1.4rem 1rem 1rem;
    border-radius: 1.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    overflow-y: auto;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    transform: translateX(0);
    transition: transform 0.32s ease, opacity 0.32s ease;
    z-index: 30;
}

.sidebar.closed {
    transform: translateX(calc(100% + 1.5rem));
    opacity: 0;
    pointer-events: none;
}

.sidebar h1 {
    font-family: var(--font-display);
    font-size: 2.6rem;
    color: var(--heading);
    line-height: 1;
}

.sidebar ul {
    list-style: none;
    display: grid;
    gap: 0.85rem;
}

.sidebar li {
    display: flex;
}

.sidebar a,
.dark-mode-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 1rem 1.05rem;
    border-radius: 1.15rem;
    background: var(--surface-soft);
    color: var(--text);
}

.sidebar a {
    font-weight: 700;
}

#menu {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    color: var(--heading);
}

.dark-mode-toggle {
    justify-content: space-between;
}

.theme-switch {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.theme-switch span {
    color: var(--muted);
    font-weight: 700;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    display: inline-block;
    width: 3.5rem;
    min-width: 3.5rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.slider::before {
    content: "";
    position: absolute;
    top: 0.2rem;
    left: 0.22rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.28s ease;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

input:checked + .slider::before {
    transform: translateX(1.46rem);
}

main {
    width: min(1200px, calc(100% - 2rem));
    min-height: 100vh;
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0 1.2rem;
}

header h1 a {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 4.8rem);
    color: var(--heading);
    letter-spacing: -0.03em;
    line-height: 1;
}

#util,
#h_icons {
    display: flex;
    align-items: center;
}

#profile-icon {
    width: 3.3rem;
    height: 3.3rem;
    border-radius: 999px;
    border: 0;
    background: var(--surface-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--heading);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

#elements {
    display: grid;
    gap: 2rem;
    padding-bottom: 1rem;
}

.page-intro {
    display: grid;
    gap: 0.9rem;
    padding: 1.1rem 0 0.2rem;
    max-width: 54rem;
}

.section-kicker {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 800;
}

.page-intro h2,
.questions-heading h3 {
    color: var(--heading);
    font-family: var(--font-display);
    letter-spacing: -0.03em;
    line-height: 1.02;
}

.page-intro h2 {
    font-size: clamp(2.8rem, 6vw, 5rem);
    max-width: 12ch;
}

.page-intro p:last-child,
.questions-heading p:last-child {
    color: var(--muted);
    line-height: 1.9;
}

.quiz-settings {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
    gap: 1rem 1.2rem;
    padding: 1.2rem 1.4rem;
    border-radius: 2rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.settings-block {
    display: grid;
    gap: 0.75rem;
}

.settings-block label,
.dropdown > span {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 800;
}

#quiztitle,
.option input[type="text"],
.ques-input {
    width: 100%;
    min-height: 3.5rem;
    border: 1px solid transparent;
    border-radius: 1.25rem;
    padding: 0 1.1rem;
    background: var(--surface-strong);
    color: var(--heading);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#quiztitle::placeholder,
.option input[type="text"]::placeholder,
.ques-input::placeholder {
    color: var(--muted);
}

#quiztitle:focus,
.option input[type="text"]:focus,
.ques-input:focus {
    border-color: rgba(86, 228, 212, 0.32);
    box-shadow: 0 0 0 4px rgba(86, 228, 212, 0.12);
}

.dropdown {
    position: relative;
    display: grid;
    gap: 0.75rem;
}

.select {
    min-height: 3.5rem;
    border-radius: 1.25rem;
    background: var(--surface-strong);
    padding: 0 1rem 0 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    border: 1px solid transparent;
}

.select-clicked {
    border-color: rgba(86, 228, 212, 0.32);
    box-shadow: 0 0 0 4px rgba(86, 228, 212, 0.12);
}

.caret {
    width: 0.7rem;
    height: 0.7rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.caret-rotate {
    transform: rotate(225deg);
}

.timemenu {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 0;
    right: 0;
    list-style: none;
    padding: 0.55rem;
    display: none;
    gap: 0.35rem;
    border-radius: 1.3rem;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    z-index: 10;
}

.timemenu li {
    padding: 0.8rem 0.95rem;
    border-radius: 0.95rem;
    cursor: pointer;
    color: var(--text);
}

.timemenu li:hover,
.timemenu li.active {
    background: rgba(86, 228, 212, 0.14);
    color: var(--heading);
}

.menu-open {
    display: grid;
}

#quiz_group-error {
    color: #ff8d8d !important;
    font-size: 0.92rem;
}

.question-container {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 1.4rem;
    padding: 0.2rem 0 0;
}

.questions-heading {
    display: grid;
    gap: 0.75rem;
    max-width: 40rem;
}

.questions-heading h3 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

#quiz-form {
    display: grid;
    gap: 1.6rem;
}

#question-list {
    display: grid;
    gap: 1.6rem;
}

.question-field {
    display: grid;
    gap: 1.1rem;
    padding: 1.4rem 1.5rem 1.3rem;
    border-radius: 1.8rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

#sawal {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
}

.question-number {
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--heading);
    font-weight: 800;
}

#options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1rem;
}

.option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.75rem;
    border-radius: 1.3rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.option input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent);
}

.option input[type="text"] {
    min-height: 3.2rem;
    padding: 0 0.95rem;
    background: transparent;
    box-shadow: none;
}

.delete-question {
    justify-self: end;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: var(--heading);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.delete-question svg {
    fill: currentColor;
}

#btns {
    display: flex;
    justify-content: flex-end;
}

#save,
#add-question {
    min-height: 3.45rem;
    padding: 0 1.4rem;
    border-radius: 999px;
    border: 0;
    font-weight: 800;
}

#save {
    min-width: 10rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #ffffff;
    box-shadow: 0 16px 36px rgba(83, 157, 255, 0.24);
}

#add-question {
    justify-self: start;
    padding: 0 1.5rem;
    background: var(--surface-strong);
    color: var(--heading);
}

@media (max-width: 1024px) {
    .quiz-settings,
    #options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .sidebar {
        width: calc(100vw - 1rem);
        top: 0.5rem;
        right: 0.5rem;
        height: calc(100vh - 1rem);
    }

    main {
        width: min(100%, calc(100% - 1rem));
    }

    .page-intro h2 {
        max-width: none;
    }

    .question-field {
        padding: 1.2rem 1rem;
    }

    #sawal {
        grid-template-columns: 1fr;
    }

    #btns {
        justify-content: stretch;
    }

    #save,
    #add-question {
        width: 100%;
    }
}

.sidebar-title {
    font-family: var(--font-body) !important;
    font-size: 0.78rem !important;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted) !important;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--heading);
    font-weight: 800;
    letter-spacing: -0.01em;
}

.back-link svg {
    flex-shrink: 0;
    color: inherit;
}
