:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-gradient: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    --surface: rgba(255, 255, 255, 0.9);
    --surface-border: rgba(255, 255, 255, 0.5);
    --text: #1e293b;
    --text-light: #64748b;
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    --radius: 20px;
    --font-family: 'Outfit', sans-serif;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-gradient);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#app {
    width: 100%;
    max-width: 600px;
    margin: 2rem 1rem;
}

/* CARDS & SECTIONS */
section {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow);
    animation: fadeIn 0.4s ease-out;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--text);
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #0f172a;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* FORMS */
label {
    display: block;
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: #334155;
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.8rem 1rem;
    margin-top: 0.5rem;
    border: 2px solid transparent;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Radio Group */
label>div {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

label>div label {
    background: #f1f5f9;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    flex: 1;
    justify-content: center;
}

label>div label:has(input:checked) {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}

input[type="radio"] {
    accent-color: var(--primary);
}


/* BUTTONS */
button {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

button:active {
    transform: translateY(0);
}

button#resetBtn {
    background: transparent;
    color: var(--text-light);
    box-shadow: none;
    border: 2px solid #e2e8f0;
    margin-top: 2rem;
}

button#resetBtn:hover {
    border-color: var(--text-light);
    color: var(--text);
    background: white;
}

/* CHECKLIST ITEMS */
.module {
    background: white;
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.item {
    display: flex;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: opacity 0.2s;
}

.item:last-child {
    border-bottom: none;
}

.item:hover {
    opacity: 0.8;
}

.item input {
    appearance: none;
    -webkit-appearance: none;
    width: 1.4rem;
    height: 1.4rem;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    margin-right: 1rem;
    display: grid;
    place-content: center;
    transition: all 0.2s;
}

.item input::before {
    content: "";
    width: 0.8rem;
    height: 0.8rem;
    transform: scale(0);
    transition: 0.12s transform ease-in-out;
    background-color: white;
    border-radius: 2px;
    box-shadow: inset 1em 1em white;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.item input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.item input:checked::before {
    transform: scale(1);
}

.item span {
    font-size: 1.05rem;
    color: #334155;
}

.item input:checked+span {
    text-decoration: line-through;
    color: #94a3b8;
}


/* UTILITIES */
[hidden] {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    #app {
        margin: 1rem 0.5rem;
    }

    section {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }
}

/* PROGRESS BAR */
.controls-bar {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

.progress-container {
    width: 100%;
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

#progressText {
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    margin-top: 0;
}

/* CONTROLS ACTIONS */
.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* TOGGLE SWITCH */
.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
}

.toggle-switch input {
    display: none;
}

.slider {
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    position: relative;
    margin-right: 10px;
    transition: 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.toggle-switch input:checked+.slider {
    background-color: var(--primary);
}

.toggle-switch input:checked+.slider::before {
    transform: translateX(20px);
}

/* SMALL BUTTON */
.small-btn {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: white;
    color: var(--text-light);
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

.small-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: none;
}

/* HIDE COMPLETED LOGIC */
#checklist.hide-completed .item:has(input:checked) {
    display: none;
}

/* Skryje rodičovský modul, pokud jsou všechny jeho děti skryté */
#checklist.hide-completed .module:has(.item:not(:has(input:not(:checked)))) {
    display: none;
}