/* Secret Agent Theme - Multi-Lesson Portal */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;400;700&display=swap');

.lesson-portal-container {
    font-family: 'Roboto', sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    height: 80vh;
    min-height: 600px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 10px rgba(56, 189, 248, 0.3);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.lesson-portal-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0) 0%, rgba(2, 6, 23, 0.9) 100%);
    pointer-events: none;
    z-index: 1;
}

.lesson-wrapper, #main-menu {
    position: relative;
    z-index: 2;
    padding: 2vh 2vw;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Main Menu */
#main-menu {
    align-items: center;
    justify-content: center;
}

.menu-header h2 {
    font-family: 'Orbitron', sans-serif;
    color: #38bdf8;
    text-transform: uppercase;
    font-size: 2.5rem;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    margin-bottom: 40px;
}

.lesson-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 500px;
}

.lesson-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid #38bdf8;
    color: #fff;
    padding: 20px;
    font-size: 1.2rem;
    font-family: 'Orbitron', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.lesson-btn:hover {
    background: #38bdf8;
    color: #0f172a;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.6);
    transform: scale(1.05);
}

.back-to-menu-btn {
    align-self: flex-start;
    background: transparent;
    border: 1px solid #94a3b8;
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.back-to-menu-btn:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Sections */
.lesson-section {
    display: none;
    animation: fadeIn 0.5s ease-out;
    flex-grow: 1;
    flex-direction: column;
}

.lesson-section.active {
    display: flex;
}

.lesson-section > * {
    flex-shrink: 0;
}

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

/* Phase 1: Drag & Drop / Click Match */
.word-bank-container {
    background: rgba(15, 23, 42, 0.8);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #1e293b;
}

.draggable-words {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.word-card {
    background: #1e293b;
    border: 2px solid #334155;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    font-weight: bold;
    color: #e2e8f0;
}

.word-card:hover {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.word-card.selected {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.8);
    border: 2px solid #fbbf24;
    background: #2563eb;
}

.word-card.matched {
    opacity: 0.5;
    cursor: default;
    border-color: #22c55e;
    background: #166534;
}

.picture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.picture-dropzone {
    background: rgba(30, 41, 59, 0.6);
    border: 2px dashed #475569;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.picture-dropzone.success {
    border-color: #22c55e;
    border-style: solid;
    background: rgba(34, 197, 94, 0.1);
}

.placeholder-img {
    font-size: 3rem;
    margin-bottom: 10px;
}

.drop-area {
    font-size: 0.8rem;
    color: #94a3b8;
    min-height: 24px;
}

/* Phase 1.5: Grouping */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.category-box {
    background: rgba(30, 41, 59, 0.6);
    border: 2px dashed #475569;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    min-height: 150px;
    cursor: pointer;
}

.category-drop {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

/* Phase 2: Reading */
.story-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.6;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.story-box strong {
    color: #38bdf8;
}

/* Phase 3: True / False */
.quiz-container {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.quiz-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #1e293b;
}

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

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.tf-btn {
    background: #1e293b;
    border: 1px solid #475569;
    color: #e2e8f0;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.tf-btn:hover:not(:disabled) {
    background: #334155;
}

.tf-btn.selected-true {
    background: #22c55e;
    border-color: #22c55e;
}

.tf-btn.selected-false {
    background: #ef4444;
    border-color: #ef4444;
}

/* Phase 4: Grammar & Gaps */
.gap-item {
    margin-bottom: 15px;
}

.gap-select, .text-input {
    background: #1e293b;
    border: 1px solid #38bdf8;
    color: #fff;
    padding: 5px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    display: inline-block !important;
    width: auto !important;
    min-width: 100px;
    margin: 0 5px;
}

.gap-select:focus, .text-input:focus {
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.gap-select.correct, .text-input.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.2);
}

.gap-select.incorrect, .text-input.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}

/* Feedback */
.feedback {
    font-size: 0.9rem;
    margin-top: 5px;
    font-weight: bold;
}
.feedback.correct { color: #22c55e; }
.feedback.incorrect { color: #ef4444; }

/* Buttons */
.next-btn {
    background: #38bdf8;
    color: #0f172a;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-family: 'Orbitron', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    align-self: flex-end;
    margin-top: 20px;
    transition: all 0.3s;
    font-weight: bold;
    flex-shrink: 0;
}

.next-btn:hover:not(.btn-disabled) {
    background: #7dd3fc;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.4);
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #475569;
}

/* Success Screen */
.success-screen {
    text-align: center;
    padding: 40px;
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid #22c55e;
    border-radius: 12px;
}

.success-screen h1 {
    color: #22c55e;
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
}

.reward-icon {
    font-size: 5rem;
    margin: 20px 0;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.reset-btn {
    background: transparent;
    border: 2px solid #38bdf8;
    color: #38bdf8;
    padding: 10px 20px;
    font-size: 1.1rem;
    font-family: 'Orbitron', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.reset-btn:hover {
    background: #38bdf8;
    color: #0f172a;
}

/* LESSON 2: Horizontal Layout */
.horizontal-layout {
    display: flex;
    flex-direction: row;
    gap: 2vw;
    width: 100%;
    flex-grow: 1;
}

.reading-paragraphs {
    flex: 3;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(15, 23, 42, 0.6);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #334155;
}

.paragraph-row {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
    background: rgba(30, 41, 59, 0.8);
    padding: 15px;
    border-radius: 8px;
}

.paragraph-row p {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.5;
}

.paragraph-dropzone {
    width: 150px;
    height: 100px;
    background: rgba(15, 23, 42, 0.8);
    border: 2px dashed #475569;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.paragraph-dropzone.success {
    border-color: #22c55e;
    border-style: solid;
}

.paragraph-dropzone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.picture-bank {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(30, 41, 59, 0.4);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #1e293b;
    align-items: center;
}

.picture-card {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.picture-card:hover {
    border-color: #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
    transform: scale(1.05);
}

.picture-card.selected {
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
    transform: scale(1.1);
}

.picture-card.matched {
    opacity: 0.3;
    pointer-events: none;
    border-color: #22c55e;
}

/* Responsive Layout for Vertical/Portrait Screens */
@media (max-width: 800px), (orientation: portrait) {
    .horizontal-layout {
        flex-direction: column;
    }
    
    .picture-bank {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px;
    }
    
    .picture-card {
        width: 100px;
        height: 70px;
    }
    
    .reading-paragraphs {
        overflow-y: auto;
    }

    .lesson-section {
        overflow-y: auto;
        padding-bottom: 20px;
    }
}
