@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --background: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--background);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15), transparent 25%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

/* Header */
header {
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* Main Container */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 800px;
}

/* Home Page */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.upload-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    transition: transform 0.3s ease;
}

.upload-area {
    width: 100%;
    border: 2px dashed rgba(99, 102, 241, 0.4);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(99, 102, 241, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: var(--primary);
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-subtext {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.quick-prompts {
    width: 100%;
    margin-top: 1rem;
    text-align: left;
}

.section-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.prompts-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.prompt-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompt-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(4px);
}

.prompt-chip input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.prompt-chip span {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.prompt-chip:has(input:checked) {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.file-input {
    display: none;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-typing {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: white;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-typing:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-layout {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-layout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Dashboard Page */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.file-name-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 20px;
    color: #e0e7ff;
    font-size: 0.875rem;
}

/* Tabs */
.tabs-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scaleX(0.5);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

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

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

/* Content Areas */
.content-card {
    padding: 2rem;
    min-height: 400px;
}

/* Summary Content */
.summary-text {
    line-height: 1.8;
    color: var(--text-primary);
}

.summary-text p {
    margin-bottom: 1rem;
}

/* Flashcards */
.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.flashcard {
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.flashcard-front {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.2rem;
}

.flashcard-back {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    transform: rotateY(180deg);
    font-size: 1rem;
    line-height: 1.5;
}

/* Quiz List */
.quiz-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--surface-border);
}

.quiz-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.quiz-question {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.quiz-option input[type="radio"] {
    accent-color: var(--primary);
    width: 1.2rem;
    height: 1.2rem;
}

/* Animations */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* Spin animation for loading icon */
.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

    to {
        transform: rotate(360deg);
    }
}

/* Drag-over state */
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Quiz correct answer highlight */
.quiz-correct {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: var(--primary) !important;
    color: var(--text-primary);
}

/* Flashcard TERM / DEFINITION label */
.flash-label {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.flashcard-front,
.flashcard-back {
    flex-direction: column;
    gap: 0.5rem;
}

/* Button loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Quiz card border override */
.quiz-card {
    border-radius: 16px !important;
}

/* Stopwatch UI */
.stopwatch-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--surface-border);
    padding: 0.5rem 1rem;
    border-radius: 12px;
}

.stopwatch-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stopwatch-time {
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 85px;
    text-align: center;
}

.stopwatch-controls {
    display: flex;
    gap: 0.5rem;
}

.stopwatch-btn {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stopwatch-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: var(--primary);
}