* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #5a9fd4;
    --secondary-color: #87ceeb;
    --accent-color: #4a90e2;
    --medical-blue: #6bb6ff;
    --medical-green: #7dd3c0;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #ecf0f1;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-medical: #f0f8ff;
    --border-color: #e9ecef;
    --shadow-light: 0 2px 10px rgba(90, 159, 212, 0.1);
    --shadow-medium: 0 8px 25px rgba(90, 159, 212, 0.15);
    --shadow-heavy: 0 15px 35px rgba(90, 159, 212, 0.2);
    --border-radius: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 50%, #ddeeff 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

.container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Боковая панель */
.sidebar {
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(90, 159, 212, 0.2);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}

.sidebar-header {
    padding: 25px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 0;
}

.logo-and-name {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
}

.logo:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.6);
}

.site-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.site-name a {
    color: inherit;
    text-decoration: none;
}

.site-description {
    font-size: 12px;
    opacity: 0.8;
    text-align: center;
}

/* Поиск */
.search-container {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-medical);
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    pointer-events: none;
}

/* Навигация */
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.sidebar li {
    margin: 5px 15px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
}

.sidebar li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.sidebar li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(90, 159, 212, 0.1), transparent);
    transition: left 0.3s;
}

.sidebar li:hover a::before {
    left: 100%;
}

.sidebar li:hover {
    transform: translateX(2px);
}

.sidebar li:hover a {
    background: rgba(90, 159, 212, 0.1);
    color: var(--primary-color);
}

.sidebar li.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: none;
}

.sidebar li.active a {
    color: white;
    font-weight: 600;
}

.menu-icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Закладки */
.bookmark-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
    opacity: 0;
}

.sidebar li:hover .bookmark-btn {
    opacity: 1;
}

.bookmark-btn:hover {
    background: rgba(90, 159, 212, 0.15);
    color: var(--primary-color);
}

.bookmark-btn.active {
    color: #f39c12;
}

/* Основной контент */
.content {
    flex: 1;
    margin-left: 320px;
    padding: 40px 60px;
    background: var(--bg-primary);
    min-height: 100vh;
    position: relative;
}

/* Прогресс чтения */
.reading-progress {
    position: fixed;
    top: 0;
    left: 320px;
    right: 0;
    height: 3px;
    background: rgba(90, 159, 212, 0.2);
    z-index: 100;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.3s ease;
}

/* Заголовки */
h1 {
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

h2 {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 600;
    color: var(--text-primary);
    margin: 30px 0 20px 0;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

h3 {
    font-size: clamp(18px, 2.5vw, 22px);
    font-weight: 600;
    color: var(--medical-blue);
    margin: 25px 0 15px 0;
}

/* Параграфы */
.content p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: justify;
    text-indent: 2em;
}

/* Ссылки */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Списки на главной странице */
.home li {
    margin: 15px 0;
    padding: 15px 20px;
    background: var(--bg-medical);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.home li:hover {
    background: rgba(90, 159, 212, 0.1);
    transform: translateX(3px);
    box-shadow: var(--shadow-light);
}

.home li a {
    font-weight: 500;
    font-size: 16px;
}

/* Блоки контента */
.blocks {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
    padding: 25px;
    background: var(--bg-medical);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(90, 159, 212, 0.2);
}

.text {
    flex: 2;
}

.image {
    flex: 1;
    text-align: center;
}

.image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid rgba(90, 159, 212, 0.2);
}

.image img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-medium);
}

/* Карточки */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(90, 159, 212, 0.2);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.card h3 {
    margin-top: 0;
    color: var(--primary-color);
}

/* Кнопка "Назад" */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    margin-bottom: 30px;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    color: white;
}

/* Комментарии */
.comment {
    background: linear-gradient(135deg, rgba(90, 159, 212, 0.05), rgba(74, 144, 226, 0.05));
    border-left: 3px solid var(--primary-color);
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
}

.author-comment {
    background: linear-gradient(135deg, rgba(125, 211, 192, 0.05), rgba(107, 182, 255, 0.05));
    border-left: 3px solid var(--accent-color);
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* Мобильное меню */
.mobile-menu {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(90, 159, 212, 0.2);
    padding: 15px;
    z-index: 1001;
    box-shadow: 0 -3px 15px rgba(90, 159, 212, 0.15);
}

.mobile-menu-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.menu-item:hover {
    background: rgba(90, 159, 212, 0.1);
    color: var(--primary-color);
}

.menu-item svg {
    width: 24px;
    height: 24px;
}

/* Оверлей */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 999;
    transition: var(--transition);
}

.overlay.active {
    display: block;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .content {
        padding: 30px 40px;
    }
    
    .blocks {
        flex-direction: column;
        text-align: center;
    }
    
    .card-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0;
        padding: 20px;
    }
    
    .reading-progress {
        left: 0;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .content {
        padding-bottom: 100px;
    }
    
    .blocks {
        padding: 20px;
        margin: 20px 0;
    }
    
    .card {
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .content p {
        font-size: 15px;
        text-indent: 1.5em;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 15px;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .blocks {
        padding: 15px;
        gap: 20px;
    }
    
    .card-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .home li {
        padding: 12px 15px;
        margin: 10px 0;
    }
}

/* Специальные стили для разных страниц */
.main1 { background: linear-gradient(135deg, rgba(90, 159, 212, 0.03), rgba(74, 144, 226, 0.03)); }
.main2 { background: linear-gradient(135deg, rgba(74, 144, 226, 0.03), rgba(125, 211, 192, 0.03)); }
.main3 { background: linear-gradient(135deg, rgba(125, 211, 192, 0.03), rgba(90, 159, 212, 0.03)); }
.main4 { background: linear-gradient(135deg, rgba(90, 159, 212, 0.03), rgba(74, 144, 226, 0.03)); }

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content > * {
    animation: fadeIn 0.6s ease-out;
}

/* Скроллбар */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(90, 159, 212, 0.4);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(90, 159, 212, 0.6);
}

/* Медицинские иконки в фоне */
.medical-background-icons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.medical-bg-icon {
    position: absolute;
    font-size: 35px;
    opacity: 0.4;
    animation: medicalFloat 10s ease-in-out infinite;
}

.medical-bg-icon.heartbeat {
    top: 15%;
    left: 8%;
    animation: realHeartbeat 1.2s ease-in-out infinite;
    color: rgba(220, 20, 60, 0.7);
    font-size: 40px;
}

.medical-bg-icon.blood {
    top: 25%;
    right: 12%;
    animation: bloodDrop 4s ease-in-out infinite;
    animation-delay: 0.5s;
    color: rgba(220, 20, 60, 0.5);
}

.medical-bg-icon.pulse {
    top: 55%;
    left: 15%;
    animation: pulseWave 3s ease-in-out infinite;
    animation-delay: 1s;
    color: rgba(0, 255, 0, 0.6);
}

.medical-bg-icon.medical {
    bottom: 25%;
    right: 20%;
    animation: medicalSpin 8s linear infinite;
    animation-delay: 1.5s;
    color: rgba(52, 152, 219, 0.5);
}

.medical-bg-icon.stethoscope {
    top: 40%;
    left: 60%;
    animation: stethoscopeMove 6s ease-in-out infinite;
    animation-delay: 2s;
    color: rgba(44, 62, 80, 0.4);
}

.medical-bg-icon.monitor {
    bottom: 35%;
    left: 75%;
    animation: monitorBlink 2s ease-in-out infinite;
    animation-delay: 2.5s;
    color: rgba(0, 255, 0, 0.5);
}

@keyframes realHeartbeat {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    14% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    28% {
        transform: scale(1);
        opacity: 0.6;
    }
    42% {
        transform: scale(1.15);
        opacity: 0.9;
    }
    70% {
        transform: scale(1);
        opacity: 0.6;
    }
}

@keyframes bloodDrop {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translateY(20px) scale(1.1);
        opacity: 0.7;
    }
}

@keyframes pulseWave {
    0%, 100% {
        transform: scaleX(1) scaleY(1);
        opacity: 0.4;
    }
    50% {
        transform: scaleX(1.2) scaleY(0.8);
        opacity: 0.8;
    }
}

@keyframes medicalSpin {
    0% {
        transform: rotate(0deg);
        opacity: 0.4;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: rotate(360deg);
        opacity: 0.4;
    }
}

@keyframes stethoscopeMove {
    0%, 100% {
        transform: translateX(0px) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateX(15px) rotate(5deg);
        opacity: 0.5;
    }
}

@keyframes monitorBlink {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes medicalFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-20px) rotate(3deg);
        opacity: 0.6;
    }
}

/* Стили для таблиц */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.anatomy-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
    min-width: 600px;
}

.anatomy-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.anatomy-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
    line-height: 1.5;
}

.anatomy-table tbody tr:hover {
    background-color: rgba(90, 159, 212, 0.05);
    transition: background-color 0.2s ease;
}

.anatomy-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.anatomy-table tbody tr:nth-child(even):hover {
    background-color: rgba(90, 159, 212, 0.08);
}

/* Адаптивность для таблиц */
@media (max-width: 768px) {
    .table-container {
        margin: 15px -20px;
        border-radius: 0;
    }
    
    .anatomy-table {
        font-size: 13px;
        min-width: 500px;
    }
    
    .anatomy-table th,
    .anatomy-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .anatomy-table {
        font-size: 12px;
        min-width: 450px;
    }
    
    .anatomy-table th,
    .anatomy-table td {
        padding: 8px 10px;
    }
}

/* Стили для контентных секций */
.content-section {
    margin-bottom: 40px;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.video-container {
    position: relative;
    width: 70%;
    height: 0;
    padding-bottom: 39.375%; /* 70% of 56.25% (16:9 aspect ratio) */
    margin: 0 auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--border-radius);
}

.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.content-section h3 {
    color: var(--accent-color);
    margin-top: 25px;
    margin-bottom: 15px;
}

.content-section p {
    line-height: 1.7;
    margin-bottom: 15px;
}

.content-section ul {
    margin: 15px 0;
    padding-left: 25px;
}

.content-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.fun-facts {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-left: 4px solid var(--accent-color);
}

.fun-facts h2 {
    color: var(--accent-color);
}

.fact-list {
    list-style: none;
    padding-left: 0;
}

.fact-list li {
    background: var(--bg-primary);
    margin: 10px 0;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    position: relative;
    padding-left: 50px;
}

.fact-list li::before {
    content: "💡";
    position: absolute;
    left: 15px;
    font-size: 1.2em;
}

.navigation-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.nav-btn {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.nav-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.nav-icon {
    font-size: 1.2em;
}

.prev-btn .nav-icon {
    margin-right: 10px;
}

.next-btn .nav-icon {
    margin-left: 10px;
}

/* Стили для изображений */
.image-container {
    text-align: center;
    margin: 20px 0;
}

.content-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.content-image:hover {
    transform: scale(1.02);
}

/* Дополнительные адаптивные стили */
@media (max-width: 768px) {
    .content-section {
        padding: 20px;
    }

    .nav-buttons {
        flex-direction: column;
    }

    .nav-btn {
        justify-content: center;
    }

    .video-container {
        width: 100%;
        padding-bottom: 56.25%;
    }
}

