:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --background-color: #f4f7f6;
    --card-background: #ffffff;
    --text-color: #333333;
    --muted-color: #777777;
    --border-color: #dddddd;
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --hilfe-bg: #eef;
    --hilfe-text: #555;
    --progress-container-bg: #e0e0e0;

    --correct-color: #28a745;
    --incorrect-color: #dc3545;
    --correct-bg: #e9f7ef;
    --incorrect-bg: #fce8e6;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    ;
}


@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #4256FF;
        --secondary-color: #201C8C;
        --background-color: #0A092D;
        --card-background: #2E3855;
        --text-color: #e6eef8;
        --muted-color: #949BB4;
        --border-color: #586280;
        --card-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
        --hilfe-bg: rgba(91, 99, 222, 0.15);
        --hilfe-text: #a5b4fc;
        --progress-container-bg: #374151;

        --correct-color: #16AF79;
        --incorrect-color: #CC4F00;
        --correct-bg: rgba(52, 211, 153, 0.1);
        --incorrect-bg: rgba(255, 107, 107, 0.1);

    }
}

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

#app {
    width: 100%;
    max-width: 600px;
    margin: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: var(--primary-color);
}

.filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.filters input,
.filters button {
    padding: 10px;
    border-radius: 5px;
    border: 2px solid var(--border-color);
    font-size: 16px;
    background-color: var(--card-background);
    color: var(--text-color);
}

.quiz-card {
    background: transparent;
    padding: 30px 30px 25px 30px;
    border-radius: 35px;
    box-shadow: none;
    text-align: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (max-width: 775px) {
    .quiz-card {
        background-color: transparent;
        box-shadow: none;
    }
}

.verb-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: -10px;
}

.repetition-tag {
    display: none;
    background-color: #FFCD20;
    color: #000;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    transform: translateY(-20px);
}

.verb-info .grundform {
    font-style: italic;
    font-size: 1rem;
    color: var(--muted-color);
    margin-bottom: 15px;
    margin-top: 0px;
    opacity: 0;
    transition: all 0.3s ease;
}

.verb-info .grundform.show {
    opacity: 1;
}

.hilfe {
    background-color: var(--hilfe-bg);
    color: var(--hilfe-text);
    border-radius: 12px;
    font-size: 14px;
    overflow: hidden;
    opacity: 0;
    max-height: 0;
    padding: 0 10px;
    margin: 0;
    transition: all 0.4s ease-in-out;
    display: inline-flex;
    align-items: baseline;
}

.hilfe.visible {
    opacity: 1;
    max-height: 100px;
    padding: 10px;
    margin: 15px 0;
}

.hilfe .icon {
    width: auto;
    vertical-align: baseline;
    display: inline-block;
    position: relative;
    top: 2px;
    margin-right: 5px;
}

.hilfe strong {
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
}


.conjugation-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
    margin: 20px 0;
    text-align: left;
}

.conjugation-item {
    display: flex;
    align-items: center;
    position: relative;
}

.conjugation-item label {
    text-align: right;
    margin-right: 25px;
    width: 100px;
    font-weight: bold;
    color: var(--text-color);
    text-transform: uppercase;
}

.conjugation-item input {
    flex: 1;
    padding: 11px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: border-color 0.3s, background-color 0.3s;
    background-color: var(--card-background);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 16px;
}

.conjugation-item input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.conjugation-item input.correct {
    border-color: var(--correct-color);
    background-color: var(--correct-bg);
}

.conjugation-item input.incorrect {
    border-color: var(--incorrect-color);
    background-color: var(--incorrect-bg);
    color: var(--incorrect-color);
    font-weight: bold;
}

.solution {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    height: 41px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-color);
    background-color: var(--incorrect-bg);
    pointer-events: none;
    padding-right: 16px;
    padding-left: 5px;
    border-radius: 0px 8px 8px 0px;
    transition: all 0.3s;
}


.button {
    margin-top: 30px;
    margin-left: auto;
    width: 150px;
    padding: 12px 12px;
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    background: var(--primary-color);
    transition: opacity 0.3s;
    font-family: var(--font-family);
    font-weight: 500;
    border: none !important;
    outline: none !important;
    display: inline-flex;
    align-items: baseline;
    gap: .4ch;
}

.button:hover {
    opacity: 0.8;
}

.button:focus-visible {
    border: none !important;
    outline: none !important;
}

#next-btn {
    display: none;
}

#check-btn {
    opacity: 0;
    pointer-events: none;
}

@media only screen and (max-width: 800px) {
    #check-btn {
        opacity: 1 !important;
        pointer-events: auto;
    }
}

.button .icon {
    vertical-align: text-bottom;
    width: auto;
    position: relative;
    bottom: 1px;
}


footer {
    margin-top: 20px;
    text-align: center;
}

.progress-container {
    padding: 5px;
    position: fixed;
    top: 10px;
    left: 50%;
    width: 90%;
    max-width: 600px;
    transform: translateX(-50%);
    z-index: 300;
}


.progress-bar-container {
    background-color: var(--progress-container-bg);
    border-radius: 50px;
    overflow: hidden;
}

.progress-bar-inner {
    background-color: var(--correct-color);
    height: 15px;
    width: 0%;
    border-radius: 50px;
    transition: width 0.5s ease-in-out;
}

.stats-container {
    padding-top: 100px;
    padding-left: 50px;
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 1;
    margin-top: 10px;
    font-size: 14px;
    color: var(--muted-color);
    transition: all 0.5s ease;
    opacity: 0.5;

}

.stats-container:hover {
    color: var(--text-color);
}

.stats-divider {
    margin: 0 10px;
}

.quiz-card.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.quiz-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.quiz-card.shake {
    animation: shake 0.5s ease-in-out;
}

.conjugation-item.shake {
    animation: shake-item 0.4s ease-in-out;
}

@keyframes shake-item {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    50%,
    90% {
        transform: translateX(-4px);
    }

    30%,
    70% {
        transform: translateX(4px);
    }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) translateX(var(--drift)) rotate(720deg);
        opacity: 0;
    }
}

.navigation-disclaimer {
    padding-top: 100px;
    padding-right: 50px;
    position: fixed;
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 1;
    font-size: 14px;
    color: var(--muted-color);
    transition: all 0.5s ease;
    margin-bottom: 0px;
    opacity: 0.5;
}

@media (max-width: 815px) {
    .navigation-disclaimer {
        display: none;
    }

    .stats-container {
        left: 10px;
        right: auto;
        padding-left: 0px;
        padding-top: 0px;
    }
}

.navigation-disclaimer:hover {
    color: var(--text-color);
}

.navigation-disclaimer svg {
    position: relative;
    top: 3px;
    transition: all 0.5s ease;
    stroke: var(--muted-color);

}

.navigation-disclaimer:hover svg {
    stroke: var(--text-color);
}

#completion-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.progress-circle-container {
    position: relative;
    margin: 20px 0;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.8s ease-out;
    stroke-linecap: round;
}

.progress-ring__circle-bg {
    stroke: #eee;
}

.percentage-text {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
}

#restart-btn {
    margin-top: 20px;
    padding: 12px 25px 15px 25px;
    font-size: 16px;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-family: var(--font-family);
    font-weight: 500;
}

#restart-btn:hover {
    opacity: 0.8;
}

#restart-btn svg {
    position: relative;
    top: 3px;
    margin-right: 5px;
}


.back-to-lists-top-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    background-color: transparent;
    border: none;
    border-radius: 25px;
    padding: 8px 15px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    color: var(--text-color);
    transition: opacity 0.3s ease, transform 0.2s ease;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 1.1rem;
    opacity: 0;
    pointer-events: none;
}


.back-to-lists-top-btn svg {
    transition: all 0.3 ease;
}


.back-to-lists-top-btn:hover svg {
    opacity: 0.6;

}

.back-to-lists-top-btn svg {
    width: 20px;
    height: 20px;
}

.settings-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: var(--text-color);
    transition: transform 0.2s ease;
}

@media (max-width: 829px) {
    .settings-btn {
        top: 40px;
    }
}

.settings-btn:hover {
    transform: rotate(45deg);
}

.modal {
    display: none;
    opacity: 0;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.32);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--card-background);
    margin: 15% auto;
    padding: 25px 30px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 500px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation-duration: 0.3s;
    animation-timing-function: ease;
}

.modal.show .modal-content {
    animation-name: slideIn;
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-30px);
        opacity: 0;
    }
}

.modal.hide .modal-content {
    animation-name: slideOut;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

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

.close-btn {
    color: var(--muted-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.2s;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
}

.range-slider-container {
    padding: 20px 0;
}

.range-slider {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
}

.slider-track,
.slider-range-fill {
    position: absolute;
    height: 6px;
    border-radius: 3px;
    width: 100%;
    left: 0;
}

.slider-track {
    background-color: var(--border-color);
    z-index: 1;
}

.slider-range-fill {
    background-color: var(--secondary-color);
    z-index: 2;
}

.range-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    pointer-events: none;
    margin: 0;
    z-index: 3;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: all;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
    box-shadow: none;
}

.range-slider input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: none;
}

.range-values {
    margin-top: 15px;
    font-size: 18px;
    color: var(--text-color);
}

.apply-button {
    margin-top: 30px;
    margin-left: auto;
    padding: 10px 24px 12px 24px;
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    background: var(--secondary-color);
    transition: opacity 0.3s;
    font-family: var(--font-family);
    font-weight: 500;
    border: none !important;
    outline: none !important;
    display: inline-flex;
    align-items: baseline;
}

.apply-button svg {
    position: relative;
    top: 3px;
    margin-left: 8px;
}

.apply-button:hover {
    opacity: 0.8;
}

.apply-button:focus-visible {
    border: none !important;
    outline: none !important;
}

/* List Selection Screen Styles */
.list-selection-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    padding: 0px;
    background-color: var(--background-color);
    opacity: 1;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#list-selection-screen > h1 {
    color: var(--muted-color);
    opacity: 0.5;
    font-family: monospace !important;
    margin-bottom: 30px;
    font-size: 2rem;
    text-align: center;
    width: 100%;
    display: block;
    clear: both;
}

/* Force vertical stacking of title and container */
#list-selection-screen > h1,
#list-selection-screen > .list-selection-container {
    display: block;
    float: none;
    position: relative;
}


.list-selection-screen.transitioning-in {
    opacity: 0;
}

.list-selection-screen.transitioning-out {
    opacity: 0;
}

.list-selection-container {
    max-width: 800px;
    width: 100%;
    text-align: center;
    display: block;
    clear: both;
    margin: 0 auto;
}

.list-selection-container h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2.5rem;
    animation: titleFadeIn 0.5s ease forwards;
}

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

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

.list-selection-container .subtitle {
    color: var(--muted-color);
    font-size: 1.1rem;
    margin-bottom: 40px;
    margin-top: 0;
    animation: subtitleFadeIn 0.6s ease forwards;
}

@keyframes subtitleFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

.list-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 60px;
    margin-top: 20px;
    justify-content: center;
    clear: both;
    width: 100%;
}

.list-card {
    background-color: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    z-index: 1;
    overflow: visible;
    animation: cardFadeIn 0.4s ease forwards;
    opacity: 0;
    transform: translateY(20px);
    min-height: 150px;
}

.list-card {
    background-color: transparent;
    border: none;
    padding: 30px;
    text-align: left;
    max-width: 400px;
    width: 90%;
    cursor: pointer;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardFadeIn 0.4s ease forwards;
    opacity: 0;
    transform: translateY(20px);
    z-index: 1;
}

.list-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background-color: var(--card-background);
    border: 2px solid var(--border-color);
    z-index: -1;
    transition: none;
}

.list-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background-color: var(--card-background);
    border: 2px solid var(--border-color);
    z-index: -2;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.list-card:hover::before {
    transform: rotate(4deg) translate(4px, 2px);
}


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


.list-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.list-card:active {
    transform: scale(0.98);
}

.list-card h3 {
    color: var(--text-color);
    margin: 0;
    font-size: 1.5rem;
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1;
    transition: color 0.25s ease;
}

.list-card p {
    color: var(--muted-color);
    margin-bottom: 20px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.verb-count-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: var(--text-color);
    opacity: 0.6;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 2;
    transition: transform 0.25s ease;
}

.back-to-lists-btn {
    margin-top: 15px;
    margin-left: 10px;
    padding: 12px 25px 15px 25px;
    font-size: 16px;
    cursor: pointer;
    background-color: var(--muted-color);
    color: white;
    border: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-family: var(--font-family);
    font-weight: 500;
}

.back-to-lists-btn:hover {
    opacity: 0.8;
}

.back-to-lists-btn svg {
    position: relative;
    top: 3px;
    margin-right: 5px;
}

@media (max-width: 768px) {
    .list-selection-container {
        padding: 0px;
        justify-content: center;
        align-items: center;
        min-height: 60vh;
    }

    .list-selection-container h1 {
        font-size: 2rem;
    }

    .list-cards-container {
        gap: 40px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: none;
        min-height: 400px;
    }

    .list-card {
        padding: 20px;
        max-width: 90% !important;
        width: 90% !important;
        margin: 0 auto;
        box-sizing: border-box;
        text-align: center;
        border-radius: 20px;
    }

    .back-to-lists-top-btn {
        top: 50px;
    }
}