/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background: #f0f2f5;
    color: #333;
}

/* ===== CONTAINER — يملأ الشاشة كاملة ===== */
.container {
    width: 100%;
    max-width: 100%;
    padding: 0 20px;
}

/* ===== TOP HEADER ===== */
.top-header {
    background: linear-gradient(90deg, #1a2f5a, #2a4a8a);
    color: white;
    padding: 8px 0;
    width: 100%;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo-section-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-item-top {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
}

.logo-item-top img { height: 55px; width: auto; object-fit: contain; }
.logo-text-top { font-size: 20px; font-weight: 900; color: white; }

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 12px;
    flex-wrap: wrap;
}

.main-nav a { color: white; font-weight: 600; font-size: 13px; }
.main-nav a:hover { color: #ffd700; }

/* ===== SUB HEADER ===== */
.sub-header {
    background: white;
    padding: 8px 0;
    border-bottom: 2px solid #e0e0e0;
    width: 100%;
}

.sub-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo-section-sub { display: flex; align-items: center; gap: 15px; }
.logo-item-sub img { height: 48px; width: auto; object-fit: contain; }

.sub-nav {
    display: flex;
    list-style: none;
    gap: 18px;
    flex-wrap: wrap;
}

.sub-nav a { color: #1a2f5a; font-weight: 700; font-size: 14px; }
.sub-nav a:hover { color: #0066cc; }

/* ===== NEWS BAR ===== */
.news-bar {
    background: linear-gradient(90deg, #102b5c, #0066cc);
    color: white;
    padding: 10px 0;
    overflow: hidden;
    width: 100%;
}

.news-flex {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.news-btn {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 7px 16px;
    border-radius: 5px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 13px;
}

.news-ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.news-ticker {
    display: inline-block;
    white-space: nowrap;
    animation: tickerMove 35s linear infinite;
    font-weight: 600;
    font-size: 14px;
    transform: translateX(100vw);
}

.news-ticker span { margin-right: 60px; }

@keyframes tickerMove {
    0%   { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* ===== MAIN NAV FIXED ===== */
.main-nav-fixed {
    background: #1a2f5a;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    width: 100%;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-flex ul {
    display: flex;
    list-style: none;
    gap: 0;
}

.nav-flex a {
    display: block;
    color: white;
    font-weight: 700;
    font-size: 16px;
    padding: 14px 24px;
    transition: background 0.2s;
}

.nav-flex a:hover,
.nav-flex a.active {
    background: #0066cc;
}

/* Hamburger Button */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 26px;
    padding: 12px 16px;
    cursor: pointer;
}

/* Mobile Nav Drawer */
.mobile-nav {
    display: none;
    flex-direction: column;
    background: #1a2f5a;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
    color: white;
    font-weight: 700;
    font-size: 15px;
    padding: 13px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: block;
}

.mobile-nav a:hover { background: #0066cc; }

/* ===== MAIN WRAPPER — يملأ الشاشة ===== */
.main-wrapper {
    display: flex;
    width: 100%;
    max-width: 100%;
    margin: 0;
    gap: 0;
    padding: 16px;
    align-items: flex-start;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    margin-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ===== LOGIN BOX ===== */
.login-box {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 12px;
    border-radius: 6px;
}

.login-box h3,
.profile-box h3 {
    background: #1a2f5a;
    color: white;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 900;
    text-align: center;
    margin: 0;
    border-radius: 0;
}

.login-box .form-group {
    padding: 0 14px;
    margin-bottom: 10px;
}

.login-box .form-group:first-of-type { margin-top: 12px; }

.login-box label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    direction: rtl;
    text-align: right;
}

.login-box label small {
    font-size: 10px;
    color: #888;
    font-weight: 400;
    display: block;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    direction: rtl;
    background: #fafafa;
    transition: border-color 0.2s;
}

.login-box input:focus {
    border-color: #0066cc;
    outline: none;
    background: white;
}

/* CAPTCHA */
.captcha-box {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 4px;
    background: #000;
    border-radius: 4px;
    border: 2px solid #444;
}

#captchaCanvas {
    border-radius: 2px;
    flex: 1;
    max-width: 100%;
    display: block;
    cursor: pointer;
}

.captcha-refresh {
    background: #1a2f5a;
    color: white;
    border: none;
    border-radius: 3px;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    transition: background 0.2s;
}

.captcha-refresh:hover { background: #0066cc; }

.login-btn {
    display: block;
    width: calc(100% - 28px);
    margin: 10px 14px 14px;
    padding: 10px;
    background: #1a3a6b;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Cairo', sans-serif;
    font-weight: 900;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.login-btn:hover { background: #0066cc; }

/* ===== PROFILE BOX ===== */
.profile-box {
    display: none;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 12px;
    overflow: hidden;
    text-align: center;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.student-img-container {
    width: 100px;
    height: 100px;
    margin: 16px auto 10px;
    border-radius: 50%;
    border: 4px solid #0066cc;
    overflow: hidden;
    background: #f0f0f0;
}

.student-img-container img { width: 100%; height: 100%; object-fit: cover; }
.student-name { font-size: 18px; font-weight: 900; color: #1a2f5a; margin-bottom: 10px; }

.student-details {
    background: #f9f9f9;
    padding: 12px;
    margin: 0 14px 12px;
    border-radius: 6px;
    text-align: right;
}

.student-details div { font-size: 13px; margin-bottom: 4px; font-weight: 600; }

.logout-btn {
    display: block;
    width: calc(100% - 28px);
    margin: 0 14px 14px;
    padding: 9px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover { background: #b02a37; }

/* ===== QUICK LINKS ===== */
.quick-links-box {
    background: #1a2f5a;
    border-radius: 6px;
    overflow: hidden;
}

.quick-links-title {
    background: #0d1e3d;
    color: white;
    padding: 11px 16px;
    font-size: 15px;
    font-weight: 900;
    text-align: center;
    border-bottom: 2px solid #0066cc;
}

.quick-links-list {
    list-style: none;
    padding: 6px 0;
    margin: 0;
}

.quick-links-list li {
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.quick-links-list li a {
    display: block;
    padding: 7px 16px;
    color: #cce0ff;
    font-size: 13px;
    font-weight: 600;
    direction: rtl;
    text-align: right;
    transition: all 0.2s;
}

.quick-links-list li a::before {
    content: "◄";
    font-size: 8px;
    margin-left: 6px;
    color: #4a90d9;
    vertical-align: middle;
}

.quick-links-list li a:hover {
    background: rgba(0,102,204,0.3);
    color: white;
    padding-right: 22px;
}

.quick-links-list li.gold a { color: #ffd700; }
.quick-links-list li.gold a::before { color: #ffd700; }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    min-width: 0;
}

.hero {
    background: linear-gradient(135deg, #1a2f5a 0%, #0066cc 100%);
    color: white;
    padding: 60px 40px;
    text-align: center;
}

.hero h1 { font-size: 36px; font-weight: 900; margin-bottom: 16px; }
.hero p { font-size: 16px; max-width: 600px; margin: 0 auto 24px; opacity: 0.9; }

.hero-btn {
    padding: 13px 36px;
    background: white;
    color: #1a2f5a;
    font-weight: 900;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: transform 0.2s;
}

.hero-btn:hover { transform: translateY(-2px); }

.cards-grid {
    padding: 30px 24px 36px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    background: white;
}

.card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-bottom: 4px solid #0066cc;
    transition: transform 0.2s;
}

.card:hover { transform: translateY(-3px); }
.card-icon { font-size: 28px; margin-bottom: 8px; }
.card h4 { font-size: 14px; font-weight: 700; color: #1a2f5a; }

/* ===== FOOTER ===== */
footer {
    background: #222;
    color: white;
    padding: 30px 20px;
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

/* ===================================================
   RESPONSIVE — TABLET (max 1024px)
   =================================================== */
@media (max-width: 1024px) {
    .sidebar { width: 240px; min-width: 240px; }
    .nav-flex a { font-size: 14px; padding: 13px 16px; }
    .hero h1 { font-size: 28px; }
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===================================================
   RESPONSIVE — MOBILE (max 768px)
   =================================================== */
@media (max-width: 768px) {

    /* Header */
    .header-flex { flex-direction: column; align-items: flex-start; gap: 8px; padding: 6px 0; }
    .main-nav ul { gap: 8px; }
    .main-nav a { font-size: 12px; }
    .logo-item-top img { height: 44px; }
    .logo-text-top { font-size: 17px; }

    /* Sub Header */
    .sub-flex { flex-direction: column; gap: 8px; text-align: center; }
    .logo-section-sub { justify-content: center; }
    .logo-item-sub img { height: 40px; }
    .sub-nav { justify-content: center; gap: 10px; }
    .sub-nav a { font-size: 12px; }

    /* News */
    .news-btn { font-size: 11px; padding: 6px 10px; }
    .news-ticker { font-size: 12px; }

    /* Nav */
    .hamburger { display: block; }
    .nav-flex ul { display: none; }

    /* Main Layout — سايدبار فوق */
    .main-wrapper {
        flex-direction: column;
        padding: 10px;
        gap: 12px;
    }

    .sidebar {
        width: 100%;
        min-width: unset;
        margin-left: 0;
        order: -1;
    }

    /* Sidebar في الموبايل يكون accordion */
    .login-box { margin-bottom: 8px; }

    /* Hero */
    .hero { padding: 36px 20px; }
    .hero h1 { font-size: 22px; }
    .hero p { font-size: 14px; }
    .hero-btn { font-size: 14px; padding: 10px 24px; }

    /* Cards */
    .cards-grid {
        padding: 16px;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* #captchaCanvas */
    #captchaCanvas { height: 44px; }

    /* sigma chat */
    #sigma-win {
        width: calc(100vw - 16px) !important;
        left: 8px !important;
        bottom: 90px !important;
        height: 75vh !important;
    }

    #sigma-btn {
        width: 56px !important;
        height: 56px !important;
        bottom: 16px !important;
        left: 16px !important;
    }

    #sigma-tip { display: none !important; }
}

/* ===================================================
   RESPONSIVE — SMALL MOBILE (max 480px)
   =================================================== */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .main-wrapper { padding: 8px; }
    .hero h1 { font-size: 19px; }
    .main-nav { display: none; } /* إخفاء nav علوي على الموبايل الصغير */
}

/* ===================================================
   LARGE SCREENS — يملأ الشاشة كاملة
   =================================================== */
@media (min-width: 1400px) {
    .main-wrapper { padding: 20px; }
    .sidebar { width: 300px; min-width: 300px; }
    .hero h1 { font-size: 42px; }
    .hero p { font-size: 18px; }
    .cards-grid { padding: 40px; }
}

@media (min-width: 1800px) {
    .sidebar { width: 320px; min-width: 320px; }
}

/* ============================================
   لوحة الشرف — Honor Roll Section
   ============================================ */

.honor-section {
    margin: 0;
    padding: 0 0 40px;
    background: #f7f9fc;
    border-top: 3px solid #e8eef5;
}

/* ===== Header ===== */
.honor-header {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 50px 30px 40px;
    margin-bottom: 10px;
}

.honor-header-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0d1e3d 0%, #1a2f5a 50%, #0066cc 100%);
    z-index: 0;
}

/* نجوم ديكور في الخلفية */
.honor-header-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,215,0,0.15) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 40px 40px, 70px 70px;
    background-position: 0 0, 20px 20px;
}

.honor-header-content {
    position: relative;
    z-index: 1;
}

.honor-crown {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    animation: crownFloat 3s ease-in-out infinite;
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.honor-header h2 {
    font-size: 32px;
    font-weight: 900;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.honor-header p {
    color: rgba(255,255,255,0.8);
    font-size: 15px;
    font-weight: 500;
}

/* ===== Filters ===== */
.honor-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 24px 20px 10px;
    flex-wrap: wrap;
}

.hf-btn {
    padding: 8px 22px;
    border: 2px solid #1a2f5a;
    border-radius: 25px;
    background: white;
    color: #1a2f5a;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s;
}

.hf-btn:hover, .hf-btn.active {
    background: #1a2f5a;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26,47,90,0.3);
}

/* ===== Grid ===== */
.honor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 24px;
}

/* ===== Card ===== */
.honor-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e8eef5;
    position: relative;
}

.honor-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(26,47,90,0.18);
}

.honor-card.hidden { display: none; }

/* Card Top */
.honor-card-top {
    background: linear-gradient(135deg, #f0f5ff, #e8f0fe);
    padding: 28px 20px 16px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #e0eaf8;
}

.honor-badge {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 22px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.honor-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 12px;
    border: 4px solid white;
    box-shadow: 0 4px 16px rgba(26,47,90,0.25);
    overflow: hidden;
    position: relative;
}

.honor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* حلقة متحركة حول الصورة */
.honor-avatar::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #0066cc;
    border-right-color: #ffd700;
    animation: avatarSpin 4s linear infinite;
}

@keyframes avatarSpin {
    to { transform: rotate(360deg); }
}

.honor-dept-tag {
    display: inline-block;
    background: #1a2f5a;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
}

/* Card Body */
.honor-card-body {
    padding: 18px 18px 16px;
    direction: rtl;
    text-align: right;
}

.honor-name {
    font-size: 18px;
    font-weight: 900;
    color: #1a2f5a;
    margin-bottom: 6px;
}

.honor-achievement {
    font-size: 13px;
    font-weight: 700;
    color: #0066cc;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.honor-star { font-size: 14px; }

.honor-desc {
    font-size: 12.5px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.honor-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.htag {
    background: #f0f5ff;
    color: #1a2f5a;
    border: 1px solid #c8d8f0;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
}

/* ===== Stats Bar ===== */
.honor-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin: 10px 24px 0;
    background: linear-gradient(90deg, #0d1e3d, #1a2f5a);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(26,47,90,0.3);
}

.hstat {
    text-align: center;
    padding: 24px 10px;
    border-left: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.hstat:last-child { border-left: none; }

.hstat-num {
    font-size: 38px;
    font-weight: 900;
    color: #ffd700;
    line-height: 1;
    margin-bottom: 6px;
    direction: ltr;
}

.hstat-num::after { content: '+'; font-size: 24px; }

.hstat-label {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    font-weight: 600;
}

/* ============================================
   RESPONSIVE — Honor Roll
   ============================================ */
@media (max-width: 1024px) {
    .honor-grid { grid-template-columns: repeat(2, 1fr); }
    .honor-stats { grid-template-columns: repeat(2, 1fr); }
    .hstat { border-bottom: 1px solid rgba(255,255,255,0.1); }
}

@media (max-width: 768px) {
    .honor-header h2 { font-size: 22px; }
    .honor-crown { font-size: 36px; }
    .honor-grid {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 14px;
    }
    .honor-stats {
        grid-template-columns: repeat(2, 1fr);
        margin: 10px 14px 0;
    }
    .hstat-num { font-size: 28px; }
}

@media (max-width: 480px) {
    .honor-stats { grid-template-columns: 1fr 1fr; }
    .hf-btn { font-size: 12px; padding: 7px 16px; }
}

@keyframes fadeInCard {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
