/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Language Selector */
.language-selector {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    gap: 10px;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid #fff;
    background: transparent;
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.lang-btn:hover {
    background: #fff;
    color: #667eea;
}

.lang-btn.active {
    background: #fff;
    color: #667eea;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: #fff;
}

.title {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: #fff;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

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

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

.section-title {
    text-align: center;
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Lesson Grid */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.lesson-card {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lesson-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.lesson-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.lesson-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.lesson-card p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.start-btn {
    padding: 12px 30px;
    border: none;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1rem;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Exercise Section */
.exercise-container {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.exercise-header h3 {
    font-size: 2rem;
    color: #333;
}

.score-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.exercise-content {
    text-align: center;
}

.exercise-text {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 30px;
}

.primary-btn {
    padding: 15px 40px;
    border: none;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1.1rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Calculator Section */
.calculator-container {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.calc-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.input-group input,
.input-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
}

.calc-results {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    border-left: 5px solid #667eea;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    font-size: 1.1rem;
}

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

.result-item span:first-child {
    font-weight: 600;
    color: #333;
}

.result-item span:last-child {
    font-weight: bold;
    color: #667eea;
    font-size: 1.2rem;
}

/* Glossary Section */
.glossary-container {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.search-box {
    margin-bottom: 30px;
}

.search-box input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.glossary-list {
    display: grid;
    gap: 20px;
}

.glossary-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.glossary-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.glossary-item h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.glossary-item p {
    color: #666;
    line-height: 1.6;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

    .modal-content {
        background-color: #fff;
        margin: 5% auto;
        padding: 0;
        border-radius: 20px;
        width: 90%;
        max-width: 800px;
        max-height: 80vh;
        overflow-y: auto;
        position: relative;
        box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    }
    
    /* Lesson Content Styling */
    .lesson-content h2 {
        color: #667eea;
        font-size: 2rem;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .lesson-content p {
        font-size: 1.1rem;
        line-height: 1.8;
        margin-bottom: 20px;
        color: #333;
    }
    
    .lesson-content h3 {
        color: #764ba2;
        font-size: 1.5rem;
        margin: 25px 0 15px 0;
        border-bottom: 2px solid #667eea;
        padding-bottom: 8px;
    }
    
    .lesson-content h4 {
        color: #667eea;
        font-size: 1.3rem;
        margin: 20px 0 10px 0;
    }
    
    .lesson-content ul {
        margin: 15px 0;
        padding-left: 20px;
    }
    
    .lesson-content li {
        margin: 10px 0;
        line-height: 1.6;
    }
    
    .lesson-content strong {
        color: #667eea;
        font-weight: 600;
    }
    
    /* Formula Section Styling */
    .formula-section {
        padding: 20px 0;
    }
    
    .formula-box {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-radius: 15px;
        padding: 25px;
        margin: 20px 0;
        border-left: 5px solid #667eea;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    
    .formula-box h4 {
        color: #667eea;
        font-size: 1.4rem;
        margin-bottom: 15px;
        border-bottom: 2px solid #667eea;
        padding-bottom: 8px;
    }
    
    .formula-box p {
        font-size: 1.1rem;
        margin: 10px 0;
        line-height: 1.6;
    }
    
    .formula-box ul {
        margin: 15px 0;
        padding-left: 20px;
    }
    
    .formula-box li {
        margin: 8px 0;
        line-height: 1.5;
    }
    
    .example-box {
        background: linear-gradient(135deg, #e8f4fd 0%, #d1ecf1 100%);
        border-radius: 15px;
        padding: 25px;
        margin: 25px 0;
        border-left: 5px solid #17a2b8;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    
    .example-box h4 {
        color: #17a2b8;
        font-size: 1.4rem;
        margin-bottom: 15px;
        border-bottom: 2px solid #17a2b8;
        padding-bottom: 8px;
    }
    
    .p-l-table {
        width: 100%;
        border-collapse: collapse;
        margin: 20px 0;
        background: #fff;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .p-l-table th {
        background: #667eea;
        color: #fff;
        padding: 15px;
        text-align: left;
        font-weight: 600;
    }
    
    .p-l-table td {
        padding: 12px 15px;
        border-bottom: 1px solid #eee;
    }
    
    .p-l-table tr:nth-child(even) {
        background: #f8f9fa;
    }
    
    .p-l-table tr:hover {
        background: #e3f2fd;
    }
    
    .p-l-table td:last-child {
        font-weight: 600;
    }
    
    .p-l-table tr td:nth-child(3) {
        font-weight: bold;
    }
    
    .p-l-table tr td:nth-child(3):contains('+') {
        color: #28a745;
    }
    
    .p-l-table tr td:nth-child(3):contains('-') {
        color: #dc3545;
    }
    
    /* Chart Container Styling */
    .chart-container {
        background: #fff;
        border-radius: 15px;
        padding: 30px;
        margin-top: 30px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    
    .chart-container h3 {
        color: #667eea;
        text-align: center;
        margin-bottom: 20px;
        font-size: 1.5rem;
    }
    
    #profit-loss-chart {
        width: 100%;
        max-width: 600px;
        height: 400px;
        margin: 0 auto;
        display: block;
        border: 1px solid #ddd;
        border-radius: 10px;
    }
    
    .chart-legend {
        display: flex;
        justify-content: center;
        gap: 30px;
        margin-top: 20px;
        flex-wrap: wrap;
    }
    
    .legend-item {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.9rem;
    }
    
    .legend-color {
        width: 20px;
        height: 20px;
        border-radius: 3px;
    }
    
    .legend-color.profit {
        background: #28a745;
    }
    
    .legend-color.loss {
        background: #dc3545;
    }
    
    .legend-color.break-even {
        background: #ffc107;
        border: 2px solid #333;
    }

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    color: #000;
}

.lesson-navigation {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

/* Exercise Questions */
.question-container {
    text-align: left;
    padding: 30px;
}

.question-text {
    font-size: 1.3rem;
    margin-bottom: 25px;
    color: #333;
    line-height: 1.6;
}

.options-list {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.option-item {
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.option-item:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.option-item.selected {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
}

.option-item.correct {
    border-color: #28a745;
    background: #28a745;
    color: #fff;
}

.option-item.incorrect {
    border-color: #dc3545;
    background: #dc3545;
    color: #fff;
}

.feedback {
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-weight: 500;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

    .feedback.incorrect {
        background: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }
    
    /* Exercise Complete Styling */
    .exercise-complete {
        text-align: center;
        padding: 40px;
    }
    
    .exercise-complete h3 {
        color: #28a745;
        font-size: 2rem;
        margin-bottom: 20px;
    }
    
    .exercise-complete p {
        font-size: 1.2rem;
        margin-bottom: 15px;
        color: #666;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .lesson-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .nav {
        flex-direction: column;
        align-items: center;
    }
    
    .calc-inputs {
        grid-template-columns: 1fr;
    }
    
    .exercise-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .lesson-card {
        padding: 20px;
    }
    
    .exercise-container,
    .calculator-container,
    .glossary-container {
        padding: 20px;
    }
}
