/* Jadara Portal design layer — focused, motion-aware, and RTL-first. */
:root {
    --motion-fast: 160ms;
    --motion-base: 260ms;
    --motion-slow: 620ms;
    --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --focus-ring: #7dd3fc;
    --shell-line: rgba(148, 163, 184, 0.16);
    --shell-glow: rgba(99, 102, 241, 0.22);
    --text-muted: #94a3b8;
}

html {
    scroll-padding-top: 130px;
}

body {
    min-width: 320px;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 100000;
    top: 12px;
    right: 16px;
    padding: 10px 16px;
    border: 1px solid var(--focus-ring);
    border-radius: 12px;
    color: #fff;
    background: #172554;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.45);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.view-announcer {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

.site-topbar {
    isolation: isolate;
}

.site-topbar::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(105deg, rgba(125, 211, 252, 0.08), transparent 28%, rgba(167, 139, 250, 0.09));
}

.site-nav-link,
.theme-toggle,
.brand {
    min-height: 44px;
}

.brand-title {
    display: block;
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1.35;
}

.site-nav-link[aria-current="page"] {
    color: #fff;
}

.portal-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), inset 0 -70px 100px rgba(2, 6, 23, 0.16);
}

.banner-content {
    z-index: 2;
}

.banner-title {
    max-width: 15ch;
    text-wrap: balance;
    letter-spacing: -0.025em;
}

.banner-desc {
    max-width: 68ch;
    text-wrap: pretty;
}

.portal-card {
    --spotlight-x: 50%;
    --spotlight-y: 45%;
    contain: layout paint;
    transition:
        transform var(--motion-base) var(--motion-ease),
        border-color var(--motion-base) ease,
        box-shadow var(--motion-base) ease;
}

.portal-card::after {
    content: "";
    position: absolute;
    z-index: 4;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(340px circle at var(--spotlight-x) var(--spotlight-y), rgba(125, 211, 252, 0.13), transparent 62%);
    transition: opacity var(--motion-base) ease;
}

.portal-card:hover::after,
.portal-card:focus-visible::after {
    opacity: 1;
}

.portal-card-image {
    will-change: transform;
}

.motion-enhanced [data-reveal] {
    transition:
        opacity var(--motion-slow) var(--motion-ease),
        transform var(--motion-slow) var(--motion-ease);
    transition-delay: calc(var(--reveal-order, 0) * 45ms);
}

.motion-enhanced [data-reveal]:not(.is-visible):not(.portal-card) {
    opacity: 0;
    transform: translateY(18px) scale(0.992);
}

.view-enter {
    animation: viewEnter var(--motion-base) var(--motion-ease) both;
}

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

[data-theme="light"] {
    --shell-line: rgba(15, 23, 42, 0.12);
    --shell-glow: rgba(37, 99, 235, 0.14);
    --text-muted: #64748b;
}

[data-theme="light"] .site-nav-link {
    color: #334155;
}

[data-theme="light"] .site-nav-link:hover {
    color: #0f172a;
    background: rgba(37, 99, 235, 0.1);
}

[data-theme="light"] .portal-card-link {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.22);
}

[data-theme="light"] .library-subtitle-main,
[data-theme="light"] .tree-level-description,
[data-theme="light"] .portal-card-body p {
    color: #475569;
}

[data-theme="light"] :where(input:not([type="button"]):not([type="submit"]):not([type="reset"]), select, textarea, .form-control) {
    color: #0f172a !important;
    background-color: rgba(248, 250, 252, 0.96) !important;
    border-color: rgba(15, 23, 42, 0.16) !important;
}

[data-theme="light"] :where(input, textarea)::placeholder {
    color: #64748b !important;
    opacity: 1;
}

@media (max-width: 640px) {
    html {
        scroll-padding-top: 176px;
    }

    .app-container {
        width: 100%;
        padding: 10px 10px calc(88px + env(safe-area-inset-bottom));
    }

    .site-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        top: 6px;
        padding: 10px;
        margin-bottom: 14px;
    }

    .site-topbar .brand {
        min-width: 0;
    }

    .site-topbar .brand-info {
        min-width: 0;
    }

    .site-topbar .brand-title {
        font-size: 1rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-nav {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        padding: 4px;
        overflow: visible;
        gap: 4px;
    }

    .site-nav-link {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 8px 5px;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.72rem;
    }

    .portal-banner {
        min-height: 500px;
        padding: 24px 20px;
        border-radius: 24px;
        align-items: flex-end;
    }

    .banner-content {
        width: 100%;
    }

    .banner-title {
        max-width: 13ch;
        font-size: clamp(2rem, 10vw, 2.75rem);
        line-height: 1.08;
    }

    .banner-desc {
        font-size: 0.9rem;
        line-height: 1.8;
    }

    .student-welcome-box {
        width: 100%;
        max-width: none;
    }

    #btn-edit-student-name {
        width: 44px;
        height: 44px;
        display: inline-grid;
        place-items: center;
    }

    .portal-card {
        min-height: 348px;
    }

    #floating-actions-container {
        right: 12px !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    }

    #btn-chatbot-toggle,
    #btn-floating-suggest {
        width: 52px !important;
        height: 52px !important;
    }

    #chatbot-panel {
        right: 10px !important;
        bottom: calc(76px + env(safe-area-inset-bottom)) !important;
        width: calc(100vw - 20px) !important;
        max-width: none !important;
        height: min(560px, calc(100dvh - 96px)) !important;
        max-height: calc(100dvh - 96px) !important;
        border-radius: 20px !important;
    }
}

/* Institutional university header — restrained, durable, and RTL-first. */
.site-topbar {
    --header-navy: #0f2744;
    --header-navy-soft: #183a60;
    --header-gold: #c8a45a;
    min-height: 70px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 8px 16px !important;
    overflow: visible !important;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background: rgba(10, 24, 43, 0.98);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.site-topbar::before {
    z-index: 1;
    inset: 0 0 auto;
    height: 3px;
    border-radius: 0;
    background: linear-gradient(90deg, transparent 4%, var(--header-gold) 30%, var(--header-gold) 70%, transparent 96%);
    opacity: 0.9;
}

[data-theme="light"] .site-topbar {
    border-color: #dbe3ec;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 30px rgba(15, 39, 68, 0.1);
}

.site-topbar .brand {
    align-self: stretch;
    min-width: 0;
    min-height: 74px;
    gap: 12px;
    padding: 0 2px;
    border-radius: 0;
}

.site-topbar .brand:hover {
    background: transparent;
}

.site-topbar .brand-icon {
    position: relative;
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: #fff;
    background: var(--header-navy);
    box-shadow: none;
    filter: none;
}

.site-topbar .brand-icon::after {
    content: none;
}

.site-topbar .brand-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* بطاقات الكليات المصورة */
#unified-colleges-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
}

#unified-colleges-grid .college-card.tree-college-card {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    min-height: 380px;
    padding: 0 !important;
    overflow: hidden !important;
    gap: 0 !important;
    border-radius: 22px !important;
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.65) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.35) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease !important;
}

.tree-college-card .college-card-media {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16 / 10 !important;
    min-height: 180px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 22px 22px 0 0 !important;
    background: linear-gradient(135deg, #102a43, #1e3a5f);
}

.tree-college-card .college-card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(7, 17, 31, 0.65));
    pointer-events: none;
}

.tree-college-card .college-card-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 320ms ease;
}

.tree-college-card:hover .college-card-image {
    transform: scale(1.05);
}

.tree-college-card .college-card-icon {
    position: absolute;
    z-index: 1;
    right: 16px;
    bottom: 14px;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 14px;
    background: rgba(7, 17, 31, 0.78);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.24);
    color: #fff;
    font-size: 1.45rem;
    backdrop-filter: blur(10px);
}

.tree-college-card .college-card-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    min-width: 0;
    padding: 18px 20px 20px;
}

.tree-college-card .college-card-info h3 {
    margin: 0;
    font-size: 1.12rem;
}

.tree-college-card .college-card-description {
    margin: 4px 0 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tree-college-stats,
.tree-college-card .tree-college-stats {
    display: none !important;
}

.tree-college-card .college-card-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    width: fit-content;
    color: #38bdf8;
    font-size: 0.84rem;
    font-weight: 800;
}

.tree-college-card .college-card-action span {
    transition: transform 180ms ease;
}

.tree-college-card:hover .college-card-action span {
    transform: translateX(-4px);
}

[data-theme="light"] .tree-college-card .college-card-action {
    color: #1d4ed8;
}

.college-detail-large-icon.has-image {
    flex: 0 0 clamp(96px, 11vw, 132px);
    width: clamp(96px, 11vw, 132px);
    height: clamp(68px, 8vw, 92px);
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--shell-line);
}

.college-detail-large-icon.has-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   📱 Perfect Mobile Experience (بدون تشتت ومعلومات مكثفة وسلسة)
   ========================================================================== */
@media (max-width: 768px) {
    /* شريط التنقل العلوي بالهاتف قابل للسحب الأفقي بسلاسة تامة */
    .site-nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 6px !important;
        padding: 4px 2px !important;
        width: 100% !important;
    }

    .site-nav::-webkit-scrollbar {
        display: none !important;
    }

    .site-nav-link {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 8px 14px !important;
        font-size: 0.85rem !important;
        border-radius: 10px !important;
    }

    /* شبكة الكليات والخدمات بالهاتف بحجم مريح دون ازدحام */
    #unified-colleges-grid,
    .portal-grid,
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .college-card.tree-college-card {
        min-height: auto !important;
        padding: 0 !important;
        overflow: hidden !important;
        border-radius: 18px !important;
    }

    .tree-college-card .college-card-media {
        width: 100% !important;
        height: 175px !important;
        min-height: 175px !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 18px 18px 0 0 !important;
    }

    .tree-college-card .college-card-top {
        padding: 16px 18px !important;
        gap: 8px !important;
    }

    .college-card-info h3 {
        font-size: 1.08rem !important;
        margin-bottom: 2px !important;
    }

    .college-card-description {
        font-size: 0.82rem !important;
        line-height: 1.45 !important;
    }

    /* تحسين البانر وصندوق الترحيب للهاتف */
    .portal-banner {
        border-radius: 18px !important;
        padding: 16px 14px !important;
        margin-bottom: 14px !important;
    }

    .student-welcome-box {
        padding: 12px 14px !important;
        border-radius: 14px !important;
        margin-top: 10px !important;
    }

    .student-welcome-box h2 {
        font-size: 1.05rem !important;
    }

    .student-welcome-box p {
        font-size: 0.8rem !important;
    }

    .college-detail-large-icon.has-image {
        flex-basis: 72px;
        width: 72px;
        height: 54px;
        border-radius: 12px;
    }

    /* 💳 تحويل جدول الرسوم إلى بطاقات واضحة على شاشات الهواتف */
    .fees-responsive-table,
    .fees-responsive-table tbody,
    .fees-responsive-table tr,
    .fees-responsive-table td {
        display: block !important;
        width: 100% !important;
    }

    .fees-responsive-table thead {
        display: none !important;
    }

    .fees-responsive-table tr {
        background: linear-gradient(165deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.7) 100%) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 16px !important;
        padding: 14px 16px !important;
        margin-bottom: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
    }

    [data-theme="light"] .fees-responsive-table tr {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    }

    .fees-responsive-table td {
        padding: 4px 0 !important;
        border: none !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: left !important;
    }

    .fees-responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
        font-size: 0.82rem;
        margin-left: auto;
    }
}

/* 💎 شارات الرسوم والتخصصات فائقة الفخامة (Desktop & Mobile Luxury Badges) */
.fees-college-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
}

.fee-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.fee-badge.fee-badge-low {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.fee-badge.fee-badge-mid {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.fee-badge.fee-badge-high {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.min-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 800;
}

.min-badge.min-badge-jor {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.min-badge.min-badge-int {
    background: rgba(168, 85, 247, 0.14);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #d8b4fe;
}

@media (prefers-reduced-motion: reduce) {
    .tree-college-card .college-card-image,
    .tree-college-card .college-card-action span {
        transition: none;
    }
}

.site-topbar .brand-info {
    min-width: 0;
}

.site-topbar .brand-title {
    color: #f8fafc;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.site-topbar .brand-info p {
    display: none !important;
}

[data-theme="light"] .site-topbar .brand-title {
    color: var(--header-navy);
}

.site-topbar .site-nav {
    align-self: center;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 3px !important;
    padding: 0 2px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

[data-theme="light"] .site-topbar .site-nav {
    background: transparent;
}

.site-topbar .site-nav-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 8px !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 8px !important;
    color: #aebdce !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0.77rem !important;
    font-weight: 750 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: color var(--motion-fast) ease, background-color var(--motion-fast) ease, border-color var(--motion-fast) ease !important;
}

.site-topbar .site-nav-link::after {
    display: none !important;
}

.site-topbar .site-nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.site-topbar .site-nav-link.active,
.site-topbar .site-nav-link[aria-current="page"] {
    color: #fff !important;
    border-bottom-color: var(--header-gold) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: none !important;
}

[data-theme="light"] .site-topbar .site-nav-link {
    color: #526175 !important;
}

[data-theme="light"] .site-topbar .site-nav-link:hover {
    color: var(--header-navy) !important;
    background: #f6f8fb !important;
}

[data-theme="light"] .site-topbar .site-nav-link.active,
[data-theme="light"] .site-topbar .site-nav-link[aria-current="page"] {
    color: var(--header-navy) !important;
    border-bottom-color: var(--header-gold) !important;
    background: #f7f9fc !important;
}

.site-topbar .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
    justify-content: flex-end !important;
}

.site-topbar .portal-connection-status {
    display: none !important;
}
    color: #e3c98d;
    background: transparent;
}

.site-topbar .portal-connection-status.is-offline::before {
    background: #d5a647;
    box-shadow: 0 0 0 3px rgba(213, 166, 71, 0.14);
}

[data-theme="light"] .site-topbar .portal-connection-status {
    color: #337052;
}

[data-theme="light"] .site-topbar .portal-connection-status.is-offline {
    color: #8a641f;
}

.site-topbar .theme-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(174, 189, 206, 0.25);
    border-radius: 10px;
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: none;
    font-size: 1.12rem;
}

.site-topbar .theme-toggle:hover {
    border-color: rgba(200, 164, 90, 0.7);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    transform: none;
}

[data-theme="light"] .site-topbar .theme-toggle {
    border-color: #dbe3ec;
    color: var(--header-navy);
    background: #f7f9fc;
}

[data-theme="light"] .site-topbar .theme-toggle:hover {
    border-color: #c8a45a;
    background: #fff;
}

@media (max-width: 1080px) {
    .site-topbar {
        min-height: auto;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0 14px;
        padding: 0 14px 9px;
    }

    .site-topbar .brand {
        min-height: 68px;
    }

    .site-topbar .site-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: calc(100% + 28px);
        margin-inline: -14px;
        padding-inline: 8px;
        overflow-x: auto;
        border-top: 1px solid rgba(148, 163, 184, 0.16);
        scrollbar-width: none;
    }

    .site-topbar .site-nav::-webkit-scrollbar {
        display: none;
    }

    .site-topbar .site-nav-link {
        flex: 0 0 auto;
        min-height: 50px;
    }
}

@media (max-width: 640px) {
    .site-topbar {
        top: 6px;
        gap: 0 8px;
        padding: 0 10px 8px;
        border-radius: 12px;
    }

    .site-topbar .brand {
        min-height: 62px;
        gap: 9px;
    }

    .site-topbar .brand-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 9px;
        font-size: 1.18rem;
    }

    .site-topbar .brand-title {
        font-size: 1rem;
    }

    .site-topbar .brand-info p {
        display: none;
    }

    .site-topbar .header-actions {
        width: auto;
    }

    .site-topbar .portal-connection-status {
        width: 14px;
        min-width: 14px;
        max-width: 14px;
        padding: 0;
        overflow: hidden;
        color: transparent;
    }

    .site-topbar .site-nav {
        display: flex;
        grid-template-columns: none;
        width: calc(100% + 20px);
        margin-inline: -10px;
        padding-inline: 6px;
        overflow-x: auto;
    }

    .site-topbar .site-nav-link {
        width: auto;
        min-width: max-content;
        min-height: 46px;
        padding: 0 12px;
        font-size: 0.74rem;
    }
}

/* Editorial service cards: natural photography, restrained motion, no synthetic glow. */
.portal-card {
    min-height: 350px;
    border-radius: 18px;
    border-color: rgba(148, 163, 184, 0.2);
    background: #101b2b;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.2);
}

[data-theme="light"] .portal-card {
    border-color: #dce3eb;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 39, 68, 0.09);
}

.portal-card::after {
    display: none;
}

.portal-card:hover {
    transform: translateY(-3px);
    border-color: rgba(148, 163, 184, 0.36);
    background: #101b2b;
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.24);
}

[data-theme="light"] .portal-card:hover {
    border-color: #c9d3df;
    background: #fff;
    box-shadow: 0 16px 32px rgba(15, 39, 68, 0.12);
}

.portal-card-media {
    min-height: 220px;
    background: #172033;
}

.portal-card-image {
    transform: none;
    filter: none;
    transition: transform 320ms ease;
    will-change: auto;
}

.portal-card:hover .portal-card-image {
    transform: scale(1.025);
    filter: none;
}

.portal-card-media-shade {
    background: linear-gradient(180deg, transparent 36%, rgba(5, 13, 24, 0.86) 100%);
}

.portal-card-title-wrap {
    right: 18px;
    left: 18px;
    bottom: 16px;
}

.portal-card-title-wrap h3 {
    max-width: 100%;
    font-size: clamp(1.08rem, 1.55vw, 1.3rem);
    font-weight: 850;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.58);
}

.portal-card-body {
    min-height: 124px;
    gap: 12px;
    padding: 16px 18px 18px;
}

.portal-card-body p {
    font-size: 0.82rem;
    line-height: 1.7;
}

.portal-card-link {
    padding: 0 0 3px;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    color: #9bc2f5;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 800;
}

.portal-card:hover .portal-card-link {
    color: #dbeafe;
    border-bottom-color: currentColor;
    background: transparent;
}

[data-theme="light"] .portal-card-link {
    color: #1f568f;
    background: transparent;
    border-color: transparent;
}

[data-theme="light"] .portal-card:hover .portal-card-link {
    color: #0f3d6d;
    border-bottom-color: currentColor;
    background: transparent;
}

.chat-message-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(200, 164, 90, 0.5);
    border-radius: 8px;
    color: #fff;
    background: #0f2744;
    font-size: 0.85rem;
    font-weight: 900;
}

#floating-actions-container button {
    box-shadow: 0 8px 20px rgba(15, 39, 68, 0.22) !important;
    backdrop-filter: none;
}

#floating-actions-container button:hover {
    transform: translateY(-2px);
}

#chatbot-panel {
    border-radius: 18px !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    background: #f8fafc !important;
    box-shadow: 0 18px 45px rgba(15, 39, 68, 0.22) !important;
}

#chatbot-panel > div:first-child {
    border-bottom: 3px solid #c8a45a;
    background: #0f2744 !important;
}

#chatbot-messages {
    background: #eef2f6 !important;
}

#chatbot-form {
    background: #fff !important;
}

#chatbot-form button {
    border-radius: 9px !important;
    background: #0f2744 !important;
    box-shadow: none !important;
}

#btn-close-chatbot {
    border-radius: 9px !important;
}

#btn-close-chatbot::before {
    content: "×";
}

#btn-close-chatbot:hover {
    transform: none;
}

[data-theme="dark"] #chatbot-panel {
    background: #101827 !important;
}

[data-theme="dark"] #chatbot-messages {
    background: #111c2d !important;
}

[data-theme="dark"] #chatbot-form {
    background: #101827 !important;
}

@media (max-width: 640px) {
    .portal-card {
        min-height: 328px;
        border-radius: 16px;
    }

    .portal-card-media {
        min-height: 205px;
    }
}

@media (hover: none), (pointer: coarse) {
    .portal-card:hover {
        transform: none;
    }

    .portal-card::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .motion-enhanced [data-reveal],
    .view-enter {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }

    .portal-card-image {
        will-change: auto;
    }
}

/* ==========================================================================
   ⚡ Billion-Dollar Enterprise UI/UX Polish & Lightning-Speed Optimization
   ========================================================================== */

/* 1. تسريع تصيير الخطوط وحركات الأجهزة وتثبيت العرض الفائق */
html, body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.view {
    contain: layout style;
    will-change: opacity, transform;
}

/* 2. الهيدر والشريط العلوي الزجاجي الفاخر (Apple / Stripe Glassmorphism) */
.site-topbar {
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    background: rgba(11, 15, 25, 0.82) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

[data-theme="light"] .site-topbar {
    background: rgba(255, 255, 255, 0.88) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04) !important;
}

/* 3. شعار البوابة بتأثير متطور وتوهج خفيف */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.brand:hover {
    transform: scale(1.02);
}

.brand-icon img {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 4. أزرار التنقل الذكية مع تفاعل لمسي ناعم وتوهج أنيق */
.site-nav-link {
    position: relative;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
    border-radius: 12px !important;
    padding: 8px 16px !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.site-nav-link:hover {
    transform: translateY(-1.5px);
    background: rgba(255, 255, 255, 0.08) !important;
    color: #38bdf8 !important;
}

.site-nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(99, 102, 241, 0.25)) !important;
    border: 1px solid rgba(59, 130, 246, 0.45) !important;
    color: #60a5fa !important;
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.25) !important;
}

[data-theme="light"] .site-nav-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(79, 70, 229, 0.12)) !important;
    border: 1px solid rgba(37, 99, 235, 0.3) !important;
    color: #1d4ed8 !important;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.12) !important;
}

/* 5. ترويسة البوابة الترحيبية والبانر الفاخر (Hero Modernization) */
.portal-banner {
    border-radius: 28px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6) !important;
    overflow: hidden !important;
}

.student-welcome-box {
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 20px !important;
    padding: 18px 24px !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4) !important;
    transition: transform 0.25s ease, border-color 0.25s ease !important;
}

.student-welcome-box:hover {
    border-color: rgba(56, 189, 248, 0.4) !important;
}

.student-welcome-box h2 {
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
}

.student-welcome-box p {
    color: #94a3b8 !important;
    font-size: 0.92rem !important;
}

/* 6. بطاقات الكليات والخدمات بلمسات احترافية عالية الدقة */
.college-card,
.academic-service-card,
.portal-card,
.cafeteria-restaurant-card {
    border-radius: 22px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.65) 100%) !important;
    box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease !important;
}

.college-card:hover,
.academic-service-card:hover,
.portal-card:hover,
.cafeteria-restaurant-card:hover {
    transform: translateY(-5px) scale(1.01) !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
    box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.2) !important;
}

[data-theme="light"] .college-card,
[data-theme="light"] .academic-service-card,
[data-theme="light"] .portal-card,
[data-theme="light"] .cafeteria-restaurant-card {
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    background: #ffffff !important;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.02) !important;
}

[data-theme="light"] .college-card:hover,
[data-theme="light"] .academic-service-card:hover,
[data-theme="light"] .portal-card:hover,
[data-theme="light"] .cafeteria-restaurant-card:hover {
    transform: translateY(-5px) scale(1.01) !important;
    border-color: rgba(37, 99, 235, 0.35) !important;
    box-shadow: 0 20px 40px -8px rgba(37, 99, 235, 0.15), 0 4px 14px rgba(15, 23, 42, 0.05) !important;
}

/* 7. بطاقات المواد والكتب في المكتبة الرقمية (Library Book Cards) */
.book-card {
    border-radius: 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(30, 41, 59, 0.4) !important;
    backdrop-filter: blur(14px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.book-card:hover {
    transform: translateY(-3px) !important;
    border-color: rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(56, 189, 248, 0.15) !important;
}

/* 8. أزرار التحميل والإجراءات السريعة (Premium Action Buttons) */
.btn-download,
.btn-preview,
.btn-primary,
.cafeteria-submit-order {
    border-radius: 14px !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
    padding: 10px 20px !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25) !important;
}

.btn-download:hover,
.btn-preview:hover,
.btn-primary:hover,
.cafeteria-submit-order:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4) !important;
}

/* 9. تأثيرات الضغط والتفاعل الفوري (Instant Tactile Feedback) */
button:active:not(:disabled),
.btn:active:not(:disabled),
.site-nav-link:active {
    transform: scale(0.975) !important;
    transition: transform 0.08s ease !important;
}

/* 10. حقول الإدخال والبحث الفوري الفائق */
input[type="search"],
input[type="text"],
input[type="tel"],
input[type="number"],
select,
textarea {
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(15, 23, 42, 0.6) !important;
    color: #f8fafc !important;
    font-weight: 500 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

input[type="search"]:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: #38bdf8 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
}

[data-theme="light"] input[type="search"],
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] input[type="number"],
[data-theme="light"] select,
[data-theme="light"] textarea {
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    color: #0f172a !important;
}

[data-theme="light"] input[type="search"]:focus,
[data-theme="light"] input[type="text"]:focus,
[data-theme="light"] input[type="tel"]:focus,
[data-theme="light"] input[type="number"]:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
    border-color: #2563eb !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}


