/* ==========================================
   1. CSS Variables (Modern Oceanic Theme)
   ========================================== */
:root {
    /* تم رنگی هارمونیک و شیک: سرمه‌ای زغالی + فیروزه‌ای/آبی اقیانوسی */
    --brand-primary: #0f172a;      /* سرمه‌ای زغالی بسیار تیره */
    --brand-secondary: #1e293b;    /* خاکستری سرمه‌ای */
    --brand-accent: #0891b2;       /* آبی اقیانوسی/فیروزه‌ای شیک به جای طلایی */
    --brand-accent-hover: #06b6d4; /* فیروزه‌ای روشن برای افکت هاور */
    
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --text-light: #e2e8f0;
    
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --transition-standard: all 0.3s ease;
}

/* ==========================================
   2. Typography & Fonts
   ========================================== */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   3. Animations
   ========================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ==========================================
   4. Reusable Utility Classes
   ========================================== */
.text-accent { color: var(--brand-accent) !important; }
.bg-accent { background-color: var(--brand-accent) !important; color: var(--brand-primary); }

.btn-brand-primary {
    background-color: var(--brand-accent);
    color: var(--brand-primary);
    font-weight: 700;
    transition: var(--transition-standard);
    border: none;
}

.btn-brand-primary:hover, 
.btn-brand-primary:focus {
    background-color: var(--brand-accent-hover);
    color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 167, 91, 0.35) !important;
}

.btn-brand-outline {
    border: 2px solid var(--brand-secondary);
    color: var(--brand-secondary);
    font-weight: 600;
    transition: var(--transition-standard);
}

.btn-brand-outline:hover {
    background-color: var(--brand-secondary);
    color: var(--bg-surface);
}

/* ==========================================
   5. Logos & Images Management
   ========================================== */
.navbar-logo {
    height: 55px;
    width: auto;
    object-fit: contain;
    margin-left: 15px;
}

.footer-logo {
    height: 75px;
    filter: brightness(0) invert(1) opacity(0.85); 
}

/* ==========================================
   6. Layout Components
   ========================================== */
.navbar-academic {
    background-color: var(--bg-surface);
    border-bottom: 2px solid var(--brand-accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.navbar-academic .nav-link {
    color: var(--brand-secondary);
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    transition: var(--transition-standard);
}

.navbar-academic .nav-link:hover,
.navbar-academic .nav-link.active {
    color: var(--brand-accent);
}

/* Hero Section (With Image Overlay) */
.hero-section {
    /* لایه تیره روی تصویر اصلی + تنظیم محل قرارگیری عکس */
    background: linear-gradient(rgba(26, 34, 46, 0.85), rgba(36, 48, 64, 0.85)), 
                url('../img/Refah_UN.webp') center/cover no-repeat;
    color: var(--bg-surface);
    padding: 140px 0 110px;
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    letter-spacing: -1px;
}

/* Portals Section */
.portals-section {
    margin-top: -65px;
    position: relative;
    z-index: 10;
}

.portal-card {
    background: var(--bg-surface);
    border-radius: var(--border-radius-lg);
    padding: 2.2rem 1.5rem;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-bottom: 4px solid var(--brand-secondary);
    transition: var(--transition-standard);
    height: 100%;
    text-decoration: none;
    display: block;
    color: var(--text-main);
}

.portal-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(26, 34, 46, 0.08);
    border-bottom-color: var(--brand-accent);
    color: var(--brand-secondary);
}

.portal-title {
    font-size: 1.05rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    white-space: nowrap;          /* جلوگیری از شکستن خط */
    overflow: hidden;             /* مخفی کردن متن اضافی در صورت کوچکی عرض کارت */
    text-overflow: ellipsis;      /* نمایش ... در انتهای متن‌های طولانی */
    padding: 0 5px;
}

.portal-icon {
    width: 75px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(36, 48, 64, 0.05);
    color: var(--brand-secondary);
    font-size: 2.2rem;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    transition: var(--transition-standard);
}

.portal-card:hover .portal-icon {
    background-color: var(--brand-secondary);
    color: var(--bg-surface);
    transform: scale(1.1);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-header h2 {
    color: var(--brand-primary);
    font-weight: 800;
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    width: 40%;
    height: 3px;
    background-color: var(--brand-accent);
    bottom: 0;
    left: 30%;
    border-radius: 2px;
}

/* Stats Section (اصلاح فونت اعداد) */
.stat-item {
    padding: 2rem 1rem;
    text-align: center;
}

.stat-number {
    font-family: 'Vazirmatn', sans-serif;
    color: var(--brand-accent);
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1;
}

@media (min-width: 768px) {
    .border-end-md {
        border-left: 1px solid var(--text-light);
    }
}

/* Map Section */
.map-container {
    background-color: var(--bg-surface);
    padding: 0;
}

/* Footer */
.footer-academic {
    background-color: var(--brand-primary);
    padding: 70px 0 20px;
    font-size: 0.95rem;
}

.footer-links li { margin-bottom: 1rem; }
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-standard);
    position: relative;
    padding-right: 15px;
}
.footer-links a::before {
    content: '←';
    position: absolute;
    right: 0;
    color: var(--brand-accent);
    opacity: 0;
    transition: var(--transition-standard);
}
.footer-links a:hover {
    color: var(--bg-surface);
    padding-right: 20px;
}
.footer-links a:hover::before { opacity: 1; right: 0; }

.contact-info li {
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
}
.contact-info i {
    color: var(--brand-accent);
    font-size: 1.2rem;
    width: 30px;
}
.contact-info a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-standard);
}
.contact-info a:hover { color: var(--bg-surface); }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 50px;
    padding-top: 25px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}