@font-face {
    font-family: 'Dana';
    src: url('/static/fonts/dana/dana-fanum-regular.woff') format('woff');
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Dana', sans-serif;
    background-color: #f9fafb;
    color: #1e293b;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* لوگو و توضیح شرکت */
.intro {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.intro img {
    width: 140px;
    height: auto;
}

.intro p {
    text-align: justify;
    border-right: 4px solid #cbd5e1;
    padding-right: 1rem;
    color: #475569;
    max-width: 1000px;
}

/* کارت اصلی دریا */
.card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    border-top: 4px solid #cbd5e1;
}

.sea-tab,
.chart-btn,
.gif-buttons button,
.water-level-button-container button {
    font-family: 'Dana', sans-serif; /* احتیاطی: اعمال مجدد در صورت نیاز */
    font-weight: 700; /* استفاده از وزن Bold برای جلوه بهتر دکمه‌ها */
}

/* اعمال وزن Black برای هدرهای کارت بندر */
.port-card h3 {
    font-family: 'Dana', sans-serif;
    font-weight: 900; /* اعمال وزن Black */
}

.card-header {
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem;
    background-color: #fff;
}

.sea-tabs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.sea-tab {
    background-color: #f1f5f9;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    width: 30%;
}

.sea-tab.active {
    background-color: #fff;
    box-shadow: 0 0 6px rgba(0,0,0,0.1);
    color: #2563eb;
}
/* هشدار */
.alert {
    padding: 1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 8px;
    margin: 1.5rem;
}

.alert.orange { background-color: #f97316; }
.alert.green { background-color: #22c55e; }

/* دکمه‌های GIF */
.gif-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.gif-buttons button {
    border: 1px solid #cbd5e1;
    background-color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: 0.3s;
    display: flex; /* ۱. فعال‌سازی Flexbox */
    align-items: center; /* ۲. هم‌ترازی عمودی برای مرکز قرار گرفتن تصویر و متن */
    gap: 0.5rem; /* ۳. ایجاد فاصله کم بین آیکون و متن */
}
    
.gif-buttons button img {
    /* عرض تصویر را کاهش می‌دهیم تا کوچک‌تر و متناسب‌تر با متن شود */
    width: 20px; 
    height: 20px;
    /* این خط را اضافه کنید تا آیکون کاملاً در وسط قرار گیرد */
    flex-shrink: 0; 
}

.gif-buttons button:hover {
    background-color: #f1f5f9;
}

/* کارت بندر */
.port-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 0 auto 1.5rem;
    max-width: 320px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;
}

.port-card h3 {
    text-align: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.75rem;            
}

/* دکمه‌های قبلی و بعدی */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.nav-buttons button {
    border: none;
    background-color: #f1f5f9;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    color: #475569;
    cursor: pointer;
    transition: 0.3s;
}

.nav-buttons button:hover {
    background-color: #e0f2fe;
    color: #0c4a6e;
}

.port-section {
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.port-title-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.icon-container {
    width: 38px; /* کمی بزرگتر، مثلاً 38x38، برای شبیه شدن به تصویر */
    height: 38px;
    padding: 0; /* padding را حذف می‌کنیم تا تصویر بیشتر فضا داشته باشد */
    border-radius: 8px; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-wind { 
    background-color:rgb(199, 228, 248); /* فیروزه‌ای روشن */
} 
.icon-wave { 
    background-color:rgb(208, 253, 255);
} 
.icon-water-level { 
    background-color: rgb(192, 210, 222); 
}

.icon-container img {
    width: 20px;
    height: 20px;
}

.port-data-row {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

.water-level-button-container {
    margin-top: 0.5rem;
    width: 100%;
}

.water-level-button-container button {
    border: 1px solid #00A0F3;
    background-color: #00A0F3;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: 0.3s;
    color: white;
    width: 100%;
}

.details-link {
    text-align: center;
    margin: 2rem 0 1rem;
}

.details-link a {
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    color: #2563eb;
    background-color: #cee5f3;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    transition: 0.3s;
}

.details-link a:hover {
    background-color:rgb(183, 222, 247);
    color: #1e3a8a;
}
/* --- استایل‌های جدید برای اسلاید و دکمه‌ها --- */

.port-slider-container {
    position: relative; 
    max-width: 100%; 
    margin: 0 auto 1.5rem;
    padding: 0 40px; /* این پدینگ را برای چسبیدن دکمه‌ها به لبه بیرونی حذف یا تغییر می‌دهیم */
}

/* کارت بندر (باید در ابتدا فقط کارت فعال نمایش داده شود) */
.port-card {
    max-width: 320px; /* عرض ثابت کارت را حفظ می‌کنیم */
    margin: 0 auto; /* این مطمئن می‌شود کارت در وسط کانتینر (port-slider-container) قرار می‌گیرد */
    display: none; 
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.port-card.active {
    display: block;
    opacity: 1;
}
.port-card .port-date {
    text-align: center;
    font-size: 0.85rem; /* کوچکتر از تاریخ اصلی */
    color: #64748b; /* رنگ خاکستری */
    font-weight: 500;
    margin-top: -0.5rem; /* کمی نزدیک‌تر به هدر بندر */
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #e2e8f0; /* برای جدا کردن تاریخ از بخش‌های داده‌ای */
}

/* استایل دکمه‌های کنترلی جدید (همان استایل مستطیلی قبلی) */
.slide-control-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #fff; 
    border: 1px solid #e2e8f0;
    border-radius: 8px; 
    width: 40px; 
    height: 50px; 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
    z-index: 10;
    transition: all 0.2s;
    color: #475569;
}

.slide-control-btn:hover {
    background-color: #f0f9ff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: #2563eb;
}

.slide-control-btn.prev {
    left: auto; 
    margin: 0; 
}

.slide-control-btn.next {
    left: 40px; 
    right: auto;
    margin: 0;
}

.slide-fade-in {
    opacity: 0;
    transform: translateX(40px); /* ورود از سمت راست */
    transition: transform 0.45s ease, opacity 0.45s ease;
}

.slide-fade-in.show {
    opacity: 1;
    transform: translateX(0);
}

#gif-modal{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.6);
    justify-content:center;
    align-items:center;
    z-index:9999;  
}
#gif-image {
    max-width:90%;
    max-height:90%;
    border:2px solid white;
    border-radius:12px;
}
/* water level modal */
#water-level-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

#water-level-modal.modal-hidden {
    display: none;
}

#water-level-modal .modal-content {
    background-color: #fefefe;
    padding: 20px;
    border-radius: 10px;
    width: 90%; 
    max-width: 800px; /* اندازه مناسب برای نمودار */
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#water-level-modal .close-btn {
    color: #aaa;
    float: left; /* برای RTL باید سمت چپ باشد */
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px; /* برای RTL تنظیم شود */
}

/* استایل کانتینر نمودار */
.chart-container {
    width: 100%;
    height: 400px; /* ارتفاع دلخواه برای نمودار */
}
/* ---------------------------------------------- */
#prev-port-btn span, #next-port-btn span {
    font-size: 1.2rem;
}

.chart-btn {
    /* ... (سایر استایل‌ها) ... */
    margin-top: 15px; /* فاصله‌گذاری از بالا */
    padding: 10px 20px;
    background-color: #007bff; /* رنگ آبی */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s;
    
    /* **تغییرات کلیدی برای بزرگ شدن عرض دکمه:** */
    width: 100%; 
    align-self: stretch; /* اطمینان از کشیده شدن در فلکس‌باکس */
}

.chart-btn:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

.chart-box {
    overflow-x: auto; 
    height: 350px; /* ارتفاع مورد نظر برای کل کانتینر (مثلاً 350 پیکسل) */
    width: 100%;
}


#chart-modal {
    display: none; /* مخفی بودن اولیه */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* پس‌زمینه نیمه‌شفاف */
    justify-content: center;
    align-items: center;
    z-index: 9998; /* کمی پایین‌تر از gif-modal برای مدیریت z-index */
}

.chart-modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 600px; /* یک عرض مناسب برای نمودار */
    max-height: 90%;
    overflow: auto;
    text-align: center;
}

#chart-title {
    margin-top: 0;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-close-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #dc3545; /* رنگ قرمز برای دکمه بستن */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.modal-close-btn:hover {
    background-color: #c82333;
}

/* ------------------------------------------------ */

@media (max-width: 768px) {
    .intro {
        text-align: center;
        flex-direction: column;
    }

    .intro p {
        border: none;
        padding: 0;
    }

    .port-slider-container {
        padding: 0 5px; 
    }
    .slide-control-btn {
        margin: 0 !important;
    }
    .slide-control-btn.prev {
        right: 5px; 
        left: auto;
    }
    .slide-control-btn.next {
        left: 5px; 
        right: auto;
    }
    #waterLevelChart {
        min-width: 300px; 
        /* اجازه می‌دهیم ارتفاع را از والد (Wrapper) بگیرد. */
        height: 100% !important;
    }
}
@media (min-width: 769px) {
    #waterLevelChart {
        width: 100% !important; 
        height: 100% !important;
        min-width: 300px; 
    }
}
