/* --- GOL TRACKING STYLES --- */

/* 1. Global & Resets */
.gol-tracking-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    box-sizing: border-box;
}

.gol-tracking-wrapper * {
    box-sizing: border-box;
}

/* 2. Main Search Box */
.gol-tracking-form { margin-bottom: 30px; }

.gol-tracking-box {
    background: #001b3a; /* Dark Blue Background */
    padding: 40px 20px;
    border-radius: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    /* Layout constraints */
    max-width: 850px; 
    width: 100%;
    margin: 0 auto; 
}

.gol-search-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gol-search-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-top: 20px;
    font-weight: 400;
    
    /* --- ИЗМЕНЕНИЕ: 700px, чтобы выровнять с полем ввода --- */
    max-width: 700px; 
    width: 100%;
    
    line-height: 1.5;
}

/* 3. Tabs */
.gol-tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: 6px;
    width: 100%;
    max-width: 700px; /* Aligned with inputs */
}

.gol-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.2s;
    text-transform: uppercase;
}

.gol-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.gol-tab-btn.active {
    background: #138db6;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.gol-tab-content {
    display: none;
    width: 100%;
    animation: fadeIn 0.3s ease-in;
}
.gol-tab-content.active { display: block; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 4. Form Inputs */
/* Container Row */
.gol-input-row {
    display: flex;
    gap: 0;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

/* B/L Row */
.gol-bol-row {
    display: flex;
    gap: 0;
    width: 100%;
    max-width: 700px; 
    margin: 0 auto;
}

/* Elements */
/* Стили для Select (С кастомной стрелкой) */
.gol-select {
    padding: 16px 35px 16px 15px; /* Увеличил отступ справа, чтобы текст не наезжал на стрелку */
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    background-color: #f0f0f0;
    color: #333;
    cursor: pointer;
    border-right: 1px solid #ddd;
    outline: none;
    font-weight: 600;
    width: 140px;
    
    /* Убираем стандартную стрелку браузера */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* Добавляем свою красивую стрелку (SVG) */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.gol-input-row input,
.gol-bol-row input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    font-size: 16px;
    outline: none;
    background: #ffffff;
    color: #333;
}

/* Corner radius adjustments */
.gol-input-row input { border-radius: 4px 0 0 4px; }
.gol-bol-row input { border-radius: 0; }

.gol-btn {
    background: #138db6;
    color: #fff;
    border: none;
    padding: 0 40px;
    border-radius: 0 4px 4px 0;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s;
}

.gol-btn:hover { background: #005a8d; }
.gol-btn:disabled { background: #ccc; cursor: not-allowed; }

/* Mobile Adaptation */
@media (max-width: 768px) {
    .gol-input-row, .gol-bol-row {
        flex-direction: column;
        gap: 10px;
    }
    .gol-input-row input, .gol-bol-row input, .gol-btn, .gol-select {
        border-radius: 4px;
        width: 100%;
        border-right: none;
    }
    .gol-btn { padding: 15px; }
    .gol-tracking-box { padding: 30px 15px; }
    .gol-tabs-nav { flex-direction: row; font-size: 12px; }
}

/* 5. B/L Results (Selection) */
.gol-bol-results {
    margin: 30px auto;
    max-width: 850px;
    text-align: center;
    animation: slideUp 0.4s ease-out;
}

.gol-bol-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.gol-bol-title-text {
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 16px;
}

.gol-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #138db6;
    padding: 5px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.gol-copy-btn:hover { color: #005a8d; }
.gol-copy-btn svg { width: 20px; height: 20px; fill: currentColor; }

.gol-cont-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.gol-cont-btn {
    background: #fff;
    border: 2px solid #138db6;
    color: #138db6;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.2s;
}

.gol-cont-btn:hover {
    background: #138db6;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(19, 141, 182, 0.25);
}

/* Стиль для активної кнопки контейнера в списку */
.gol-cont-btn.active {
    background: #138db6;
    color: #fff;
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.2); /* Ефект втиснутої кнопки */
    border-color: #138db6;
}

/* 6. Tracking Results Card */
.gol-tracking-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
    margin-top: 30px;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.gol-card-header {
    background: #F7F7F7;
    padding: 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.gol-main-info .gol-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
}
.gol-title { margin: 0; font-size: 24px; color: #004b87; font-weight: 700; }
.gol-type { background: #eef4fa; color: #004b87; font-size: 14px; padding: 2px 8px; border-radius: 4px; vertical-align: middle; margin-left: 8px; }

.gol-route { display: flex; align-items: center; gap: 15px; }
.gol-route-point { text-align: center; }
.gol-city { display: block; font-weight: bold; font-size: 16px; }
.gol-country { font-size: 12px; color: #999; }
.gol-arrow { color: #158DB4; font-size: 18px; }

.gol-stats {
    padding: 15px 25px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 30px;
    font-size: 14px;
    flex-wrap: wrap;
}
.gol-stat-item strong { color: #000; }

/* 7. Timeline */
.gol-timeline-wrapper { padding: 25px; }
.gol-section-title {
    margin: 0 0 20px 0;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
}
.gol-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    /* ВИДАЛЯЄМО стару загальну лінію ::before */
}

.gol-event {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}
.gol-event:last-child { margin-bottom: 0; }

/* НОВА ЛОГІКА ЛІНІЙ: Малюємо лінію від кожного елемента вниз */
.gol-event::after {
    content: '';
    position: absolute;
    left: 24px; /* Центр іконки (50px / 2) - 1px */
    top: 50px;  /* Початок лінії (відразу під іконкою) */
    bottom: -25px; /* Тягнемо до наступної іконки (компенсуємо margin-bottom) */
    width: 2px;
    background-color: #158db6; /* ЗА ЗАМОВЧУВАННЯМ СИНЯ (для минулих подій) */
    z-index: 0;
}

/* Для останнього елемента лінію прибираємо */
.gol-event:last-child::after {
    display: none;
}

/* Якщо подія поточна (is-current), то лінія, що йде від неї в майбутнє - СІРА */
.gol-event.is-current::after {
    background-color: #e0e0e0;
}

/* Для майбутніх подій лінія теж сіра */
.gol-event.gol-future::after {
    background-color: #e0e0e0;
}

/* Стилі маркера (Іконки) */
.gol-event-marker {
    width: 50px; height: 50px; background: #fff; border: 2px solid #158db6; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0; transition: all 0.3s;
    position: relative;
    z-index: 2; /* Щоб іконка була ПОВЕРХ лінії */
}

.gol-event.is-current .gol-event-marker {
    border-color: #138db6; background: #138db6; color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 75, 135, 0.1);
}
.gol-event.gol-future { opacity: 0.6; }
.gol-event.gol-future .gol-event-marker { background: #f0f0f0; border-color: #ddd; border-style: dashed; color: #999; }

.gol-event-date-col {
    min-width: 90px; padding-top: 12px; text-align: right;
    font-size: 14px; color: #555; font-weight: 500;
}
.gol-event.gol-future .gol-date { color: #999; font-style: italic; }

.gol-event-content {
    background: #fcfcfc; border: 1px solid #eee; padding: 15px;
    border-radius: 6px; flex: 1;
}
.gol-status-name { font-size: 16px; font-weight: 600; margin-bottom: 5px; color: #333; }
.gol-event.is-current .gol-status-name { color: #138db6; }
.gol-location { font-size: 14px; color: #666; }
.gol-vessel-name { font-size: 13px; color: #888; margin-top: 5px; font-style: italic; }

/* 8. Loader & Errors */
.gol-error {
    padding: 15px; background: #fff2f2; color: #d63031;
    border-radius: 6px; border: 1px solid #ffdede; text-align: center;
    margin-top: 20px;
}

#gol-loading { margin: 40px 0; text-align: center; display: flex; justify-content: center; }
.gol-loader-wrapper { position: relative; display: flex; flex-direction: column; align-items: center; }
.gol-container-icon {
    width: 80px; height: 40px; background-color: #004b87; border-radius: 1px; position: relative;
    background-image: repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(0, 0, 0, 0.2) 10px, rgba(0, 0, 0, 0.2) 12px);
    border: 2px solid #003666; animation: floatContainer 2s ease-in-out infinite; z-index: 2; overflow: hidden;
}
.gol-container-icon::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg); animation: scanLight 1.5s infinite;
}
.gol-loader-shadow { width: 60px; height: 6px; background: rgba(0,0,0,0.1); border-radius: 50%; margin-top: 10px; animation: shadowScale 2s ease-in-out infinite; }
.gol-loader-text { margin-top: 15px; color: #004b87; font-size: 14px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; animation: textPulse 1.5s ease-in-out infinite; }

@keyframes floatContainer { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes shadowScale { 0%, 100% { transform: scale(1); opacity: 0.2; } 50% { transform: scale(0.8); opacity: 0.1; } }
@keyframes scanLight { 0% { left: -100%; } 100% { left: 200%; } }
@keyframes textPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* --- Центрування заголовка тільки на сторінці трекінгу --- */
body.page-id-687 .hero-fall__title {
    text-align: center !important;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Якщо потрібно і для англійської версії (про всяк випадок) */
body.page-id-872 .hero-fall__title {
    text-align: center !important;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* --- Мобільна оптимізація Timeline (GRID Layout) --- */
@media (max-width: 768px) {
    
    /* 1. Налаштування контейнера події */
    .gol-event {
        display: grid;
        /* Колонка 1: 50px (під іконку), Колонка 2: 1fr (весь інший простір) */
        grid-template-columns: 50px 1fr; 
        grid-column-gap: 20px; /* Відступ між іконкою і текстом */
        margin-bottom: 0;      /* Відступи регулюємо через padding */
        padding-bottom: 30px;  /* Відступ до наступної події */
        position: relative;
    }

    /* 2. Іконка (Маркер) */
    .gol-event-marker {
        grid-column: 1;
        grid-row: 1; /* Стоїть у першому рядку */
        margin: 0 auto;
        z-index: 2;
        /* Гарантуємо розмір */
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }

    /* 3. Дата - МАГІЯ ВИРІВНЮВАННЯ */
    .gol-event-date-col {
        grid-column: 2;
        grid-row: 1; /* Теж перший рядок, навпроти іконки */
        
        /* Робимо блок висотою як іконка (50px) і центруємо текст */
        height: 50px; 
        display: flex;
        align-items: center; /* Центрування по вертикалі */
        justify-content: flex-start; /* Притискаємо вліво */
        
        /* Скидаємо старі відступи */
        padding-top: 0;
        text-align: left;
        min-width: 0;
        
        /* Стиль тексту */
        font-size: 14px;
        font-weight: 700;
        color: #333;
    }

    /* 4. Блок з контентом (Картка) - переносимо на другий рядок */
    .gol-event-content {
        grid-column: 2;
        grid-row: 2; /* Другий рядок, під датою */
        width: 100%;
        margin-top: -5px; /* Трохи підтягуємо вгору, щоб було візуально пов'язано з датою */
    }

    /* 5. Лінія з'єднання */
    .gol-event::after {
        left: 24px; /* Центр першої колонки (50px / 2 - 1px) */
        top: 50px;  /* Починається відразу під іконкою */
        bottom: -2px; /* Тягнеться до низу (враховуючи padding-bottom батька) */
        height: auto; 
    }

    /* Прибираємо лінію та відступ у останнього елемента */
    .gol-event:last-child {
        padding-bottom: 0;
    }
    .gol-event:last-child::after {
        display: none;
    }
}

/* --- 9. Lite Widget (Главная страница) --- */
.gol-lite-tab-content { 
    width: 100%; 
    animation: fadeIn 0.3s ease-in; 
}

.gol-lite-tab-btn { 
    flex: 1; 
    background: transparent; 
    border: none; 
    color: rgba(255, 255, 255, 0.7); 
    padding: 10px 20px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 14px; 
    border-radius: 4px; 
    transition: all 0.2s; 
    text-transform: uppercase; 
}

.gol-lite-tab-btn:hover { 
    color: #fff; 
    background: rgba(255, 255, 255, 0.1); 
}

.gol-lite-tab-btn.active { 
    background: #138db6; 
    color: #fff; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
}