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

:root {
    --primary: #0891b2;
    --primary-light: #22d3ee;
    --primary-dark: #0e7490;
    --primary-glow: rgba(8, 145, 178, 0.25);
    --accent: #f43f5e;
    --accent-glow: rgba(244, 63, 94, 0.3);
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.08);
    --radius: 14px;
    --radius-sm: 8px;
    --radius-full: 999px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --primary: #22d3ee;
    --primary-light: #67e8f9;
    --primary-dark: #0891b2;
    --primary-glow: rgba(34, 211, 238, 0.3);
    --accent: #fb7185;
    --accent-glow: rgba(251, 113, 133, 0.35);
    --success: #34d399;
    --success-light: #064e3b;
    --danger: #f87171;
    --danger-light: #7f1d1d;
    --warning: #fbbf24;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border: #334155;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 1px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .page-title {
    background: linear-gradient(180deg, #1e293b 0%, var(--bg) 100%);
}

[data-theme="dark"] .cheklist__item .card-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .qestions__item:hover {
    background: #1e293b;
}

[data-theme="dark"] .qestions__item:active {
    background: #0f172a;
}

[data-theme="dark"] .cardQestions .dragging {
    background: #0f172a;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #1e293b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

ul, ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

li {
    padding: 0;
    margin: 0;
}

p, h1 {
    margin: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ===== Page header ===== */

.page-title {
    background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    padding: 32px 16px 8px;
    position: relative;
}

.page-title-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

.main-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.main-subtitle {
    font-size: 0.92rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 28px;
}

/* ===== About button ===== */

.btn-about {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-tertiary);
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    line-height: 1;
}

.btn-about:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    transform: scale(1.1) rotate(-8deg);
}

/* ===== Theme toggle ===== */

.title-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 6px;
}

.btn-theme {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-tertiary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    line-height: 1;
}

.btn-theme:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    transform: scale(1.1);
}

/* ===== Glass header ===== */

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 24px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    margin-bottom: 32px;
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.06) 0%, rgba(244, 63, 94, 0.04) 100%);
    pointer-events: none;
}

.header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    pointer-events: none;
}

.cheklist-title {
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    position: relative;
    letter-spacing: -0.02em;
}

.cheklist-subtitle {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 400;
    text-align: center;
    margin-top: 8px;
    line-height: 1.6;
    position: relative;
    max-width: 600px;
}

/* ===== Checklist cards grid ===== */

.cheklistCollection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.cheklist__item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: cardFadeIn 0.4s ease-out both;
    display: flex;
    flex-direction: column;
    min-height: 140px;
}

.cheklist__item:nth-child(1) { animation-delay: 0.02s; }
.cheklist__item:nth-child(2) { animation-delay: 0.06s; }
.cheklist__item:nth-child(3) { animation-delay: 0.10s; }
.cheklist__item:nth-child(4) { animation-delay: 0.14s; }
.cheklist__item:nth-child(5) { animation-delay: 0.18s; }
.cheklist__item:nth-child(6) { animation-delay: 0.22s; }
.cheklist__item:nth-child(7) { animation-delay: 0.26s; }
.cheklist__item:nth-child(8) { animation-delay: 0.30s; }
.cheklist__item:nth-child(9) { animation-delay: 0.34s; }
.cheklist__item:nth-child(10) { animation-delay: 0.38s; }
.cheklist__item:nth-child(11) { animation-delay: 0.42s; }
.cheklist__item:nth-child(12) { animation-delay: 0.46s; }
.cheklist__item:nth-child(13) { animation-delay: 0.50s; }
.cheklist__item:nth-child(14) { animation-delay: 0.54s; }
.cheklist__item:nth-child(15) { animation-delay: 0.58s; }
.cheklist__item:nth-child(16) { animation-delay: 0.62s; }
.cheklist__item:nth-child(17) { animation-delay: 0.66s; }
.cheklist__item:nth-child(18) { animation-delay: 0.70s; }
.cheklist__item:nth-child(19) { animation-delay: 0.74s; }
.cheklist__item:nth-child(20) { animation-delay: 0.78s; }
.cheklist__item:nth-child(21) { animation-delay: 0.82s; }
.cheklist__item:nth-child(22) { animation-delay: 0.86s; }
.cheklist__item:nth-child(23) { animation-delay: 0.90s; }
.cheklist__item:nth-child(24) { animation-delay: 0.94s; }
.cheklist__item:nth-child(25) { animation-delay: 0.98s; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cheklist__item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.cheklist__item:active {
    transform: translateY(-1px) scale(0.99);
    box-shadow: var(--shadow-md);
}

.cheklist__item .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--primary);
    padding: 14px 18px;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.badge-new {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent) 0%, #e11d48 100%);
    color: #fff;
    line-height: 1.4;
    flex-shrink: 0;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.cheklist__item .card-body {
    padding: 16px 18px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1;
}

.cheklist__item .card-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

.card-arrow {
    font-size: 1.1rem;
    color: var(--border);
    transition: all var(--transition);
    flex-shrink: 0;
}

.cheklist__item:hover .card-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

/* ===== Questions list ===== */

.cardQestions.list-group-numbered {
    margin-bottom: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    counter-reset: list-counter;
}

.cardQestions--inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cardQestions .qestions__item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary-light);
    padding: 14px 18px;
    cursor: grab;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text);
    transition: all var(--transition);
    user-select: none;
    display: flex;
    align-items: center;
    gap: 12px;
    counter-increment: list-counter;
}

.cardQestions .qestions__item::before {
    content: counter(list-counter) ".";
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 24px;
    flex-shrink: 0;
}

.cardQestions .qestions__item:hover {
    background: #f8fafc;
    border-color: var(--primary);
    border-left-color: var(--primary);
}

.cardQestions .qestions__item:active {
    cursor: grabbing;
    background: #f0fdfa;
    border-left-color: var(--primary);
}

.cardQestions .dragging {
    opacity: 0.6;
    border-style: dashed;
    border-color: var(--primary);
    background: #ecfeff;
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* ===== Controls ===== */

.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0 16px;
    flex-wrap: wrap;
}

.controls .btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 10px 28px;
    border-radius: var(--radius-full);
    border: none;
    transition: all var(--transition);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border) !important;
}

.btn-secondary:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    color: #fff;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
    color: #fff !important;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

/* ===== Succes / Falure states ===== */

.succes {
    background: var(--success-light) !important;
    border-left-color: var(--success) !important;
    border-color: var(--success) !important;
}

.succes::before {
    color: var(--success) !important;
}

.succes::after {
    content: '✓';
    color: var(--success);
    font-weight: 700;
    margin-left: auto;
    flex-shrink: 0;
}

.falure {
    background: var(--danger-light) !important;
    border-left-color: var(--danger) !important;
    border-color: var(--danger) !important;
}

.falure::before {
    color: var(--danger) !important;
}

.falure::after {
    content: '✗';
    color: var(--danger);
    font-weight: 700;
    margin-left: auto;
    flex-shrink: 0;
}

/* ===== Modals ===== */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(16px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-body {
    margin-bottom: 24px;
}

.stats-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.stats-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.stats-details {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.stats-details .correct {
    color: var(--success);
    font-weight: 600;
}

.stats-details .wrong {
    color: var(--danger);
    font-weight: 600;
}

.modal-btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px 36px;
    border-radius: var(--radius-full);
    border: none;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--primary-glow);
}

/* ===== About modal ===== */

.about-content {
    text-align: center;
    padding: 40px 32px 32px;
}

.about-logo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin-bottom: 16px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 0 4px var(--border-light), var(--shadow-md);
}

.about-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.about-year {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

/* ===== Utility ===== */

.visible {
    display: none;
}

/* ===== Responsive ===== */

@media (max-width: 640px) {
    .container {
        padding: 12px 8px;
    }

    .page-title {
        padding: 24px 12px 4px;
    }

    .main-title {
        font-size: 1.6rem;
    }

    .header {
        padding: 20px 16px;
        border-radius: var(--radius-sm);
    }

    .cheklist-title {
        font-size: 1.2rem;
    }

    .cheklist-subtitle {
        font-size: 0.78rem;
    }

    .cheklistCollection {
        grid-template-columns: 1fr;
    }

    .cardQestions .qestions__item {
        font-size: 0.8rem;
        padding: 12px 14px;
    }

    .cardQestions .qestions__item::before {
        min-width: 20px;
        font-size: 0.7rem;
    }

    .controls .btn {
        font-size: 0.75rem;
        padding: 8px 20px;
    }

    .title-actions {
        top: 0;
        right: 10px;
        gap: 4px;
    }

    .btn-about,
    .btn-theme {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .controls .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
