:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --accent: #34a853;
    --dark: #202a44;
    --light-bg: #f8f9fa;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #333;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.hero-section {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    color: white;
    padding: 5rem 0;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
}

.feature-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.material-card {
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
}

.material-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(26, 115, 232, 0.15);
}

.pricing-card {
    border-radius: 16px;
    border: 2px solid #e9ecef;
    transition: all 0.3s;
}

.pricing-card.popular {
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(26, 115, 232, 0.2);
    transform: scale(1.03);
}

.pricing-card:hover {
    border-color: var(--primary);
}

.outline-section {
    background: white;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.progress-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-item.pending { background-color: #f8f9fa; }
.progress-item.generating { background-color: #fff3cd; }
.progress-item.ready { background-color: #d4edda; }
.progress-item.failed { background-color: #f8d7da; }

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

.cost-bar {
    height: 24px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s;
}

.gallery-item {
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.gallery-item .attribution {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* KaTeX math styling */
.katex-display {
    margin: 0.75em 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25em 0;
}

.katex {
    font-size: 1.1em;
}

.outline-section .katex {
    font-size: 1.05em;
}

.my-test-card { border: 0; border-radius: 18px; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }
.my-tests-head { margin-bottom: 1rem; }
.my-tests-toolbar {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
    margin-bottom: 1.1rem; padding: .7rem; border-radius: 16px;
    background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}
.my-tests-search { position: relative; flex: 1 1 16rem; margin: 0; }
.my-tests-search i {
    position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
    color: #64748b; pointer-events: none;
}
.my-tests-search input {
    width: 100%; border: 1.5px solid #e2e8f0; border-radius: 12px;
    padding: .75rem .9rem .75rem 2.4rem; font-size: 1rem;
}
.my-tests-search input:focus { outline: 2px solid #2E86AB; border-color: transparent; }
.my-tests-sort { display: flex; padding: .2rem; border-radius: 12px; background: #f1f5f9; }
.my-tests-sort button {
    border: 0; background: transparent; border-radius: 10px;
    padding: .55rem .85rem; font-weight: 700; color: #475569;
}
.my-tests-sort button.is-on { background: #fff; color: #1B3A6B; box-shadow: 0 1px 4px rgba(15, 23, 42, .08); }
.my-test-name { display: flex; gap: .5rem; align-items: center; margin-bottom: .35rem; }
.my-test-title {
    flex: 1; min-width: 0; font-size: 1.35rem; font-weight: 700; color: #0f172a;
    border: 1.5px solid transparent; border-radius: 12px; background: transparent;
    padding: .25rem .45rem;
}
.my-test-title:hover, .my-test-title:focus { border-color: #cbd5e1; background: #fff; outline: none; }
.my-test-save {
    border: 0; border-radius: 10px; background: #1B3A6B; color: #fff;
    font-weight: 700; padding: .45rem .75rem;
}
.my-test-lesson { color: #64748b; margin-bottom: 1rem; }
.my-test-lesson i { margin-right: .35rem; }
.my-tests-empty {
    border: 1px dashed #cbd5e1; border-radius: 16px; padding: 2rem 1rem;
    text-align: center; color: #64748b; background: #fff;
}
.my-test-actions { display: flex; flex-wrap: nowrap; gap: .5rem; align-items: stretch; }
.my-test-actions form { flex: 1 1 0; margin: 0; min-width: 0; }
.my-test-actions .btn {
    flex: 1 1 0; min-width: 0; font-weight: 600; font-size: .82rem;
    padding: .4rem .55rem; white-space: nowrap;
}
.my-test-actions form .btn { width: 100%; }
.my-test-actions .my-test-dup { flex: 0 0 auto; }
.my-test-actions .my-test-dup .btn {
    flex: none; width: auto; padding: .4rem .55rem; font-size: .78rem; font-weight: 600;
}
@media (max-width: 700px) {
    .my-test-actions { flex-wrap: wrap; }
    .my-test-actions form,
    .my-test-actions .btn { flex: 1 1 9rem; }
    .my-test-actions .my-test-dup { flex: 0 0 auto; }
}
.btn.btn-written {
    background-color: #f59e0b;
    border-color: #ea580c;
    color: #1c1917;
}
.btn.btn-written:hover, .btn.btn-written:focus {
    background-color: #ea580c;
    border-color: #c2410c;
    color: #fff;
}

/* ── Moje kvízy: vytvořit sadu otázek ─────────────────────────────── */
.qset-create {
    position: relative; margin: 0 0 1.75rem;
}
.qset-create-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    width: 100%; border: 0; border-radius: 16px; padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #15803d 0%, #16a34a 55%, #22c55e 100%);
    color: #fff; font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em;
    box-shadow: 0 12px 28px rgba(22, 163, 74, .32);
}
.qset-create-toggle:hover { filter: brightness(1.05); }
.qset-create-toggle:focus-visible { outline: 3px solid rgba(34, 197, 94, .45); outline-offset: 3px; }
.qset-create-toggle i { font-size: 1.2rem; }
.qset-create:not(.is-collapsed) .qset-create-toggle {
    margin-bottom: .75rem;
    background: #fff; color: #15803d;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .06), 0 8px 20px rgba(22, 163, 74, .12);
    border: 1.5px solid #86efac;
}
.qset-create-panel {
    position: relative; border-radius: 24px; overflow: hidden;
    background: linear-gradient(145deg, #0f2744 0%, #1B3A6B 42%, #2E86AB 100%);
    box-shadow: 0 18px 40px rgba(27, 58, 107, .28);
}
.qset-create-glow {
    position: absolute; inset: auto -20% -40% 30%; height: 70%;
    background: radial-gradient(circle, rgba(255,255,255,.18), transparent 65%);
    pointer-events: none;
}
.qset-create-inner { position: relative; padding: 1.35rem 1.35rem 1.2rem; color: #f8fafc; }
.qset-create-kicker {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: #bfdbfe; margin-bottom: .45rem;
}
.qset-create-head h2 {
    margin: 0 0 .4rem; font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; color: #fff;
}
.qset-create-head p { margin: 0 0 1.15rem; color: #dbeafe; max-width: 40rem; line-height: 1.45; }
.qset-grid { display: grid; gap: 1rem; }
.qset-field { display: flex; flex-direction: column; gap: .4rem; }
.qset-field > span {
    font-size: .82rem; font-weight: 700; letter-spacing: .02em; color: #e2e8f0;
}
.qset-field > span em { font-style: normal; font-weight: 500; color: #93c5fd; }
.qset-field input[type="text"],
.qset-field textarea,
.qset-count-ctrl input {
    width: 100%; border: 0; border-radius: 14px; background: rgba(255,255,255,.96);
    color: #0f172a; padding: .85rem 1rem; font-size: 1rem; box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
}
.qset-field textarea { resize: vertical; min-height: 7rem; line-height: 1.45; }
.qset-field input:focus,
.qset-field textarea:focus,
.qset-count-ctrl input:focus { outline: 3px solid rgba(147, 197, 253, .7); }
.qset-hint { margin: 0; font-size: .85rem; color: #bfdbfe; }
.qset-lessons {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: .55rem; max-height: 14rem; overflow: auto; padding: .15rem;
}
.qset-lesson {
    display: flex; gap: .65rem; align-items: flex-start; margin: 0;
    padding: .7rem .8rem; border-radius: 14px; background: rgba(255,255,255,.12);
    border: 1.5px solid transparent; cursor: pointer; color: #f8fafc;
}
.qset-lesson:hover { background: rgba(255,255,255,.18); }
.qset-lesson:has(input:checked) {
    background: rgba(255,255,255,.95); color: #0f172a; border-color: #93c5fd;
}
.qset-lesson input { margin-top: .2rem; accent-color: #1B3A6B; }
.qset-lesson strong { display: block; font-size: .95rem; line-height: 1.25; }
.qset-lesson small { display: block; opacity: .75; margin-top: .15rem; }
.qset-empty-lessons {
    margin: 0; padding: .85rem 1rem; border-radius: 14px;
    background: rgba(255,255,255,.1); color: #dbeafe;
}
.qset-types { display: flex; flex-wrap: wrap; gap: .5rem; }
.qset-type {
    margin: 0; cursor: pointer;
}
.qset-type input { position: absolute; opacity: 0; pointer-events: none; }
.qset-type span {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .55rem .85rem; border-radius: 999px; font-weight: 700; font-size: .9rem;
    background: rgba(255,255,255,.12); color: #eff6ff; border: 1.5px solid transparent;
}
.qset-type i { font-size: 1rem; }
.qset-type:has(input:checked) span {
    background: #dcfce7; color: #166534; border-color: #4ade80;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .25);
}
.qset-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .35rem; min-height: 7.5rem; padding: 1.1rem 1rem; text-align: center;
    border: 2px dashed rgba(255,255,255,.45); border-radius: 16px;
    background: rgba(255,255,255,.08); color: #e2e8f0; cursor: pointer;
}
.qset-drop:hover, .qset-drop.is-over {
    border-color: #93c5fd; background: rgba(255,255,255,.16);
}
.qset-drop i { font-size: 1.8rem; color: #bfdbfe; }
.qset-drop strong { font-size: 1.02rem; color: #fff; }
.qset-drop-pick {
    border: 0; background: transparent; color: #93c5fd; font-weight: 700;
    text-decoration: underline; padding: 0;
}
.qset-file-list {
    list-style: none; margin: .65rem 0 0; padding: 0; display: grid; gap: .4rem;
}
.qset-file-list li {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    padding: .55rem .75rem; border-radius: 12px; background: rgba(255,255,255,.92); color: #0f172a;
}
.qset-file-list em { color: #64748b; font-style: normal; margin-left: .35rem; }
.qset-file-list button {
    border: 0; background: #e2e8f0; color: #0f172a; width: 1.7rem; height: 1.7rem;
    border-radius: 999px; font-weight: 700; line-height: 1;
}
.qset-count-ctrl {
    display: inline-flex; align-items: center; gap: .35rem;
    background: rgba(255,255,255,.96); border-radius: 14px; padding: .25rem;
    width: fit-content;
}
.qset-count-ctrl button {
    width: 2.4rem; height: 2.4rem; border: 0; border-radius: 11px;
    background: #e2e8f0; color: #1B3A6B; font-size: 1.25rem; font-weight: 700;
}
.qset-count-ctrl button:hover { background: #cbd5e1; }
.qset-count-ctrl input {
    width: 3.5rem; text-align: center; font-weight: 800; padding: .45rem .2rem;
    background: transparent; box-shadow: none;
}
.qset-error {
    margin: 1rem 0 0; padding: .7rem .9rem; border-radius: 12px;
    background: #fef2f2; color: #b91c1c; font-weight: 700;
}
.qset-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
    margin-top: 1.2rem;
}
.qset-submit {
    display: inline-flex; align-items: center; gap: .55rem;
    border: 0; border-radius: 999px; padding: .9rem 1.4rem;
    background: #f8fafc; color: #0f172a; font-weight: 800; font-size: 1.05rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
}
.qset-submit:hover { background: #fff; color: #1B3A6B; }
.qset-submit:disabled { opacity: .65; cursor: wait; }
.qset-foot { margin: 0; color: #bfdbfe; font-size: .9rem; max-width: 22rem; }
.qset-busy {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: rgba(15, 39, 68, .72); backdrop-filter: blur(4px);
}
.qset-busy-card {
    text-align: center; padding: 1.5rem 1.75rem; border-radius: 18px;
    background: rgba(255,255,255,.96); color: #0f172a; max-width: 18rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .25);
}
.qset-busy-card p { margin: .35rem 0 0; color: #64748b; }
.qset-busy-spin {
    width: 2.2rem; height: 2.2rem; margin: 0 auto .85rem;
    border-radius: 50%; border: 3px solid #dbeafe; border-top-color: #2E86AB;
    animation: qset-spin .8s linear infinite;
}
@keyframes qset-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
    .qset-create-inner { padding: 1.1rem; }
    .qset-create-head h2 { font-size: 1.3rem; }
}
