/* Modern anime/Genshin-inspired styles for physics textbook */

body {
    font-family: 'Segoe UI', 'Arial', 'sans-serif';
    background: linear-gradient(120deg, #dbeafe 0%, #e9d8fd 100%);
    margin: 0;
    min-height: 100vh;
    color: #23223b;
}

/* Add a subtle overlay for better readability */
body::before {
    content: '';
    position: fixed;
    z-index: -1;
    inset: 0;
    background: linear-gradient(120deg, #fff 60%, #e0e7ff 100%);
    opacity: 0.55;
}


header {
    /* Light header background for contrast */
    background: linear-gradient(90deg, #f7fafc 0%, #e6fffa 100%);
    color: #23223b;
    padding: 2rem 0 1rem 0;
    box-shadow: 0 2px 18px rgba(56,178,172,0.13);
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    text-align: center;
}

header h1 {
    font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
    font-size: 2.5rem;
    letter-spacing: 2px;
    margin-bottom: 0.3em;
    color: #319795; /* Saturated teal for main title */
}

header p {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

nav ul li {
    position: relative;
}

nav ul a {
    font-weight: bold;
    color: #234e52;
    background: linear-gradient(90deg, #38b2ac 0%, #81e6d9 100%);
    border-radius: 16px;
    padding: 0.5em 1.2em;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 16px rgba(56,178,172,0.16);
    border: 1.5px solid #38b2ac;
    letter-spacing: 1px;
    font-size: 1.08em;
    filter: drop-shadow(0 2px 6px #38b2accc);
}

nav ul a:hover, nav ul a.active {
    background: linear-gradient(90deg, #319795 0%, #81e6d9 100%);
    color: #fff;
    border-color: #319795;
    box-shadow: 0 2px 16px rgba(49,151,149,0.18);
}

/* Remove .teal specificity, now all buttons are styled as teal */

/* .teal no longer needed, all nav buttons are teal-like by default */

.dropdown-content {
    display: none;
    position: absolute;
    background: rgba(255,255,255,0.98);
    min-width: 250px;
    box-shadow: 0 8px 30px rgba(127,156,245,0.23);
    z-index: 2;
    border-radius: 14px;
    padding: 0.7rem 0;
    left: 0;
    top: 100%;
    border: 1.5px solid #b794f4;
    filter: drop-shadow(0 4px 18px #b794f4cc);
}

.dropdown-content a {
    color: #333;
    padding: 14px 18px;
    text-decoration: none;
    display: block;
    text-align: left;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 1.08em;
}

.dropdown-content a:hover {
    background: #e0e7ff;
    color: #7f9cf5;
}


.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    border-radius: 8px;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background: #e0e7ff;
}

main {
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 2rem 1.5rem;
    background: rgba(255,255,255,0.98);
    border-radius: 28px;
    box-shadow: 0 8px 36px rgba(127,156,245,0.18), 0 1.5px 18px 0 rgba(183,148,244,0.09);
    border: 1.5px solid #e0e7ff;
}

/* Add white background and shadow to sections for better separation */
section {
    background: rgba(255,255,255,0.92);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(127,156,245,0.09);
    margin-bottom: 2.5rem;
    padding: 1.2rem 1.5rem;
}

/* Add semi-transparent background to quotes and info blocks */
blockquote, .info-block {
    background: rgba(255,255,255,0.75);
    border-left: 4px solid #b794f4;
    padding: 1rem 1.5rem;
    margin: 1.5em 0;
    border-radius: 10px;
    font-style: italic;
    color: #444;
}


h1, h2, h3 {
    font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
}

h1 {
    color: #7f9cf5;
    font-size: 2.2rem;
    margin-top: 0;
}

h2 {
    color: #38b2ac;
    font-size: 1.6rem;
}

h3 {
    color: #b794f4;
    font-size: 1.2rem;
}

.illustration-container {
    display: flex;
    align-items: flex-start;
    background: linear-gradient(90deg, #f5f3ff 0%, #e0e7ff 100%);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(127,156,245,0.11);
    margin-bottom: 2rem;
    padding: 1.2rem 1.5rem;
    gap: 1.5rem;
    border: 2px solid #e0e7ff;
    transition: box-shadow 0.2s;
}

.illustration-container:hover {
    box-shadow: 0 6px 28px rgba(127,156,245,0.20);
    border: 2px solid #b794f4;
}

.illustration {
    width: 220px;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(127,156,245,0.13);
    border: 2px solid #b794f4;
    background: #fff;
    flex-shrink: 0;
}

.illustration-container p {
    font-size: 1.07rem;
    color: #333;
    margin: 0;
    line-height: 1.6;
}

/* Responsive grid for illustrations */
@media (max-width: 900px) {
    .illustration-container {
        flex-direction: column;
        align-items: center;
        padding: 0.6rem;
        gap: 0.7rem;
    }
    .illustration {
        width: 95vw;
        max-width: 340px;
        max-height: 220px;
        height: auto;
        margin-bottom: 0.5rem;
    }
    .illustration-container p {
        text-align: center;
        margin-top: 0.4rem;
    }
}


@media (max-width: 600px) {
    .illustration-container {
        padding: 0.4rem;
        gap: 0.4rem;
    }
    .illustration {
        width: 98vw;
        max-width: 99vw;
        max-height: 180px;
    }
    .illustration-container p {
        font-size: 0.99rem;
    }
}
    main {
        padding: 0.5rem;
        border-radius: 0;
    }
    .illustration-container {
        padding: 0.6rem;
    }
    .illustration {
        width: 92vw;
        max-width: 98vw;
    }


/* Decorative accent lines */
.illustration-container::before {
    content: '';
    display: block;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #7f9cf5 0%, #38b2ac 100%);
    border-radius: 6px 6px 0 0;
    margin-bottom: 10px;
}

/* Card hover effect */
.illustration-container:hover {
    transform: translateY(-2px) scale(1.02);
}

/* Buttons and accent classes */
.green { background: #68d391; color: #222 !important; }
.blue { background: #63b3ed; color: #fff !important; }
.orange { background: #f6ad55; color: #222 !important; }
.purple { background: #b794f4; color: #fff !important; }
.teal { background: #38b2ac; color: #fff !important; }
.pink { background: #f687b3; color: #fff !important; }

/* Misc */
::-webkit-scrollbar-thumb { background: #b794f4; border-radius: 8px; }
::-webkit-scrollbar { background: #e0e7ff; width: 8px; }


/* Улучшенная навигация */
nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

nav ul li {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 250px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    padding: 0.5rem 0;
    left: 0;
    top: 100%;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

/* Кнопка меню для мобильных устройств */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1000;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: #333;
    transition: all 0.3s;
}

/* Стили для кнопки "Пояснить решение" */
.explain-solution-btn {
    background-color: #4a6fa5;
    color: white;
    border: none;
    padding: 8px 16px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.explain-solution-btn:hover {
    background-color: #3a5a8c;
}

.solution-explanation {
    display: none;
    background-color: #f9f9f9;
    border-left: 4px solid #4a6fa5;
    padding: 15px;
    margin-top: 10px;
    border-radius: 0 4px 4px 0;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background-color: #fff;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        padding: 1rem;
        z-index: 100;
    }
    
    nav.active ul {
        display: flex;
    }
    
    .dropdown-content {
        position: static;
        box-shadow: none;
        display: none;
        padding-left: 1rem;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }
    
    .dropdown > a::after {
        content: " ▼";
        font-size: 0.8em;
    }
}

/* Улучшенные стили для задач */
.problem-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s;
}

.problem-card:hover {
    transform: translateY(-5px);
}

.problem-card h4 {
    color: #2c3e50;
    margin-top: 0;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}

/* Анимации для интерактивных элементов */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.answer, .solution-explanation {
    animation: fadeIn 0.5s ease-in-out;
}

/* Улучшенные стили для концепт-карточек */
.concept-card {
    background-color: #f8f9fa;
    border-left: 4px solid #e74c3c;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    transition: transform 0.3s, box-shadow 0.3s;
}

.concept-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.concept-card h4 {
    color: #e74c3c;
    margin-top: 0;
}

/* Улучшенные стили для цитат персонажей */
.character-quote {
    background-color: #f0f8ff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.character-quote:before {
    content: "";
    font-size: 4em;
    position: absolute;
    left: 10px;
    top: -10px;
    color: #4a6fa5;
    opacity: 0.3;
}

.character-quote p {
    font-style: italic;
    margin-bottom: 10px;
}

.character-quote cite {
    display: block;
    text-align: right;
    font-weight: bold;
    color: #4a6fa5;
}

.illustration-container {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.illustration {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
