
.flashcards-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-dark);
    z-index: 1500;
    overflow-y: auto;
    padding: 40px 0;
    box-sizing: border-box;
}

.flashcards-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flashcards-container {
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    perspective: 1000px;
}

.flashcards-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
}

.flashcards-title {
    font-size: 1.3em;
    font-weight: 700;
}

.btn-close-flashcards {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-close-flashcards:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}


.flashcard-wrapper {
    width: 100%;
    height: 300px;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.flashcard-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flashcard-wrapper.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-wrapper.no-transition .flashcard-inner {
    transition: none !important;
}

.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.flashcard-front {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    color: var(--text-light);
}

.flashcard-back {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15), rgba(var(--primary-rgb), 0.03));
    color: var(--text-light);
    transform: rotateY(180deg);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.flashcard-label {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 700;
}

.flashcard-text {
    font-size: 2em;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
}


.flashcards-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.btn-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-control:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-control:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-control-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.progress-text {
    font-size: 0.9em;
    color: var(--text-muted);
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

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




@keyframes slideOutLeft {
    to {
        opacity: 0;
        transform: translateX(-100px) rotateY(-10deg);
    }
}
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px) rotateY(10deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotateY(0);
    }
}

@keyframes slideOutRight {
    to {
        opacity: 0;
        transform: translateX(100px) rotateY(10deg);
    }
}
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px) rotateY(-10deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotateY(0);
    }
}

.card-slide-out-left {
    animation: slideOutLeft 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}
.card-slide-in-right {
    animation: slideInRight 0.25s cubic-bezier(0, 0, 0.2, 1) forwards;
}

.card-slide-out-right {
    animation: slideOutRight 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}
.card-slide-in-left {
    animation: slideInLeft 0.25s cubic-bezier(0, 0, 0.2, 1) forwards;
}

.btn-flashcard-star {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-flashcard-star:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.btn-flashcard-star.starred {
    color: #ffca28;
}


.fc-settings-panel {
    display: flex;
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    background: rgba(22, 22, 30, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 18px;
    box-sizing: border-box;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    flex-direction: column;
    gap: 16px;
    max-height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    opacity: 0;
    transform: scale(0);
    transform-origin: calc(100% - 60px) 0px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, visibility 0.3s;
}

.fc-settings-panel::-webkit-scrollbar {
    width: 6px;
}

.fc-settings-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.fc-settings-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.fc-settings-panel::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.fc-settings-panel.active {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transform: scale(1);
}

.fc-settings-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.fc-setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.fc-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.fc-setting-label {
    cursor: pointer;
    color: var(--text-light);
    font-weight: 500;
}

.fc-setting-description {
    font-size: 0.85em;
    color: var(--text-muted);
}

.fc-warning-text {
    font-size: 0.85em;
    color: #ef4444;
    font-weight: 500;
    display: none;
    margin-top: 4px;
}

.fc-settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    width: 100%;
}

.fc-settings-actions button {
    flex: 1;
}


.fc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.fc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.fc-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fc-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-light);
    transition: .3s;
    border-radius: 50%;
}

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

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

.btn-flashcard-speak {
    position: absolute;
    top: 20px;
    right: 70px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-flashcard-speak:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
    color: var(--primary);
}

