/* إعدادات الخطوط والتناسق العام */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #121826, #1a233a); /* ألوان داكنة ناعمة تشبه واجهات Samsung One UI */
    color: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-tap-highlight-color: transparent; /* إزالة الوميض الأزرق عند الضغط في الهاتف */
}

/* الهيكل الرئيسي للموقع */
.main-layout {
    width: 100%;
    max-width: 950px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* الألواح الزجاجية بتصميم ناعم وملموم (Samsung Style) */
.primary-panel, .secondary-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px; /* حواف دائرية ناعمة جداً */
    padding: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.secondary-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* تنسيق الساعة في الهاتف (صغيرة وغير ضخمة) */
.clock-box {
    text-align: center;
    margin-bottom: 5px;
}

.clock {
    font-size: 2.2em; /* حجم ملموم يناسب شاشة الهاتف */
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 1px;
    color: #ffffff;
}

/* قسم الطقس الحالي */
.weather {
    text-align: center;
}

.weather h2 {
    font-size: 1.3em;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 12px;
}

.weather-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* أيقونة الطقس - حجم ملموم */
.weather-icon {
    width: 70px;
    height: 70px;
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.15));
}

#temperature {
    font-size: 1.5em;
    font-weight: bold;
    color: #ffffff;
}

#description {
    font-size: 1em;
    color: #cbd5e1;
}

.loading-text {
    opacity: 0.6;
    font-size: 0.9em !important;
    font-style: italic;
}

/* عناوين الأقسام الحركية */
.forecast-section {
    text-align: right;
}

.forecast-section h3 {
    font-size: 1em;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 12px;
    padding-right: 4px;
}

/* الطقس بالساعات (أفقي وسلس جداً باللمس مثل التطبيقات الأصلية) */
.hourly-forecast {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 8px;
    scrollbar-width: none; /* إخفاء السكرول بار في فايرفوكس */
}

.hourly-forecast::-webkit-scrollbar {
    display: none; /* إخفاء السكرول بار في كروم وسفاري للظهور كـ تطبيق */
}

.forecast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 10px;
    border-radius: 16px;
    min-width: 65px;
    flex-shrink: 0;
    gap: 2px;
}

.forecast-item span {
    font-size: 0.78em;
    color: #94a3b8;
}

.forecast-item img {
    width: 36px;
    height: 36px;
}

.forecast-item grand {
    font-size: 0.9em;
    font-weight: 600;
}

/* الطقس بالأيام (قائمة ملمومة ومنظمة) */
.daily-forecast {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.daily-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.day-name {
    width: 80px;
    font-size: 0.9em;
    font-weight: 600;
    color: #f1f5f9;
}

.day-desc {
    font-size: 0.85em;
    color: #94a3b8;
    flex-grow: 1;
    text-align: right;
    padding-right: 12px;
}

.daily-item img {
    width: 32px;
    height: 32px;
}

.daily-item strong {
    font-size: 0.95em;
    color: #ffffff;
    width: 45px;
    text-align: left;
}

/* زر تحميل التطبيق (ناعم ومناسب للإبهام بدون ما يكون ضخم) */
.download-section {
    margin-top: 16px;
    text-align: center;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #2563eb; /* أزرق سامسونج الكلاسيكي المريح */
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    font-size: 0.95em;
    font-weight: 600;
    border-radius: 16px;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
    max-width: 280px; /* تحديد العرض في الهاتف لكي لا يتمدد بشكل قبيح */
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-download:active {
    transform: scale(0.98); /* تأثير الضغط الخفيف مثل التطبيقات الحقيقية */
    background: #1d4ed8;
}

.download-icon {
    width: 18px;
    height: 18px;
}

/* الفوتر */
.site-footer {
    margin-top: auto;
    padding: 16px;
    font-size: 0.75em;
    color: #64748b;
    text-align: center;
}

.visual-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ========================================================
   التناسق التلقائي مع شاشات الكمبيوتر (Desktop)
   ======================================================== */
@media (min-width: 768px) {
    .main-layout {
        display: grid;
        grid-template-columns: 4fr 5fr; /* تقسيم الشاشة لجهتين متناسقتين */
        gap: 24px;
        margin-top: 60px;
    }
    
    .primary-panel {
        position: sticky;
        top: 24px;
        padding: 30px;
    }
    
    .secondary-panel {
        padding: 30px;
    }

    .clock {
        font-size: 3.2em; /* حجم أكبر ومناسب للشاشات الكبيرة */
    }

    .weather h2 {
        font-size: 1.6em;
    }

    #temperature {
        font-size: 2em;
    }

    .btn-download {
        max-width: 100%; /* تمدد متناسق داخل اللوحة في الكمبيوتر */
    }
}
