/* ======================================================
    dashboard.css
    ClassMate — FINAL VERSION (All fixes included)
    ====================================================== */

/* -------------------- Root Variables -------------------- */
:root {
    --brand-blue: #0a2a43;
    --brand-blue-dark: #081f36;
    --accent-yellow: #ffc107;
    --bg: #f5f8fb;
    --card-bg: #ffffff;
    --text-color: #343a40;
    --text-muted: #6f8598;
    --border-color: rgba(10, 42, 67, 0.08);
    --shadow-1: 0 6px 18px rgba(9, 27, 45, 0.06);
    --shadow-2: 0 12px 30px rgba(10, 42, 67, 0.12);
    --radius: 12px;
    --transition: 250ms ease;
    --container-width: 1200px;
    --font-family: "Cairo", system-ui, sans-serif;
}

/* -------------------- Reset / Base -------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    height: 100%;
}
body {
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.container {
    width: min(96%, var(--container-width));
    margin-inline: auto;
}
a {
    text-decoration: none;
    color: var(--brand-blue);
}

/* -------------------- Header / Navbar -------------------- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1400;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--border-color);
}
.nav-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* ==== MODIFIED: Reduced fixed height ==== */
    height: 80px; /* Reduced to a more standard navbar height */
}
.logo {
    position: absolute;
    left: 50%;
    /* ==== MODIFIED: Vertically center logo, adjusted for smaller height ==== */
    top: 50%; /* New: Center vertically */
    transform: translate(-50%, -50%); /* New: Adjust translation for vertical centering */
}
.logo img {
    /* ==== MODIFIED: Adjusted logo size ==== */
    height: 150px; /* Still larger than standard, but fits better */
    object-fit: contain;
    display: block;
}

/* --- Hamburger Button --- */
#menu-toggle {
    order: 3; /* Swapped with profile icon */
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 46px;
    height: 46px;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 1;
}
#menu-toggle .bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--brand-blue);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}
#menu-toggle.open .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
#menu-toggle.open .bar:nth-child(2) {
    opacity: 0;
}
#menu-toggle.open .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- Profile Dropdown --- */
/* Profile Dropdown - نهائي */
.profile-wrapper {
    position: relative;
}
.profile-pic {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: transform var(--transition);
}
.profile-pic:hover {
    transform: translateY(-2px);
}

/* القائمة مخفية افتراضياً */
.profile-menu {
    display: none; /* افتراضي */
    position: absolute;
    top: 60px;
    right: 0;
    min-width: 200px;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow-2);
    border: 1px solid var(--border-color);
    z-index: 2000; /* أعلى من أي حاجة تانية */
}

.profile-menu.active {
    display: flex;
}

.profile-menu a {
    padding: 10px 12px;
    font-weight: 600;
    border-radius: 8px;
    transition: background var(--transition);
}
.profile-menu a:hover {
    background: rgba(10, 42, 67, 0.04);
}

/* -------------------- Sidebar -------------------- */
#sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 1200;
}
#sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
#sidebar {
    position: fixed;       /* ثابت بالنسبة للشاشة */
    top: 0;                /* يلتصق بأعلى الشاشة */
    left: -320px;          /* يظل مخفي في البداية */
    width: 320px;          /* عرض القائمة */
    height: 100vh;         /* يغطي كامل ارتفاع الشاشة */
    background: #fff;      /* خلفية بيضاء */
    box-shadow: 0 20px 40px rgba(6, 22, 34, 0.12);
    padding: 22px;
    transition: left 320ms ease;
    z-index: 1500;         /* أعلى من النيف بار */
    display: flex;
    flex-direction: column;
}

#sidebar.active {
    left: 0;
}
#close-btn {
    background: transparent;
    border: none;
    font-size: 26px;
    color: var(--brand-blue);
    cursor: pointer;
    align-self: flex-end;
    margin-bottom: 12px;
}
#sidebar nav ul {
    list-style: none;
}
#sidebar nav li {
    margin-bottom: 10px;
}
#sidebar nav a {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    color: var(--brand-blue-dark);
    border-radius: 8px;
    font-weight: 700;
    transition: background var(--transition), transform var(--transition);
}
#sidebar nav a:hover {
    background: rgba(10, 42, 67, 0.03);
    transform: translateX(4px);
}
#sidebar nav a i {
    font-size: 18px;
    color: var(--accent-yellow);
    width: 20px;
    text-align: center;
}
.soon-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 800;
    background: #e9eef6;
    color: var(--brand-blue-dark);
    font-size: 12px;
    margin-inline-start: auto;
}
#sidebar .cta-btn.disabled {
    margin-top: auto;
    opacity: 0.8;
    cursor: not-allowed;
}

/* -------------------- Main Content -------------------- */
/* ==== MODIFIED: Smaller and Tighter Motto Style ==== */
.hero-motto {
    text-transform: uppercase;
    color: var(--brand-blue-dark);
    font-size: 0.75rem;
    font-weight: 1000; /* Corrected: Max standard value is 900 */
    letter-spacing: 10px; /* MODIFIED: Reduced from 1.8px to bring letters closer */
    text-align: center;
    margin: 24px 0;
    line-height: 1.5;
}

.hero-motto .m-letter {
    color: var(--accent-yellow);
    font-size: 1.05rem;
    font-weight: 900; /* Corrected: Max standard value is 900 */
}
.hero-motto .m-rest {
    /* This space is between the full words (e.g., after 'LEARNING') */
    margin-inline-end: 0.3em;
}
.hero-section {
    padding: 28px;
    border-radius: 16px;
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    box-shadow: var(--shadow-1);
}
.hero-text h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}
.hero-text p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 1rem;
}
.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.cta-button {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 800;
    color: #fff;
    background: var(--brand-blue);
    transition: transform var(--transition), box-shadow var(--transition);
}
.cta-button:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2);
}
.cta-button.secondary {
    background: transparent;
    color: var(--brand-blue-dark);
    border: 2px solid var(--accent-yellow);
    padding: 8px 14px;
}
.cta-button.secondary:hover {
    background: var(--accent-yellow);
    color: var(--brand-blue);
}
.hero-image {
    width: 240px;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
}

/* --- Launch / Stats Card --- */
.launch-section {
    margin: 32px auto;
}
.launch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-1);
    flex-wrap: wrap;
}
.launch-info {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.launch-date .day {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--brand-blue);
}
.launch-date .month {
    font-size: 1.1rem;
    color: var(--brand-blue-dark);
    font-weight: 700;
}
.launch-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}
.launch-subtext {
    color: var(--text-muted);
    margin: 4px 0 0;
    font-size: 0.95rem;
}
.launch-stats {
    min-width: 180px;
    text-align: center;
    padding-right: 24px;
    border-right: 2px solid var(--border-color);
}
.launch-stats .days-count {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--brand-blue);
    line-height: 1;
}
.launch-stats p {
    margin: 0;
    font-weight: 600;
    color: var(--text-muted);
}
.countdown-container {
    display: flex;
    gap: 15px;
    text-align: center;
    direction: ltr;
}
.countdown-box span {
    font-size: 2rem;
    font-weight: 700;
}

/* --- Cards Section --- */
.cards-section {
    margin: 32px auto;
}
.cards-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 800;
}
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2);
}
.card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 700;
}
.card p {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 0.95rem;
    flex-grow: 1;
}
.card-btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--brand-blue);
    color: #fff;
    font-weight: 700;
    align-self: flex-start;
    transition: background-color var(--transition);
}
.card-btn:hover {
    background: var(--brand-blue-dark);
}

/* -------------------- Footer -------------------- */
.site-footer {
    background: var(--brand-blue-dark);
    color: #fff;
    padding: 56px 0 36px;
    margin-top: 40px;
}
.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
    align-items: start;
}
.footer-logo img {
    height: 150px;
    margin-bottom: 12px;
}
.footer-col p {
    color: #dbeaf7;
}
.footer-col h4 {
    color: var(--accent-yellow);
    margin-bottom: 16px;
    font-weight: 800;
}
.footer-col ul {
    list-style: none;
}
.footer-col li {
    margin-bottom: 10px;
}
.footer-col a {
    color: #dbeaf7;
    font-weight: 600;
    transition: color var(--transition);
}
.footer-col a:hover {
    color: var(--accent-yellow);
}
.footer-bottom {
    text-align: center;
    color: #cfe4fb;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.92rem;
}
.social-links {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    align-items: center;
}
.social-links a {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transition: transform var(--transition), background var(--transition);
}
.social-links a:hover {
    transform: translateY(-4px);
    background: var(--accent-yellow);
    color: var(--brand-blue);
}

/* =================================== */
/* ===   تنسيق كارت مجتمع ICPC   === */
/* =================================== */

/* القسم الذي يحتوي على الكارت */
.community-section {
    margin-bottom: 50px;
}

/* الرابط الذي يغلف الكارت بالكامل */
.community-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* الكارت نفسه مع تحسينات بصرية */
.community-card {
    display: flex;
    align-items: center;
    gap: 25px;
    /* إضافة تدرج لوني خفيف جدًا للخلفية */
    background: linear-gradient(135deg, var(--card-bg) 95%, #f7f9fc 100%);
    padding: 25px;
    border-radius: var(--radius);
    border: 2px solid var(--border-light); /* زيادة سمك الإطار قليلاً */
    transition: var(--transition);
}

/* شعار المجتمع داخل الكارت */
.community-logo {
    width: 170px;
    height: 170px;
    object-fit: contain;
    flex-shrink: 0;
    transition: var(--transition); /* إضافة حركة ناعمة للشعار */
}

/* حاوية النص (العنوان والوصف) */
.community-text {
    flex-grow: 1;
}

.community-text h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    color: var(--brand-blue-dark);
    transition: var(--transition); /* إضافة حركة ناعمة للعنوان */
}

.community-text p {
    color: var(--muted);
    font-size: 1rem;
    margin: 0;
}

/* أيقونة السهم في نهاية الكارت */
.community-card .fa-arrow-left {
    font-size: 1.5rem;
    color: var(--muted);
    transition: var(--transition); /* إضافة حركة ناعمة للسهم */
}


/* =============================================== */
/* ===   التأثيرات عند مرور الماوس (Hover)   === */
/* =============================================== */

/* عند مرور الماوس فوق الرابط، طبق هذه التأثيرات على الكارت */
.community-card-link:hover .community-card {
    transform: translateY(-8px);      /* رفع الكارت للأعلى أكثر */
    box-shadow: var(--shadow);        /* إضافة الظل */
    border-color: var(--accent-yellow); /* تغيير لون الإطار إلى الأصفر */
}

/* عند مرور الماوس، طبق هذه التأثيرات على الشعار */
.community-card-link:hover .community-logo {
    transform: scale(1.1) rotate(5deg); /* تكبير الشعار وتدويره قليلاً */
}

/* عند مرور الماوس، طبق هذه التأثيرات على العنوان */
.community-card-link:hover .community-text h3 {
    color: var(--accent-yellow); /* تغيير لون العنوان إلى الأصفر */
}

/* عند مرور الماوس، طبق هذه التأثيرات على السهم */
.community-card-link:hover .community-card .fa-arrow-left {
    color: var(--brand-blue-dark); /* تغيير لون السهم للون الداكن */
    transform: translateX(-8px);   /* تحريك السهم لليسار */
}

/* -------------------- Responsive Design -------------------- */
/* ======================================================
   ============== MEDIA QUERIES (Mobile First) ==============
   ====================================================== */

/* --- For Tablets & Mobile Phones (Screens smaller than 768px) --- */
@media (max-width: 768px) {
    
    /* ---------- Header & Navigation ---------- */
    .nav-container {
        height: 65px; /* ارتفاع ثابت ومناسب للموبايل */
        justify-content: space-between;
    }

    .logo {
        position: static;   /* إلغاء التموضع المطلق */
        transform: none;
        order: 2;           /* اللوجو هو العنصر الثاني في الترتيب */
    }

    .logo img {
        height: 45px;       /* حجم لوجو مناسب لشريط الموبايل */
    }

    .profile-wrapper {
        order: 1;           /* أيقونة البروفايل هي العنصر الأول */
    }

    #menu-toggle {
        order: 3;           /* أيقونة القائمة هي العنصر الأخير */
    }

    /* ---------- Sidebar ---------- */
    #sidebar {
        width: 85%;
        left: -85%;
    }
    
    /* ---------- Hero Section ---------- */
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .hero-image {
        display: none;      /* إخفاء الصورة الكبيرة تماماً على الموبايل */
    }
    
    .hero-buttons {
        justify-content: center;
    }

    .hero-motto {
        font-size: 0.7rem;
        letter-spacing: 1.2px;
    }

    /* ---------- Other Sections ---------- */
    .launch-card {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .launch-stats {
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding-top: 20px;
        width: 100%;
    }
    .cards-section h2 {
        font-size: 1.3rem;
        text-align: center;
    }

    /* ---------- Community Card ---------- */
    .community-card {
        flex-direction: column;
        text-align: center;
    }

    .community-logo {
        width: 120px;
        height: 120px;
    }
    
    .community-card .fa-arrow-left {
        display: none; /* إخفاء السهم على الموبايل لتوفير مساحة */
    }

    /* ---------- Footer ---------- */
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .social-links, .footer-logo {
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
    }
}

/* -------------------- Sidebar -------------------- */
#sidebar {
    position: fixed;
    top: 0;
    left: -320px; /* نرجعها زي الأول */
    width: 320px; /* عرض القائمة */
    height: 100vh;
    background: #fff;
    box-shadow: 0 20px 40px rgba(6, 22, 34, 0.12);
    padding: 22px;
    transition: left 320ms ease;
    z-index: 1500;
    display: flex;
    flex-direction: column;
}

#sidebar.active {
    left: 0;
}

/* -------------------- Hamburger Button -------------------- */
#menu-toggle {
    order: 3;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 46px;
    height: 46px;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 1600;
    position: relative;
}

/* -------------------- Mobile Adjustments -------------------- */
/* ==============================================
   داخل @media (max-width: 768px)
   ============================================== */

/* ---------- Header & Navigation ---------- */
.nav-container {
    height: 85px; /* ✨ زيادة ارتفاع الشريط العلوي لإعطاء مساحة للوجو */
    justify-content: space-between;
}

.logo {
    position: static;   /* إلغاء التموضع المطلق */
    transform: none;
    order: 2;           /* اللوجو في المنتصف */
}

.logo img {
    height: 70px;       /* ✨ تكبير حجم اللوجو ليكون أكثر وضوحًا وتناسبًا */
}

.profile-wrapper {
    order: 1;           /* أيقونة البروفايل على اليمين */
}

#menu-toggle {
    order: 3;           /* أيقونة القائمة على اليسار */
}