* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Верхній блок */
.hero-section {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    text-align: center;
    padding: 60px 20px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
    line-height: 1.8;
}

/* Основне розташування */
.instruction-layout {
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 30px;
    padding: 40px 20px 80px;
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Навігаційне меню */
.instruction-nav {
    position: sticky;
    top: 120px;
    z-index: 20;
    background: white;
    box-shadow: 0 10px 30px rgba(25, 64, 99, 0.12);
    border-radius: 16px;
    border: 1px solid #e6ecf5;
    flex: 0 0 320px;
    width: 320px;
    align-self: flex-start;
    padding: 24px 0 24px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.instruction-nav:hover {
    box-shadow: 0 18px 40px rgba(25, 64, 99, 0.16);
}

.instruction-nav-content {
    display: flex;
    flex-direction: column;
    padding: 0 32px 16px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.instruction-nav-link {
    padding: 10px 15px;
    text-decoration: none;
    color: #555;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 15px;
    display: block;
}

.instruction-nav-link:hover {
    background: #f0f7ff;
    color: #4A90E2;
    padding-left: 20px;
}

.instruction-nav-link.active,
.instruction-nav-link.active:hover,
.instruction-nav-link.active:focus {
    background: #4A90E2;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.35);
    text-decoration: none;
}

.instruction-nav-link--sub {
    padding-left: 35px;
    font-size: 14px;
    color: #666;
}

.instruction-nav-link--sub:hover {
    padding-left: 40px;
}

/* Основний контент */
.content-wrapper {
    flex: 1;
    min-width: 0;
    padding: 0;
}

/* Секції інструкції */
.instruction-section {
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.instruction-section,
.story-section.subsection {
    scroll-margin-top: 100px;
}

.instruction-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-number {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Плашки з текстом */
.story-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.story-section.subsection {
    border-left: 4px solid #4A90E2;
    margin-top: 30px;
}

.subsection-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #4A90E2;
}

.step-title {
    font-size: 20px;
    font-weight: 600;
    margin: 25px 0 15px;
    color: #357ABD;
}

.story-text {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

/* Контейнери для зображень */
.story-photo {
    margin: 30px auto;
    text-align: center;
    max-width: 900px;
}

.story-photo img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid #e6ecf5;
    display: block;
    margin: 0 auto;
}

/* Обмеження для гіфок */
.story-photo img[src*=".gif"] {
    max-width: 800px;
    width: 100%;
}

/* Обмеження для скріншотів */
.story-photo img[src*=".png"],
.story-photo img[src*=".jpg"] {
    max-width: 900px;
    width: 100%;
}

.highlight-text {
    color: #4A90E2;
    font-size: 18px;
}

/* Списки */
.instruction-list {
    margin: 20px 0;
    padding-left: 30px;
    color: #555;
}

.instruction-list li {
    margin-bottom: 12px;
    line-height: 1.8;
}

.instruction-list.numbered {
    list-style-type: decimal;
}

.instruction-list ul {
    margin-top: 10px;
    list-style-type: circle;
}

/* Деталі процесів */
.process-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.detail-item {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-start;
}

.detail-label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 150px;
    margin-right: 10px;
}

.detail-value {
    color: #555;
    flex: 1;
}

/* Налаштування процесів */
.process-settings {
    margin: 20px 0;
}

.range-info {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-top: 15px;
    border-radius: 4px;
}

.range-label {
    font-weight: 600;
    color: #856404;
    display: block;
    margin-bottom: 8px;
}

.range-info ul {
    list-style: none;
    padding-left: 0;
    margin: 5px 0;
}

.range-info li {
    padding: 4px 0;
    color: #856404;
}

/* Інформаційні блоки */
.info-box {
    background: #d1ecf1;
    border-left: 4px solid #0c5460;
    padding: 20px;
    margin: 25px 0;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.info-box.warning {
    background: #fff3cd;
    border-left-color: #856404;
}

.info-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.info-box p {
    margin: 0;
    color: #0c5460;
}

.info-box.warning p {
    color: #856404;
}

/* Статуси замовлення */
.status-list {
    display: grid;
    gap: 15px;
    margin: 25px 0;
}

.status-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
}

.status-badge.new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.confirmed {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.in-progress {
    background: #fce4ec;
    color: #c2185b;
}

.status-badge.ready {
    background: #e8f5e9;
    color: #388e3c;
}

.status-badge.completed {
    background: #f3e5f5;
    color: #7b1fa2;
}

.status-badge.cancelled {
    background: #ffebee;
    color: #d32f2f;
}

.status-item p {
    margin: 0;
    color: #555;
    flex: 1;
}

/* Приклад налаштування */
.example-box {
    background: #f0f7ff;
    border: 2px solid #4A90E2;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.example-title {
    font-weight: 600;
    color: #4A90E2;
    margin-bottom: 15px;
    font-size: 18px;
}

.example-content p {
    margin: 8px 0;
    color: #555;
}

/* Таблиця діапазонів */
.ranges-table {
    margin: 25px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.table-row.header {
    background: #4A90E2;
    color: white;
    font-weight: 600;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:not(.header):hover {
    background: #f8f9fa;
}

.table-cell {
    display: flex;
    align-items: center;
}

/* Плейсхолдери для зображень */
.image-placeholder {
    background: #f0f7ff;
    border: 2px dashed #4A90E2;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    margin: 30px 0;
}

.placeholder-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.placeholder-text {
    color: #4A90E2;
    font-size: 16px;
    font-weight: 500;
}

/* Кнопка прокрутки вгору */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

/* Анімації появи */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* Адаптивність */
@media (max-width: 1024px) {
    .instruction-layout {
        flex-direction: column;
        padding: 30px 20px 60px;
    }

    .instruction-nav {
        position: relative;
        top: 0;
        width: 100%;
        flex: 1 1 auto;
        align-self: stretch;
    }

    .instruction-nav-content {
        max-height: none;
    }

    .table-row {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 10px;
        padding: 12px 15px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }

    .hero-description {
        font-size: 16px;
    }

    .instruction-layout {
        padding: 25px 15px 50px;
        gap: 20px;
    }

    .content-wrapper {
        width: 100%;
        padding: 0;
    }

    .story-section {
        padding: 25px 20px;
    }

    .section-title {
        font-size: 28px;
    }

    .story-photo {
        margin: 20px auto;
        max-width: 100%;
    }

    .story-photo img[src*=".gif"] {
        max-width: 100%;
    }

    .story-photo img[src*=".png"],
    .story-photo img[src*=".jpg"] {
        max-width: 100%;
    }

    .subsection-title {
        font-size: 22px;
    }

    .instruction-nav-content {
        padding: 0 20px 15px;
    }

    .section-number {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 20px;
    }

    .status-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-badge {
        width: 100%;
    }

    .table-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .table-row.header {
        display: none;
    }

    .table-cell::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 10px;
        color: #4A90E2;
    }

    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }

    .detail-item {
        flex-direction: column;
    }

    .detail-label {
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .hero-section {
        padding: 40px 15px;
    }

    .section-title {
        font-size: 24px;
    }

    .subsection-title {
        font-size: 20px;
    }

    .step-title {
        font-size: 18px;
    }

    .story-section {
        padding: 20px 15px;
    }

    .image-placeholder {
        padding: 40px 20px;
    }

    .placeholder-icon {
        font-size: 36px;
    }
}

/* Плавна прокрутка */
html {
    scroll-behavior: smooth;
}

/* Стилі для прокрутки навігаційного меню */
.instruction-nav-content::-webkit-scrollbar {
    width: 8px;
}

.instruction-nav-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.instruction-nav-content::-webkit-scrollbar-thumb {
    background: #4A90E2;
    border-radius: 4px;
}

.instruction-nav-content::-webkit-scrollbar-thumb:hover {
    background: #357ABD;
}
