/* ===============================
   Flashcards Page Styles
=================================*/

:root{
    --purple: #9333ea;
    --purple2: #a855f7;
}

/* Layout */
.flashcards-container {
    padding-top: 80px;
}

/* ===============================
   HERO SECTION
=================================*/

.flashcards-hero {
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}


@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.flashcards-hero .hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.flashcards-hero .hero-title span {
    background: linear-gradient(135deg, #a855f7, #9333ea, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.flashcards-hero .hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
}


.upload-section {
    padding: 60px 0;
}

.upload-section .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

@media (max-width: 768px) {
    .upload-section .container {
        grid-template-columns: 1fr;
    }
}

/* Upload box */
#upload-box.upload-box {
    border: 2px dashed rgba(168, 85, 247, 0.75);
    border-radius: 18px;
    background: radial-gradient(1200px 800px at 30% 10%, rgba(147, 51, 234, 0.10), transparent 55%),
    rgba(0,0,0,0.12);
    min-height: 520px;
    padding: 5rem 3rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 18px 70px rgba(0,0,0,0.45);
    transition: all 0.3s ease;
    position: relative;
}

#upload-box.upload-box:hover {
    border-color: var(--purple2);
    box-shadow: 0 20px 90px rgba(147, 51, 234, 0.12), 0 18px 70px rgba(0,0,0,0.55);
}

#upload-box.upload-box::before{
    content:"";
    position:absolute;
    inset: 12px;
    border-radius: 14px;
    border: 1px solid rgba(147, 51, 234, 0.10);
    pointer-events:none;
}

.upload-icon-box {
    width: 82px;
    height: 82px;
    margin: 0 auto 2rem;
    border-radius: 18px;
    background: rgba(147, 51, 234, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(147, 51, 234, 0.20);
}

.upload-icon {
    width: 44px;
    height: 44px;
    color: var(--purple2);
}

.upload-box h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.upload-subtitle {
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.upload-formats {
    opacity: 0.6;
    margin-bottom: 2rem;
}

.btn-choose-files {
    border-radius: 999px;
    padding: 0.9rem 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    border: none;
    box-shadow: 0 16px 40px rgba(147, 51, 234, 0.28);
    transition: all 0.2s ease;
}

.btn-choose-files:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 55px rgba(147, 51, 234, 0.34);
}

.settings-panel {
    border-radius: 18px;
    background: radial-gradient(1200px 800px at 70% 0%, rgba(147, 51, 234, 0.10), transparent 55%),
    rgba(0,0,0,0.12);
    border: 1px solid rgba(147, 51, 234, 0.18);
    padding: 2.5rem;
    box-shadow: 0 18px 70px rgba(0,0,0,0.45);
}

.settings-panel h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.select-input {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(147, 51, 234, 0.25);
    background: rgba(0,0,0,0.10);
    margin-bottom: 1.5rem;

    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}


.select-input:hover {
    border-color: var(--purple2);
}

.btn-generate {
    width: 100%;
    border-radius: 999px;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.65), rgba(124, 58, 237, 0.65));
    border: none;
    margin-top: 2rem;
}

.btn-generate:disabled {
    opacity: 0.5;
}

.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Flashcard */
.flashcard-item {
    background: var(--card-bg);
    border: 1px solid rgba(147, 51, 234, 0.15);
    border-radius: 12px;
    perspective: 1000px;
    height: 280px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.flashcard-item:hover {
    box-shadow: 0 12px 32px rgba(147, 51, 234, 0.15);
}

.flashcard-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
}

.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.08), rgba(192, 132, 252, 0.08));
}

.flashcard-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.flashcard-label {
    padding: 0.3rem 0.7rem;
    background: rgba(147, 51, 234, 0.1);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    width: fit-content;
}

.flashcard-text {
    flex: 1;
    margin: 1rem 0;
    line-height: 1.6;
}

.flashcard-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Enhancement */
.flashcard-item:active {
    transform: scale(0.98);
}

.flashcard-item:focus {
    outline: 2px solid rgba(147, 51, 234, 0.6);
}


.fill-blank-card,
.mc-card {
    height: auto;
    min-height: 280px;
    cursor: default;       /* not a flip card */
}

.fill-blank-card:hover,
.mc-card:hover {
    box-shadow: 0 12px 32px rgba(147, 51, 234, 0.15);
}

.fill-blank-card .flashcard-front,
.mc-card .flashcard-front {
    position: relative;
    height: auto;
}

.fill-blank-card .flashcard-content,
.mc-card .flashcard-content {
    height: 100%;
}

/* ---- Fill in the Blank ---- */
.fill-sentence {
    line-height: 1.8;
    font-size: 1rem;
}

.blank-placeholder {
    display: inline-block;
    border-bottom: 2px solid #a855f7;
    min-width: 80px;
    color: transparent;
    margin: 0 4px;
}

.fill-input-row {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    align-items: center;
}

.fill-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.fill-input:focus {
    border-color: #a855f7;
}

.fill-input:disabled {
    opacity: 0.6;
}

.fill-check-btn {
    padding: 8px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    transition: opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.28);
}

.fill-check-btn:hover:not(:disabled) {
    opacity: 0.88;
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.38);
}

.fill-check-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.fill-feedback {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
}

.fill-feedback.correct  { background: rgba(34, 197, 94, 0.15);  color: #22c55e; }
.fill-feedback.incorrect { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.fill-feedback.warning  { background: rgba(234, 179, 8, 0.15);  color: #eab308; }

/* ---- Multiple Choice ---- */
.mc-question {
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.6;
}

.mc-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.mc-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid rgba(147, 51, 234, 0.25);
    background: rgba(0, 0, 0, 0.10);
    color: #ffffff;
    cursor: pointer;
    text-align: left;
    font-size: 0.88rem;
    transition: background 0.15s, border-color 0.15s;
    width: 100%;
}

.mc-option:hover:not(:disabled) {
    background: rgba(147, 51, 234, 0.15);
    border-color: #a855f7;
}

.mc-option:disabled {
    cursor: default;
}

.mc-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(147, 51, 234, 0.2);
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.mc-option.mc-correct {
    background: rgba(34, 197, 94, 0.18);
    border-color: #22c55e;
}

.mc-option.mc-correct .mc-letter {
    background: #22c55e;
    color: #fff;
}

.mc-option.mc-wrong {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.mc-option.mc-wrong .mc-letter {
    background: #ef4444;
    color: #fff;
}

.mc-feedback {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
}

.mc-feedback.correct  { background: rgba(34, 197, 94, 0.15);  color: #22c55e; }
.mc-feedback.incorrect { background: rgba(239, 68, 68, 0.15); color: #ef4444; }