.srs-app {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    padding: 15px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.srs-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
    user-select: none;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: relative;
    width: 30px;
    height: 15px;
    background-color: var(--border);
    border-radius: 15px;
    transition: background-color 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 15px;
    width: 15px;
    left: 0;
    top: 0;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.switch input:checked + .slider {
    background-color: var(--accent);
}

.switch input:checked + .slider::before {
    transform: translateX(15px);
}

.srs-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
}

.srs-cards {
    display: flex;
    position: relative;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.card {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 95%;
    height: 95%;
    perspective: 1200px;
}

.card-inner {
    width: 100%;
    height: 100%;
    transition: transform 200ms ease;
    transform-style: preserve-3d;
    position: relative;
}

.card-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    position: absolute;
    inset: 0;
    padding: 10px 10px 15px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 5px 5px 30px 5px rgba(0, 0, 0, 50%);
}

.card-front {
    transform: rotateY(0deg);
}

.card-back {
    transform: rotateY(180deg);
}

.tts-button {
    width: 35px;
    height: 35px;
    padding: 5px;
    border: none;
}

.card-word {
    font-size: 1.5em;
    font-weight: bold;
}

.divider {
    width: 100%;
    height: 1px;
    background-color: var(--border);
}

.card-content {
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    overflow-y: scroll;
    padding: 0 10px;
}

#card-context-front {
    color: var(--muted)
}

#card-meaning {
    font-size: 1.25em;
    font-weight: bold;
}

.field-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-block > .field-label {
    margin-left: 5px;
    color: var(--fg);
    font-size: 1.1em;
    font-weight: bold;
}

.field-block > .field-content {
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 8px;
}

.scrollable {
    max-height: 100px;
    overflow-y: auto;
    white-space: pre-wrap;
}

#card-show {
    width: 330px;
}

.status-buttons {
    display: flex;
    gap: 5px;
}

.status-button, .delete-word-button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    padding: unset;
}

.status-button:hover {
    background: var(--border);
}

.status-button.active {
    color: var(--border);
    font-weight: bold;
}

.status-button.ignored.active {
    background: #a4a4a4;
}

.status-button.learning1.active {
    background: #fae489;
}

.status-button.learning2.active {
    background: #ebea89;
}

.status-button.learning3.active {
    background: #dbef89;
}

.status-button.learning4.active {
    background: #ccf489;
}

.status-button.known.active {
    background: #bcfa89;
}

.delete-word-button:hover {
    color: #6f1a1a;
    background-color: #fa8989;
}

.primary {
    padding: 10px 10px;
    color: var(--fg);
    border: none;
    border-radius: 8px;
}

.ratings {
    display: flex;
    gap: 10px;
}

.rating {
    width: 75px;
    border-radius: 8px;
    border: none;
    color: white;
}

.rating:hover {
    filter: brightness(1.2);
}

.rating-again {
    background-color: var(--danger);
}

.rating-hard {
    background-color: var(--warn);
}

.rating-good {
    background-color: var(--good);
}

.rating-easy {
    background-color: var(--accent);
}

.hidden {
    display: none;
}

.srs-empty {
    text-align: center;
    color: var(--muted);
    font-size: 1.2em;
    padding: 40px 10px;
}

#srs-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-table {
    margin-top: 10px;
    border-collapse: collapse;
    width: 100%;
}
.summary-table th, .summary-table td {
    border: 1px solid var(--border);
    padding: 3px 5px;
    text-align: center;
}
.summary-table th {
    background: var(--card);
}

/* Animations */

.no-flip-transition .card-inner {
    transition: none !important;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.animations-off .card-inner {
    transition: none !important;
}
.animations-off .slide-out-left,
.animations-off .slide-in-right {
    animation: none !important;
}

.slide-out-left {
    animation: slideOutLeft 200ms ease forwards;
}

@keyframes slideOutLeft {
    to {
        transform: translateX(-120%);
        opacity: 0;
    }
}

.slide-in-right {
    animation: slideInRight 200ms ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0
    }
    to {
        transform: translateX(0);
        opacity: 1
    }
}

@media (prefers-reduced-motion: reduce) {
    .card-inner, .slide-out-left, .slide-in-right {
        transition: none;
        animation: none;
        transform: none;
    }
}