@font-face {
    font-family: 'Dana';
    src: url('/static/fonts/dana/dana-fanum-regular.woff') format('woff');
    font-weight: 400; /* وزن معمولی */
    font-style: normal;
}
@font-face {
    font-family: 'Dana';
    src: url('/static/fonts/dana/dana-fanum-bold.woff') format('woff');
    font-weight: 900; /* یا bold وزن برای bold */
    font-style: normal;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}
.station-header {
    background-color:rgb(55, 96, 206); /* رنگ اصلی جدول */
    color: white;
    padding: 0.75rem 1.5rem;
    margin-top: 2rem; /* ایجاد فاصله بین جداول ایستگاه‌ها */
    margin-bottom: 0.5rem;
    border-radius: 8px;
    font-size: 1.4rem;
    text-align: right;
    font-weight: 800;
}

/* هدر و عنوان */
h1 {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    color: #0c4a6e;
    margin-bottom: 0.5rem;
}

.date {
    text-align: center;
    color: #6c809d;
    font-weight: 600;
    margin-bottom: 2rem;
}

.date span {
    font-weight: bold;
    font-size: 1.2rem;
    color: #3c4654 ;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

header img {
    height: 90px;
    object-fit: contain;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    text-align: center;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

th, td {
    border: none;
    border-right: 1px solid #e2e8f0;
    padding: 1rem 0.6rem;
    vertical-align: middle;
}

td:last-child {
    border-right: none;
}

thead {
    background-color: #1e3a8a;
    color: white;
    font-weight: 700;
}

/* سلول‌های داخلی هدر (برای سطرهای زیرین) */
thead tr:nth-child(2) th,
thead tr:nth-child(3) th {
    background-color: #2563eb;
    color: #fff;
    font-weight: 500;
    border-top: 1px solid #4f7fff;
}

tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

tbody tr:hover {
    background-color: #e0f2fe;
    transition: background-color 0.2s;
}

.direction {
    font-size: 1.3rem;
    font-weight: 900;
    color: #059669;
}

/* ستون وضعیت دریا - توضیحات */
tbody td:nth-child(3) { 
    font-weight: 400;
    color: #000000;
}
/* ستون وضعیت دریا - شماره */
/* tbody td:nth-child(4) { 
    font-weight: 800;
    color: #0c4ef8;
} */
/* ستون وضعیت نیروی باد - شماره */
tbody td:nth-child(2) { 
    font-weight: 400;
    color: #000000;
}

table thead tr th span {
    font-size: 13.8px;
}
.footer-note {
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 2rem;
}


/* استایل دکمه بازگشت به بالا */
#back-to-top-btn {
    display: none; /* در حالت عادی پنهان است */
    position: fixed; /* ثابت در صفحه نمایش */
    bottom: 20px; /* فاصله از پایین */
    right: 30px; /* فاصله از چپ */
    z-index: 99; 
    border: none; 
    outline: none; 
    background-color: #427dda; 
    color: white; 
    cursor: pointer; 
    padding: 15px; 
    border-radius: 50%; 
    font-size: 20px; 
    width: 50px; 
    height: 50px; 
    text-align: center;
    transition: background-color 0.3s, opacity 0.3s; 
}

#back-to-top-btn:hover {
    background-color: #709adf; 
}




/* استایل دکمه بازگشت به صفحه اصلی */
/* استایل دکمه بازگشت به صفحه اصلی */
.back-to-home-wrapper {
    width: 100%;
    /* تغییر: تراز کردن محتوا به چپ */
    text-align: left; 
    margin-top: 2rem;
    margin-bottom: 2rem;
    /* افزودن کمی فاصله از گوشه چپ برای دکمه بالایی */
    padding-left: 1.5rem; 
}

/* دکمه پایینی در مرکز باقی می‌ماند */
.back-to-home-wrapper.bottom-wrapper {
    text-align: center;
    padding-left: 0; 
}

/* ... (کدهای .back-to-home-btn) ... */
.back-to-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: white; 
    color: #1e293b; 
    border: none;
    border-radius: 12px; 
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s, background-color 0.2s;
    line-height: 1;
}

.back-to-home-btn:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    background-color: #f8f8f8;
}

.arrow-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* تغییر: بزرگتر کردن اندازه دایره */
    width: 1.8rem; 
    height: 1.8rem;
    border-radius: 50%;
    border: 2px solid #1e293b; 
    margin-right: 0.75rem; 
    /* تغییر: بزرگتر کردن فلش */
    font-size: 1.2rem; 
    font-weight: 900;
    /* چرخش فلش (برای راست به چپ) */
    transform: rotate(180deg); 
}

/* واکنش‌گرا */
@media (max-width: 768px) {
    header {
        justify-content: center;
    }
    .table-wrapper {
        overflow-x: auto;
    }
    table {
        min-width: 800px;
    }
    #back-to-top-btn {
        display: none !important; 
    }
    .back-to-home-wrapper {
        display: none;
    }
}


/* /////////////////////////////////// */
/* ========================================
   استایل جدول ساعتی 48 ساعت
======================================== */

.hourly-forecast-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hourly-forecast-container h3 {
    color: #1e40af;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 3px solid #3b82f6;
    padding-bottom: 0.5rem;
}

.hourly-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

.hourly-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    min-width: 1200px; /* حداقل عرض برای اسکرول افقی */
}

/* هدر جدول */
.hourly-table thead tr {
    background: linear-gradient(135deg, #4c63d2 0%, #3b82f6 100%);
}

.hourly-table th {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.hourly-table th:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

/* ستون پارامترها (سمت راست) */
.param-header {
    background: linear-gradient(135deg, #4c63d2 0%, #3b82f6 100%);
    color: white;
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 1rem;
    position: sticky;
    right: 0;
    z-index: 5;
    min-width: 140px;
    border-left: 2px solid #1e40af;
}

/* سلول‌های زمان */
.time-cell {
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: 60px;
}

/* سلول‌های داده */
.data-cell {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    transition: all 0.2s ease;
}

.data-cell:hover {
    background: #f3f4f6;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* رنگ‌بندی سلول‌های سرعت باد */
.wind-speed-cell {
    font-weight: 600;
}

.wind-speed-cell[data-value*="0."],
.wind-speed-cell[data-value="0"] {
    background: #d1fae5; /* سبز خیلی روشن */
}

.wind-speed-cell[data-value^="1."],
.wind-speed-cell[data-value^="2."],
.wind-speed-cell[data-value^="3."] {
    background: #a7f3d0; /* سبز روشن */
}

.wind-speed-cell[data-value^="4."],
.wind-speed-cell[data-value^="5."],
.wind-speed-cell[data-value^="6."] {
    background: #fef08a; /* زرد */
}

.wind-speed-cell[data-value^="7."],
.wind-speed-cell[data-value^="8."],
.wind-speed-cell[data-value^="9."] {
    background: #fed7aa; /* نارنجی */
}

.wind-speed-cell[data-value^="10."],
.wind-speed-cell[data-value^="11."],
.wind-speed-cell[data-value^="12."],
.wind-speed-cell[data-value^="13."] {
    background: #fca5a5; /* قرمز روشن */
}

.wind-speed-cell[data-value^="14."],
.wind-speed-cell[data-value^="15."],
.wind-speed-cell[data-value^="16."],
.wind-speed-cell[data-value^="17."],
.wind-speed-cell[data-value^="18."],
.wind-speed-cell[data-value^="19."],
.wind-speed-cell[data-value^="20"] {
    background: #f87171; /* قرمز */
    color: white;
}

/* رنگ‌بندی سلول‌های ارتفاع موج */
.wave-height-cell {
    font-weight: 600;
}

.wave-height-cell[data-value="0"],
.wave-height-cell[data-value="0.0"],
.wave-height-cell[data-value="0.00"] {
    background: #dbeafe; /* آبی خیلی روشن */
}

.wave-height-cell[data-value^="0.1"],
.wave-height-cell[data-value^="0.2"],
.wave-height-cell[data-value^="0.3"],
.wave-height-cell[data-value^="0.4"] {
    background: #bfdbfe; /* آبی روشن */
}

.wave-height-cell[data-value^="0.5"],
.wave-height-cell[data-value^="0.6"],
.wave-height-cell[data-value^="0.7"],
.wave-height-cell[data-value^="0.8"],
.wave-height-cell[data-value^="0.9"] {
    background: #93c5fd; /* آبی متوسط */
}

.wave-height-cell[data-value^="1."],
.wave-height-cell[data-value^="2."] {
    background: #60a5fa; /* آبی */
}

.wave-height-cell[data-value^="3."],
.wave-height-cell[data-value^="4."],
.wave-height-cell[data-value^="5."] {
    background: #3b82f6; /* آبی تیره */
    color: white;
}

/* سلول‌های جهت */
.direction-cell {
    font-size: 1.3rem;
    font-weight: bold;
}

/* سطرهای زوج */
.hourly-table tbody tr:nth-child(even) .data-cell {
    background: #f9fafb;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .hourly-forecast-container {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    .hourly-forecast-container h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .hourly-table {
        font-size: 0.8rem;
        min-width: 1000px;
    }
    
    .param-header {
        min-width: 100px;
        font-size: 0.8rem;
        padding: 0.6rem 0.75rem;
    }
    
    .time-cell {
        font-size: 0.75rem;
        min-width: 50px;
    }
    
    .data-cell {
        padding: 0.6rem 0.4rem;
    }
    
    .direction-cell {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .hourly-table {
        font-size: 0.75rem;
        min-width: 900px;
    }
    
    .param-header {
        min-width: 90px;
        font-size: 0.75rem;
    }
    
    .time-cell {
        font-size: 0.7rem;
        min-width: 45px;
    }
}

/* استایل اسکرول بار */
.hourly-table-wrapper::-webkit-scrollbar {
    height: 10px;
}

.hourly-table-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

.hourly-table-wrapper::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 5px;
}

.hourly-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* انیمیشن بارگذاری */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hourly-forecast-container {
    animation: fadeIn 0.5s ease-out;
}

/* استایل برای ایستگاه‌های خشکی */
.station-header.land-station {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

/* بهبود نمایش جدول اصلی در موبایل */
@media (max-width: 640px) {
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}