/* chapter.css - стили для страницы главы учебника */

/* Шапка главы */
.chapter-header {
    padding: 30px 0 20px;
    background: #161616;
    border-bottom: 1px solid var(--color-yellow);
    margin-bottom: 20px;
}

.chapter-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.chapter-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chapter-header-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.chapter-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
}

/* Навигация */
.chapter-navigation {
    padding: 0 0 25px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.back-button:hover {
    color: var(--color-yellow);
}

.back-button svg {
    transition: transform 0.2s ease;
}

.back-button:hover svg {
    transform: translateX(-3px);
}

/* Содержание главы */
.chapter-content-section {
    padding: 0 0 60px;
}

.chapter-content-wrapper {
    background: #161616;
    border-radius: 12px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chapter-intro {
    font-size: 1.2rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    padding: 20px 25px;
    background: rgba(250, 219, 10, 0.02);
    border-radius: 12px;
    margin-bottom: 40px;
    border-left: 4px solid var(--color-yellow);
}

/* Блоки контента */
.content-block {
    margin-bottom: 50px;
}

.content-block:last-child {
    margin-bottom: 0;
}

.content-block-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.content-block-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
}

.content-block-text p {
    margin-bottom: 20px;
}

.content-block-text p:last-child {
    margin-bottom: 0;
}

/* Списки */
.content-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.content-list li {
    padding: 10px 0 10px 25px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.content-list li:last-child {
    border-bottom: none;
}

.content-list li::before {
    content: "•";
    color: var(--color-yellow);
    font-weight: bold;
    position: absolute;
    left: 8px;
    font-size: 1.2rem;
}

.content-list li strong {
    color: var(--color-green);
    font-weight: 600;
}

/* Команды */
.commands-list {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.command-item {
    display: flex;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.command-item:last-child {
    border-bottom: none;
}

.command-code {
    background: rgba(0, 0, 0, 0.5);
    color: var(--color-yellow);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    margin-right: 15px;
    min-width: 180px;
    border: 1px solid var(--color-yellow);
}

.command-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* Предупреждение */
.warning-block {
    display: flex;
    gap: 20px;
    padding: 20px 25px;
    background: rgba(255, 200, 0, 0.05);
    border-radius: 12px;
    border: 1px solid var(--color-yellow);
    margin: 20px 0;
}

.warning-block svg {
    color: var(--color-yellow);
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.warning-block p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

/* Изображения */
.content-image {
    margin: 30px 0;
    text-align: center;
}

.content-image img {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-caption {
    margin-top: 10px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Таблицы */
.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.content-table thead {
    background: rgba(250, 219, 10, 0.1);
}

.content-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--color-yellow);
    border-bottom: 2px solid var(--color-yellow);
}

.content-table td {
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.content-table tr:last-child td {
    border-bottom: none;
}

.content-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Итог главы */
.chapter-summary {
    margin: 50px 0 30px;
    padding: 30px;
    background: rgba(82, 172, 98, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(82, 172, 98, 0.2);
}

.summary-title {
    font-size: 1.4rem;
    color: var(--color-green);
    margin-bottom: 20px;
    font-weight: 600;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-list li {
    padding-left: 25px;
    position: relative;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

.summary-list li::before {
    content: "✓";
    color: var(--color-green);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Навигация по главам */
.chapter-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chapter-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.chapter-link:hover {
    background: rgba(250, 219, 10, 0.1);
    border-color: rgba(250, 219, 10, 0.3);
    color: var(--color-yellow);
}

.chapter-link svg {
    width: 20px;
    height: 20px;
}

.chapter-link.prev:hover svg {
    transform: translateX(-3px);
}

.chapter-link.next:hover svg {
    transform: translateX(3px);
}

/* Адаптивность */
@media (max-width: 991px) {
    .chapter-title {
        font-size: 2rem;
    }
    
    .chapter-content-wrapper {
        padding: 30px;
    }
    
    .content-block-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .chapter-header {
        padding: 20px 0 15px;
    }
    
    .chapter-header-content {
        gap: 15px;
    }
    
    .chapter-icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .chapter-header-icon {
        width: 40px;
        height: 40px;
    }
    
    .chapter-title {
        font-size: 1.6rem;
    }
    
    .chapter-content-wrapper {
        padding: 25px 20px;
    }
    
    .content-block-title {
        font-size: 1.4rem;
    }
    
    .command-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .command-code {
        min-width: auto;
        margin-right: 0;
    }
    
    .summary-list {
        grid-template-columns: 1fr;
    }
    
    .chapter-links {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .chapter-link {
        justify-content: center;
    }
    
    .chapter-link.prev {
        order: 2;
    }
    
    .chapter-link.next {
        order: 1;
    }
}

@media (max-width: 576px) {
    .chapter-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .chapter-title {
        font-size: 1.4rem;
    }
    
    .content-block-title {
        font-size: 1.3rem;
    }
    
    .content-block-text {
        font-size: 1rem;
    }
    
    .warning-block {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .content-table {
        font-size: 0.9rem;
    }
    
    .content-table th,
    .content-table td {
        padding: 10px;
    }
}