/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

ul {
    list-style: none;
}

/* Content Wrapper */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px;
}

/* Banner Section */
.tracking-home-top {
    position: relative;
    width: 100%;
    height: 300px;
    background: url('https://images.unsplash.com/photo-1613690399151-65ea69478674?q=80&w=1173&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D') center center / cover no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tracking-home-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 61, 36, 0.75) 0%, rgba(46, 108, 59, 0.6) 50%, rgba(26, 61, 36, 0.7) 100%);
    z-index: 1;
}

.tracking-home-top::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60'%3E%3Cpath d='M0,60 L0,20 Q300,0 600,20 Q900,40 1200,20 L1200,60 Z' fill='%23f0f2f5'/%3E%3C/svg%3E");
    background-size: cover;
    z-index: 2;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath d='M0 50 Q25 30 50 50 Q75 70 100 50' stroke='rgba(255,255,255,0.05)' fill='none' stroke-width='1'/%3E%3C/svg%3E");
    z-index: 1;
}

.banner-logo {
    height: 60px;
    margin-bottom: 16px;
    z-index: 3;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.tracking-title-1 {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 6px;
    z-index: 3;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.tracking-title-2 {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
    letter-spacing: 4px;
    z-index: 3;
}

/* Language Switcher */
.lang-switcher {
    position: absolute;
    top: 16px;
    left: 20px;
    z-index: 10;
    display: flex;
    gap: 4px;
}

.lang-btn {
    width: 36px;
    height: 30px;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #1a3d24;
    border-color: rgba(255, 255, 255, 0.9);
}

/* Admin Link */
.admin-link {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    text-decoration: none;
}

.admin-link:hover {
    background: rgba(255,255,255,0.3);
}

/* Search Section */
.search-container-box {
    position: relative;
    z-index: 10;
    margin: -40px auto 0;
    max-width: 700px;
    padding: 0 20px;
}

.search-container-title {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.search-label {
    font-size: 13px;
    font-weight: 700;
    color: #2e6c3b;
    letter-spacing: 3px;
    margin-bottom: 16px;
}

.search-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input-box {
    flex: 1;
}

.search-input {
    width: 100%;
    height: 50px;
    border: 2px solid #e0e6ea;
    border-radius: 10px;
    padding: 0 18px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    color: #333;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    border-color: #2e6c3b;
    box-shadow: 0 0 0 3px rgba(46, 108, 59, 0.15);
}

.search-input::placeholder {
    color: #b0bec5;
}

.search-icon-box {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2e6c3b, #235530);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-icon-box:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 108, 59, 0.4);
}

.search-icon-box:active {
    transform: translateY(0);
}

/* Results Section */
.search-result-wrapper {
    max-width: 1100px;
    margin: 30px auto 0;
    padding: 0 20px;
}

/* General Information */
.base-info {
    background: #fff;
    border-radius: 14px;
    padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a3d24;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f2f5;
}

.info-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 32px;
}

.info-list li {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-list .label {
    font-size: 12px;
    font-weight: 600;
    color: #8a9aa5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-list .value {
    font-size: 15px;
    font-weight: 600;
    color: #1a3d24;
}

/* Vessel Tracking Card */
.vessel-card {
    background: #fff;
    border-radius: 14px;
    padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    border-left: 4px solid #2e6c3b;
}

.vessel-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vessel-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vessel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f7faf8;
    border-radius: 10px;
    border: 1px solid #e8f0eb;
    gap: 16px;
    flex-wrap: wrap;
}

.vessel-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.vessel-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a3d24;
}

.vessel-voyage {
    font-size: 12px;
    font-weight: 600;
    color: #5a6a72;
    background: #edf0f3;
    padding: 2px 10px;
    border-radius: 4px;
}

.vessel-imo {
    font-size: 12px;
    font-weight: 600;
    color: #2e6c3b;
    background: #e8f5e9;
    padding: 2px 10px;
    border-radius: 4px;
}

.vessel-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vessel-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.vessel-item-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.vessel-map {
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    background: #eef3f0;
    margin-top: -1px;
}

.vessel-map iframe {
    display: block;
}

.vessel-map-msg {
    padding: 24px;
    text-align: center;
    color: #8a9aa5;
    font-size: 13px;
}

.preview-btn {
    background: #fff3e0;
    color: #e65100;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.preview-btn:hover {
    background: #ffe0b2;
    box-shadow: 0 2px 8px rgba(230, 81, 0, 0.2);
}

.vessel-link.vf {
    background: #e8f5e9;
    color: #2e7d32;
}

.vessel-link.vf:hover {
    background: #c8e6c9;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
}

/* Container Tracking Content */
.tracking-content {
    background: #fff;
    border-radius: 14px;
    padding: 28px 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 32px;
}

.tracking-content-full {
    display: block;
}

.tracking-left {
    min-width: 200px;
    flex-shrink: 0;
}

.tab-wrap .section-title {
    margin-bottom: 14px;
}

.tab-list li {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #8a9aa5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.tab-list li:hover {
    background: #edf7ef;
    color: #2e6c3b;
}

.tab-list li.active {
    background: linear-gradient(135deg, #2e6c3b, #235530);
    color: #fff;
}

/* Timeline */
.tracking-timeline {
    flex: 1;
    position: relative;
    padding-left: 0;
}

.tracking-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 24px;
    bottom: 24px;
    width: 2px;
    background: #e0e6ea;
    z-index: 0;
}

.step {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding: 10px 0;
    gap: 16px;
}

.step:first-child {
    padding-top: 0;
}

.step:last-child {
    padding-bottom: 0;
}

/* Timeline icon */
.step-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    border: 2px solid #acb9bd;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: all 0.3s;
}

.step-icon svg {
    width: 18px;
    height: 18px;
}

.step-icon svg path,
.step-icon svg circle,
.step-icon svg rect,
.step-icon svg line,
.step-icon svg polyline,
.step-icon svg polygon {
    stroke: #acb9bd;
}

.step.completed .step-icon {
    border-color: #2e6c3b;
}

.step.completed .step-icon svg path,
.step.completed .step-icon svg circle,
.step.completed .step-icon svg rect,
.step.completed .step-icon svg line,
.step.completed .step-icon svg polyline,
.step.completed .step-icon svg polygon {
    stroke: #2e6c3b;
}

.step.active .step-icon {
    border-color: #c1c845;
    background: #c1c845;
    box-shadow: 0 0 0 4px rgba(193, 200, 69, 0.25);
}

.step.active .step-icon svg path,
.step.active .step-icon svg circle,
.step.active .step-icon svg rect,
.step.active .step-icon svg line,
.step.active .step-icon svg polyline,
.step.active .step-icon svg polygon {
    stroke: #fff;
}

/* Step content */
.step-content {
    flex: 1;
    padding-top: 2px;
}

.step-label {
    font-size: 14px;
    font-weight: 700;
    color: #1a3d24;
    margin-bottom: 6px;
    min-width: 180px;
}

.step.no-data .step-label {
    color: #acb9bd;
}

.step-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    font-size: 13px;
}

.step-type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.step-type.actual {
    background: #e8f5e9;
    color: #2e6c3b;
}

.step-type.estimate {
    background: #fef6e8;
    color: #e67e22;
}

.step-time {
    color: #5a6a72;
    font-weight: 500;
}

.step-location {
    color: #1a3d24;
    font-weight: 600;
}

.step-vessel {
    color: #2e6c3b;
    font-weight: 500;
    font-size: 12px;
}

.step-vessel a {
    color: #2e6c3b;
    text-decoration: none;
}

.step-vessel a:hover {
    text-decoration: underline;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #acb9bd;
}

.no-results svg {
    margin-bottom: 16px;
}

.no-results p {
    font-size: 15px;
}

/* Loading animation */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.visible {
    display: block;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e6ea;
    border-top-color: #2e6c3b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 900px) {
    .tracking-content {
        flex-direction: column;
    }

    .tracking-left {
        min-width: unset;
    }

    .tab-list {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .info-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .tracking-title-1 {
        font-size: 28px;
        letter-spacing: 3px;
    }

    .tracking-title-2 {
        font-size: 14px;
    }

    .tracking-home-top {
        height: 220px;
    }

    .banner-logo {
        height: 40px;
        margin-bottom: 10px;
    }

    .search-container-title {
        padding: 20px;
    }

    .base-info, .tracking-content {
        padding: 20px;
    }

    .info-list {
        grid-template-columns: 1fr;
    }

    .step-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .lang-switcher {
        top: 10px;
        left: 10px;
    }

    .lang-btn {
        width: 32px;
        height: 26px;
        font-size: 10px;
    }
}

/* ── RTL Support (Arabic) ── */
[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .search-input {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .search-label {
    text-align: right;
}

[dir="rtl"] .info-list .label,
[dir="rtl"] .info-list .value {
    text-align: right;
}

[dir="rtl"] .vessel-card {
    border-left: none;
    border-right: 4px solid #2e6c3b;
}

[dir="rtl"] .vessel-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .vessel-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .vessel-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .tracking-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .tracking-timeline {
    padding-left: 0;
    padding-right: 0;
}

[dir="rtl"] .tracking-timeline::before {
    left: auto;
    right: 20px;
}

[dir="rtl"] .step {
    flex-direction: row-reverse;
}

[dir="rtl"] .step-content {
    text-align: right;
}

[dir="rtl"] .step-details {
    direction: rtl;
}

[dir="rtl"] .admin-link {
    right: auto;
    left: 20px;
}

[dir="rtl"] .lang-switcher {
    left: auto;
    right: 20px;
}

[dir="rtl"] .step-label {
    text-align: right;
}

@media (max-width: 900px) {
    [dir="rtl"] .tracking-content {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    [dir="rtl"] .admin-link {
        left: 10px;
    }

    [dir="rtl"] .lang-switcher {
        right: 10px;
    }
}
