:root {
    --cream: #fff9ed; 
    --brown: #554636; 
    --light-brown: #8a7b6c;
    --green-correct: #27ae60; 
    --red-wrong: #e74c3c; 
    --white: #FFFFFF;
    --font-size-base: 22px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

::-webkit-scrollbar { width: 14px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { 
    background: var(--light-brown); 
    border-radius: 10px; 
    border: 3px solid var(--cream); 
}
::-webkit-scrollbar-thumb:hover { background: var(--brown); }

html, body {
    max-width: 100vw;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--cream);
    color: var(--brown);
    font-size: var(--font-size-base);
}

.header {
    background-color: var(--cream);
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--brown);
}

.logo-img { height: 70px; object-fit: contain; }

#app-root {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--cream);
}

.home-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10vh;
    background: rgba(255, 249, 237, 0.85);
    padding-bottom: 50px;
    flex: 1 0 auto;
}

.home-buttons {
    display: flex;
    gap: 40px;
    margin-bottom: 50px;
    max-width: 1200px;
    padding: 0 20px;
    width: 100%;
    justify-content: center;
}

.btn-home-main {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: var(--cream);
    border: 4px solid var(--brown);
    border-radius: 20px;
    padding: 30px 40px;
    font-size: 28px;
    font-weight: bold;
    color: var(--brown);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.2s ease;
    width: 250px;
    box-shadow: 0 6px 0 var(--brown);
}

.btn-home-main:hover {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--brown);
    background: #fdf2de;
}

.inner-view {
    width: 100%;
    display: flex;
    flex: 1 0 auto;
}

.sidebar { width: 20%; position: relative; }

.btn-back {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: absolute;
    top: 40px;
    left: 0;
    background: var(--cream);
    color: var(--brown);
    border: 3px solid var(--brown);
    border-left: none;
    border-radius: 0 40px 40px 0;
    padding: 15px 30px 15px 20px;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 4px 4px 0 rgba(85, 70, 54, 0.2);
    transition: background 0.2s;
}

.btn-back:hover { background: #f5eedc; }

.content-area {
    width: 80%;
    background: var(--cream);
    padding: 40px 10%;
    flex: 1 0 auto;
    box-shadow: -5px 0 15px rgba(0,0,0,0.05);
}

.tabs-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.tab {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: var(--cream);
    color: var(--brown);
    border: 3px solid var(--brown);
    border-radius: 12px;
    padding: 15px 35px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 0 var(--brown);
}

.tab:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--brown);
}

.tab.active {
    background: var(--brown);
    color: var(--white);
    transform: translateY(4px);
    box-shadow: none;
    border-color: var(--brown);
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.card {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: var(--brown);
    color: var(--white);
    border-radius: 16px;
    padding: 30px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 140px;
    transition: transform 0.2s, background 0.2s;
    text-align: left;
    border: 4px solid transparent;
    overflow: hidden;
}

.card:hover { 
    transform: scale(1.02); 
    background: #46392c;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1; 
    min-width: 0; 
    padding-right: 15px;
}

.card-title {
    line-height: 1.4;
    word-wrap: break-word;
}

.card-arrow {
    font-size: 40px;
    color: var(--cream);
    opacity: 0.8;
    flex-shrink: 0;
}

.test-score-badge {
    font-size: 18px;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    display: inline-block;
    width: max-content;
    max-width: 100%;
    word-wrap: break-word;
    white-space: normal;
}

.lesson-title { background: var(--brown); color: var(--white); padding: 25px 40px; border-radius: 16px; margin-bottom: 40px; font-size: 30px; line-height: 1.3; word-wrap: break-word; }
.lesson-text p { margin-bottom: 25px; line-height: 1.6; font-size: 24px; word-wrap: break-word; }
.lesson-image-wrapper { margin-bottom: 30px; text-align: center; }
.lesson-image { max-width: 100%; border-radius: 10px; border: 2px solid var(--brown); }
.lesson-image-placeholder { width: 100%; height: 300px; background-color: rgba(85, 70, 54, 0.05); border: 3px dashed var(--brown); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--brown); font-size: 22px; margin-bottom: 30px; font-weight: bold; text-align: center; padding: 20px;}
.image-caption { font-size: 20px; color: var(--light-brown); margin-top: 10px; word-wrap: break-word; }
.lesson-video-placeholder { width: 100%; aspect-ratio: 16 / 9; background-color: var(--brown); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--white); font-size: 26px; margin-bottom: 30px; cursor: pointer; text-align: center; padding: 20px;}
.lesson-video-placeholder .play-icon { font-size: 70px; margin-bottom: 15px; }
.lesson-video iframe { width: 100%; aspect-ratio: 16 / 9; border: none; border-radius: 10px; margin-bottom: 30px; border: 4px solid var(--brown); }
.lesson-link { display: inline-flex; align-items: center; gap: 10px; color: var(--brown); font-weight: bold; font-size: 24px; margin-top: 10px; margin-bottom: 20px; text-decoration: underline; word-break: break-word; background: rgba(85, 70, 54, 0.1); padding: 15px 25px; border-radius: 10px; max-width: 100%; }

.test-container { background: var(--cream); border: 4px solid var(--brown); color: var(--brown); padding: 40px; border-radius: 20px; max-width: 100%; }
.test-header { background: var(--brown); color: var(--white); text-align: center; padding: 20px; border-radius: 12px; font-size: 30px; margin-bottom: 40px; font-weight: bold; word-wrap: break-word; }
.question-block { margin-bottom: 50px; background: rgba(85, 70, 54, 0.05); padding: 25px; border-radius: 16px; border: 2px solid rgba(85, 70, 54, 0.2); }
.question-title { font-size: 26px; font-weight: bold; margin-bottom: 25px; line-height: 1.4; word-wrap: break-word; }

.option-label { 
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex; align-items: flex-start; margin-bottom: 15px; cursor: pointer; font-size: 24px; padding: 20px 25px; border-radius: 12px; background: var(--white); border: 3px solid var(--brown); font-weight: bold; transition: 0.2s; box-shadow: 0 4px 0 rgba(85, 70, 54, 0.2); word-wrap: break-word; 
}
.option-label:hover { transform: translateY(2px); box-shadow: 0 2px 0 rgba(85, 70, 54, 0.2); background: #fdf2de; }

.option-label input { transform: scale(1.5); margin-right: 15px; margin-top: 8px; cursor: pointer; flex-shrink: 0; }

.option-label.correct { background: var(--green-correct); color: var(--white); border-color: var(--green-correct); box-shadow: none; transform: translateY(4px); }
.option-label.correct::after { content: ' ✓'; margin-left: 10px; font-size: 28px; }

.option-label.wrong { background: var(--red-wrong); color: var(--white); border-color: var(--red-wrong); text-decoration: line-through; box-shadow: none; transform: translateY(4px); }
.option-label.wrong::after { content: ' ✗'; margin-left: 10px; font-size: 28px; text-decoration: none; display: inline-block; }

.btn-action { 
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: block; margin: 40px auto 0; background: var(--brown); color: var(--white); border: none; border-radius: 12px; padding: 20px 60px; font-size: 28px; font-weight: bold; cursor: pointer; transition: 0.2s; box-shadow: 0 6px 0 rgba(0,0,0,0.3); max-width: 100%; word-wrap: break-word; 
}
.btn-action:hover { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,0.3); }

.test-result-box { text-align: center; margin-top: 40px; font-size: 28px; font-weight: bold; padding: 30px; border-radius: 16px; border: 4px solid var(--brown); background: var(--white); word-wrap: break-word; }

.links-list { font-size: 26px; line-height: 1.5; display: flex; flex-direction: column; gap: 15px; padding: 0; }
.links-list li { background: rgba(85, 70, 54, 0.05); padding: 15px 25px; border-radius: 12px; border-left: 6px solid var(--brown); }
.links-list a { color: var(--brown); text-decoration: none; font-weight: bold; display: block; word-wrap: break-word; }
.links-list a:hover { text-decoration: underline; }

.footer { 
    flex-shrink: 0; 
    background: var(--brown); 
    color: var(--white); 
    padding: 30px 40px; 
    display: flex; 
    justify-content: space-between; 
    font-size: 20px; 
    line-height: 1.5;
    position: relative;
    z-index: 10;
}
.footer a { color: var(--white); font-weight: bold; }
.text-right { text-align: right; }

@media (max-width: 1024px) {
    .inner-view { flex-direction: column; }
    .sidebar { width: 100%; background: transparent; padding: 20px 15px 0; }
    .btn-back { position: relative; top: 0; display: inline-flex; border-left: 3px solid var(--brown); border-radius: 12px; box-shadow: 0 4px 0 var(--brown); }
    .content-area { width: 100%; padding: 30px 20px 50px; }
    .cards-grid { gap: 20px; }
}

@media (max-width: 768px) {
    .header { padding: 15px; justify-content: center; }
    .logo-img { height: 50px; } 
    
    .home-buttons { flex-direction: column; width: 100%; gap: 15px; padding: 0 15px; }
    .btn-home-main { width: 100%; flex-direction: row; justify-content: flex-start; padding: 20px; font-size: 22px; }
    .btn-home-main span { font-size: 32px !important; margin-right: 15px; }
    
    .tabs-wrapper { flex-direction: column; gap: 12px; align-items: stretch; margin-bottom: 30px; }
    .tab { width: 100%; text-align: center; padding: 15px; font-size: 20px; }
    
    .content-area { padding: 20px 15px 60px; }

    .cards-grid { grid-template-columns: 1fr; gap: 15px; }
    .card { padding: 20px 15px; min-height: auto; }
    .card-title { font-size: 20px; }
    .card-arrow { font-size: 30px; }
    .test-score-badge { font-size: 16px; padding: 6px 12px; }
    
    .lesson-title { font-size: 24px; padding: 15px 20px; margin-bottom: 25px; }
    .lesson-text p { font-size: 18px; margin-bottom: 15px; }
    .lesson-link { font-size: 18px; padding: 12px 15px; flex-direction: column; align-items: flex-start; }
    .lesson-video-placeholder, .lesson-image-placeholder { height: 200px; font-size: 18px; }
    .lesson-video-placeholder .play-icon { font-size: 50px; }

    .test-container { padding: 20px 15px; border-width: 3px; }
    .test-header { font-size: 22px; padding: 15px; margin-bottom: 25px; }
    .question-block { padding: 15px; margin-bottom: 30px; }
    .question-title { font-size: 20px; margin-bottom: 15px; }
    
    .option-label { font-size: 18px; padding: 15px; border-width: 2px; }
    .option-label input { transform: scale(1.3); margin-top: 4px; }
    
    .btn-action { width: 100%; font-size: 20px; padding: 15px; margin-top: 20px; }
    .test-result-box { font-size: 22px; padding: 20px 15px; }

    .links-list { font-size: 18px; }
    .links-list li { padding: 12px 15px; }
    
    .footer { flex-direction: column; text-align: center; gap: 15px; padding: 25px 15px; font-size: 16px; }
    .text-right { text-align: center; }
}

.developer-mark {
    margin-top: 15px;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.developer-mark a {
    color: var(--cream);
    text-decoration: underline;
    font-weight: normal;
}
.developer-mark:hover {
    opacity: 1;
}