/* ===============================
   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;
}

.hero-spinner {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 60px;
    height: 60px;
    border: 2px solid rgba(147, 51, 234, 0.3);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 3s linear infinite;
}

@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
=================================*/

.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
=================================*/

.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;
}

.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
=================================*/

.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);
}
