/* ==========================================
   1. FONTS & RESET
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

@font-face {
    font-family: 'Janna LT';
    src: url('../assets/fonts/JannaLT- Regular.ttf') format('truetype');
    font-weight: normal; font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Janna LT';
    src: url('../assets/fonts/JannaLT- Bold.ttf') format('truetype');
    font-weight: bold; font-style: normal;
    font-display: swap;
}

* {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

body {
    font-family: 'Janna LT', 'Tajawal', sans-serif;
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

/* ==========================================
   2. NAVIGATION (GLASS MORPHISM)
   ========================================== */
.glass-nav {
    background: rgba(237, 237, 237, 0.85) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    height: 5rem;
    border-bottom: 1px solid rgba(29, 29, 31, 0.05);
    z-index: 100 !important;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark .glass-nav { 
    background: rgba(29, 29, 31, 0.85) !important; 
    border-bottom: 1px solid rgba(237, 237, 237, 0.05);
}

@media (max-width: 767px) {
    .glass-nav.menu-active {
        height: auto !important;
        max-height: 550px; 
        border-bottom-left-radius: 30px;
        border-bottom-right-radius: 30px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        padding-bottom: 2rem;
    }
    #nav-content { display: none; opacity: 0; transition: opacity 0.4s ease; }
    .menu-active #nav-content { display: flex !important; opacity: 1; flex-direction: column; align-items: center; gap: 1.5rem; padding-top: 1rem; }
    .menu-active #nav-content button, .menu-active #nav-content .btn-booking-mobile { animation: slideUpFade 0.4s ease forwards; opacity: 0; }
    .menu-active #nav-content button:nth-child(1) { animation-delay: 0.1s; }
    .menu-active #nav-content button:nth-child(2) { animation-delay: 0.15s; }
    .menu-active #nav-content button:nth-child(3) { animation-delay: 0.2s; }
    .menu-active #nav-content button:nth-child(4) { animation-delay: 0.25s; }
    #theme-toggle-mobile .hidden { display: none !important; }
}

/* ==========================================
   3. BUTTONS & CARDS
   ========================================== */
.btn-booking-mobile {
    background-color: #1d1d1f !important;
    color: #ededed !important;
    padding: 14px 0 !important;
    width: 280px !important;
    max-width: 90vw;
    border-radius: 16px !important;
    font-weight: 800 !important;
    text-align: center;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

.btn-booking-mobile:active { transform: scale(0.96); background-color: #5e4b8a !important; }
.dark .btn-booking-mobile { background-color: #ededed !important; color: #1d1d1f !important; }
.dark .btn-booking-mobile:active { background-color: #f3924c !important; }

.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(29, 29, 31, 0.05);
    transition: all 0.3s ease;
}
.dark .card-shadow { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3); }

/* ==========================================
   4. UTILITIES & ANIMATIONS
   ========================================== */
.page-section { display: none; animation: fadeIn 0.4s ease-out forwards; opacity: 0; }
.page-section.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lineIn { from { width: 0; } to { width: 100%; } }
.animate-line-in { animation: lineIn 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

#menu-overlay {
    position: fixed; inset: 0; z-index: 85;
    background: rgba(0,0,0,0.02); backdrop-filter: blur(2px);
    display: none;
}

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ==========================================
   5. FLATPICKR (THE FINAL POLISH)
   ========================================== */

/* الحاوية والزر */
.flatpickr-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* عرض التاريخ والأنيميشن الموحد */
#project-date-display, #topic-date-display {
    transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease !important;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
}

/* أيقونة المسح (تأثير النجمة Star Collapse) */
.clear-icon-style {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.2s ease !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* كلاس الانكماش (يُضاف بالجافا سكربت) */
.clear-icon-star-shrink {
    transform: scale(0) rotate(-45deg) !important;
    opacity: 0 !important;
}

/* هيكل الكالندر الكلي */
.flatpickr-calendar.static {
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-top: 10px !important;
    z-index: 9999 !important;
    border-radius: 1.5rem !important;
    overflow: hidden;
    width: 320px !important;
    background: #ededed !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
    display: flex;
    flex-direction: column;
}

.dark .flatpickr-calendar.static { 
    background: #1d1d1f !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
}

.flatpickr-months, .flatpickr-weekdays { display: none !important; }

/* الهيدر المخصص داخل الرزنامة */
.homer-custom-picker-header { padding: 25px 20px 10px 20px; }

.fp-instruction-msg {
    font-size: 10px; text-align: center; margin-bottom: 15px;
    text-transform: uppercase; font-weight: 800; letter-spacing: 1px;
    color: #1d1d1f; opacity: 0.6;
}
.dark .fp-instruction-msg { color: #ededed; }

.homer-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; padding: 10px 15px; border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
}
.dark .homer-row { background: rgba(255, 255, 255, 0.05); }

.homer-custom-field {
    background: transparent; border: none; text-align: center;
    font-weight: 900; font-size: 16px; width: 60%; outline: none;
    color: #1d1d1f;
}
.dark .homer-custom-field { color: #ededed; }

.homer-side-arrow {
    background: transparent; border: none; cursor: pointer;
    display: flex; align-items: center; font-size: 22px;
    transition: all 0.2s ease; color: #1d1d1f;
}
.dark .homer-side-arrow { color: #ededed; }
.homer-side-arrow:hover { color: #f3924c !important; transform: scale(1.1); }

/* الأيام وتنسيق التوسط */
.flatpickr-innerContainer { padding: 5px 15px 15px 15px !important; }
.flatpickr-days { width: 100% !important; display: flex !important; justify-content: center !important; }
.dayContainer { width: 100% !important; min-width: 100% !important; justify-content: space-around !important; }

.flatpickr-day {
    background: transparent !important; border: none !important;
    box-shadow: none !important; color: #1d1d1f !important;
    font-weight: 700; margin: 0 !important;
}
.dark .flatpickr-day { color: #ededed !important; }

.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay {
    opacity: 0.25 !important; font-weight: 400 !important;
}

.flatpickr-day.selected {
    background: #f3924c !important; color: white !important; border-radius: 50% !important;
}

.flatpickr-day:hover:not(.selected) {
    background: rgba(243, 146, 76, 0.1) !important; color: #f3924c !important;
}

/* الأزرار السفلية (Action Bar) */
.fp-action-container {
    display: flex; flex-direction: column;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.flatpickr-internal-clear-btn {
    background: transparent; color: #f3924c; text-align: center;
    padding: 12px; cursor: pointer; font-weight: 800; font-size: 11px;
    text-transform: uppercase; letter-spacing: 1px; transition: all 0.2s;
}
.flatpickr-internal-clear-btn:hover { background: rgba(243, 146, 76, 0.1); }

.flatpickr-confirm-btn {
    background: #f3924c !important; color: white !important;
    text-align: center; padding: 18px; cursor: pointer;
    font-weight: 900; text-transform: uppercase; letter-spacing: 1px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
