/*
 * Faculty Platform - Main Stylesheet
 * Theme: Academic / University
 * Supports: RTL + LTR in single file
 * Framework: Bootstrap 4
 */

/* ===================== CSS VARIABLES ===================== */
:root {
    --primary:          #1a4fa0;
    --primary-dark:     #133a78;
    --primary-light:    #2b65c4;
    --accent:           #3b82f6;
    --accent-hover:     #2563eb;
    --bg-white:         #ffffff;
    --bg-light:         #f4f7fb;
    --bg-section:       #eef2f9;
    --text-dark:        #1e2a3a;
    --text-body:        #4a5568;
    --text-muted:       #718096;
    --border-color:     #dde3ef;
    --shadow-sm:        0 2px 8px rgba(26,79,160,0.07);
    --shadow-md:        0 6px 24px rgba(26,79,160,0.12);
    --shadow-lg:        0 12px 40px rgba(26,79,160,0.18);
    --radius-sm:        8px;
    --radius-md:        14px;
    --radius-lg:        20px;
    --transition:       0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --font-arabic:      'Tajawal', 'Segoe UI', sans-serif;
    --font-latin:       'Nunito', 'Segoe UI', sans-serif;
    --header-height:    72px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-arabic);
    color: var(--text-body);
    background: var(--bg-white);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

[dir="ltr"] body {
    font-family: var(--font-latin);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

a:hover { color: var(--primary); }
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul { list-style: none; padding: 0; margin: 0; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.section-padding { padding: 72px 0; }

/* ===================== TYPOGRAPHY ===================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.35;
}

/* ===================== NAVBAR ===================== */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--bg-white);
    box-shadow: 0 2px 12px rgba(26,79,160,0.08);
    transition: box-shadow var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar {
    padding: 0;
    height: var(--header-height);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 24px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-text-group {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-arabic {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
}

.logo-english {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-latin);
    white-space: nowrap;
}

.logo-emblem {
    flex-shrink: 0;
}

/* RTL: logo on right, links on left 
[dir="rtl"] .navbar-brand { order: 2; margin-right: 0; margin-left: auto; }
[dir="rtl"] .navbar-collapse { order: 1; }
[dir="rtl"] .ml-auto { margin-left: 0 !important; margin-right: auto !important; }
*/
/* Nav Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
/* Show a dash while JS hasn't run yet */
.counter:empty::before {
    content: '0';
    opacity: 0.4;
}

/* Once JS puts a real value in, the ::before disappears automatically */
.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark) !important;
    padding: 8px 14px !important;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px; height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: transform var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after { transform: translateX(-50%) scaleX(1); }

.nav-link:hover { color: var(--primary) !important; background: var(--bg-light); }
.nav-link.active { color: var(--primary) !important; font-weight: 700; }

/* Lang switcher */
.lang-switcher a,
.lang-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lang-switcher a:hover,
.lang-link:hover { color: var(--primary) !important; }

/* CTA Button */
.btn-cta {
    background: var(--primary);
    color: var(--bg-white) !important;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.92rem;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

[dir="rtl"] .btn-cta { margin-right: 16px; }
[dir="ltr"] .btn-cta { margin-left: 16px; }

.btn-cta:hover {
    background: var(--primary-dark);
    color: var(--bg-white) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Mobile Toggler */
.navbar-toggler {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.toggler-bar {
    display: block;
    width: 24px; height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.navbar-toggler[aria-expanded="true"] .toggler-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggler[aria-expanded="true"] .toggler-bar:nth-child(2) { opacity: 0; }
.navbar-toggler[aria-expanded="true"] .toggler-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===================== HERO SECTION ===================== */
.hero-section-home {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    background: url('http://teachers.iugaza.edu.ps/wp-content/uploads/2026/04/513033982_24124922697133328_5472211862054540295_n.jpg') center center / cover no-repeat;
    background-color: var(--primary-dark);
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 60px;
    overflow: hidden;
}

.hero-overlay-home {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(19,58,120,0.88) 0%, rgba(26,79,160,0.75) 100%);
    z-index: 1;
}

.hero-content-home {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-title-home {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: var(--bg-white);
    margin-bottom: 14px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.2);
    letter-spacing: -0.01em;
}

.hero-subtitle-home {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: rgba(255,255,255,0.88);
    margin-bottom: 36px;
    line-height: 1.8;
}

/* Hero Search */
.hero-search-wrapper {
    margin-bottom: 24px;
}

.hero-search-form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
}

[dir="rtl"] .search-input-group {
    padding: 6px 20px 6px 6px;
}

.search-icon-left {
    color: var(--text-muted);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

[dir="rtl"] .search-icon-left { margin-left: 10px; }
[dir="ltr"] .search-icon-left { margin-right: 10px; }

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: transparent;
    font-family: var(--font-arabic);
    min-width: 0;
    padding: 8px 12px;
}

[dir="ltr"] .search-input { font-family: var(--font-latin); }

.search-input::placeholder { color: var(--text-muted); }

.search-btn {
    background: var(--primary);
    border: none;
    border-radius: 50px;
    color: var(--bg-white);
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition), transform var(--transition);
}

.search-btn:hover { background: var(--primary-dark); transform: scale(1.05); }

/* Keyword Tags */
.keyword-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.keyword-label {
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.keyword-tag {
    background: rgba(255,255,255,0.15);
    color: var(--bg-white);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    padding: 5px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.keyword-tag:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.6);
    color: var(--bg-white);
    transform: translateY(-2px);
}

/* ===================== FEATURES SECTION ===================== */
.features-section {
    background: var(--bg-white);
    position: relative;
}

.feature-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 32px 32px;
    height: 100%;
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    cursor: default;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

[dir="rtl"] .feature-card::before { transform-origin: right; }

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(26,79,160,0.15);
}

.feature-card:hover::before { transform: scaleX(1); }

.feature-card--center {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-white);
}

.feature-card--center .feature-title,
.feature-card--center .feature-desc,
.feature-card--center .feature-icon { color: var(--bg-white); }

.feature-card--center .feature-link { color: rgba(255,255,255,0.9); }
.feature-card--center .feature-link:hover { color: var(--bg-white); }
.feature-card--center::before { background: rgba(255,255,255,0.4); }

.feature-icon {
    color: var(--primary);
    margin-bottom: 22px;
    transition: transform var(--transition);
}

.feature-card:hover .feature-icon { transform: scale(1.1); }

.feature-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-body);
    line-height: 1.75;
    margin-bottom: 24px;
}

.feature-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap var(--transition), color var(--transition);
}

.feature-link:hover { gap: 10px; color: var(--primary-dark); }

[dir="rtl"] .feature-link { flex-direction: row-reverse; justify-content: flex-end; }
[dir="ltr"] .feature-link span { transform: rotate(180deg); display: inline-block; }

/* ===================== STATISTICS SECTION ===================== */
.stats-section {
    background: var(--bg-section);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 24px;
    position: relative;
    transition: transform var(--transition);
}


.stat-item:hover { transform: translateY(-4px); }

.stat-icon {
    color: var(--primary);
    margin-bottom: 14px;
    opacity: 0.8;
}

.stat-number {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-family: var(--font-latin);
}

.stat-label {
    font-size: 0.88rem;
    color: var(--text-body);
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

/* ===================== QUICK LINKS SECTION ===================== */
.quicklinks-section {
    background: var(--bg-white);
}

.section-title-inline {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 32px;
    position: relative;
    display: inline-block;
}

.section-title-inline::after {
    content: '';
    position: absolute;
    bottom: -8px; left: 0;
    width: 40px; height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

[dir="rtl"] .section-title-inline::after { left: auto; right: 0; }
[dir="rtl"] .quicklinks-section .container { text-align: right; }
[dir="ltr"] .quicklinks-section .container { text-align: left; }

.quicklinks-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.quicklink-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 16px 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
    text-decoration: none;
    gap: 12px;
}

.quicklink-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-md);
    border-color: rgba(26,79,160,0.2);
    background: var(--bg-light);
    color: var(--primary);
}

.quicklink-icon {
    color: var(--primary);
    transition: transform var(--transition), color var(--transition);
}

.quicklink-item:hover .quicklink-icon { transform: scale(1.15); }

.quicklink-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
    transition: color var(--transition);
}

.quicklink-item:hover .quicklink-label { color: var(--primary); }

/* ===================== FOOTER ===================== */
.site-footer {
    background: var(--text-dark);
    color: rgba(255,255,255,0.8);
}

.footer-top {
    padding: 64px 0 48px;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bg-white);
    margin-bottom: 22px;
    position: relative;
    padding-bottom: 12px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 28px; height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

[dir="rtl"] .footer-heading::after { left: auto; right: 0; }

.footer-list li { margin-bottom: 10px; }

.footer-link {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.65);
    transition: color var(--transition), padding var(--transition);
    display: inline-block;
}

.footer-link:hover { color: var(--bg-white); }

.footer-more { color: var(--accent) !important; }
.footer-more:hover { color: var(--accent-hover) !important; }

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    font-style: normal;
}

.footer-email, .footer-phone {
    font-size: 0.88rem;
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-icon {
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.75);
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.social-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-white);
    transform: translateY(-3px);
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
    text-align: center;
}

.footer-copyright {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    margin: 0;
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes counterPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.animate-fade-up {
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.15s;
}

.animate-stagger {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.animate-stagger.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Polylang language list override */
.lang-switcher ul {
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lang-switcher ul li a {
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted) !important;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}

.lang-switcher ul li a:hover,
.lang-switcher ul li.current-lang a {
    background: var(--bg-light);
    color: var(--primary) !important;
}

/* ===================== RESPONSIVE: TABLET ===================== */
@media (max-width: 991px) {

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .stat-item:nth-child(2)::after,
    .stat-item:nth-child(4)::after { display: none; }

    .stat-item:nth-child(1)::after,
    .stat-item:nth-child(3)::after { display: block; }

    .quicklinks-grid { grid-template-columns: repeat(3, 1fr); }

    .navbar-toggler { display: flex; }

    .navbar-collapse {
        position: absolute;
        top: var(--header-height);
        left: 0; right: 0;
        background: var(--bg-white);
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        padding: 16px 24px 24px;
        z-index: 999;
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        width: 100%;
    }

    .nav-link { width: 100%; }

    [dir="rtl"] .ml-auto { margin-right: 0 !important; }

    .btn-cta {
        margin-top: 12px;
        align-self: flex-start;
        display: inline-block;
    }

    [dir="rtl"] .btn-cta,
    [dir="ltr"] .btn-cta { margin-left: 0; margin-right: 0; }

    .navbar-brand {
        margin-right: auto;
        margin-left: 0;
    }

    [dir="rtl"] .navbar-brand {
        margin-left: auto;
        margin-right: 0;
    }
}

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

    :root { --header-height: 64px; }

    .section-padding { padding: 48px 0; }

    .hero-section {
        min-height: 480px;
        padding-top: calc(var(--header-height) + 32px);
        padding-bottom: 48px;
    }

    .hero-title { font-size: 1.55rem; }
    .hero-subtitle { font-size: 0.92rem; }

    .search-input-group { padding: 4px 4px 4px 14px; }
    [dir="rtl"] .search-input-group { padding: 4px 14px 4px 4px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0; }

    .stat-item { padding: 28px 16px; }
    .stat-item::after { display: none !important; }
    .stat-item:nth-child(odd)::after {
        display: block !important;
        right: 0;
        top: 15%;
        bottom: 15%;
    }

    .quicklinks-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .logo-english { display: none; }
    .logo-arabic { font-size: 0.98rem; }

    .footer-top { padding: 40px 0 32px; }

    .footer-grid > div { margin-bottom: 32px !important; }

    .social-icons { justify-content: center; }

    [dir="rtl"] .social-icons { justify-content: flex-start; }
}

@media (max-width: 480px) {
    .quicklinks-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .keyword-tags { justify-content: center; }
    .hero-content { padding: 0 12px; }
}

/* ===================== PRINT ===================== */
@media print {
    .site-header,
    .hero-section,
    .btn-cta { display: none; }

    body { font-size: 12pt; }
    .section-padding { padding: 24px 0; }
}

/* ===================== ACCESSIBILITY ===================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .animate-fade-up { opacity: 1; animation: none; }
    .animate-stagger { opacity: 1; transform: none; }
}
