/* تنظیمات عمومی و فونت */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    transition: background-color 0.3s, color 0.3s;
    direction: rtl;
    text-align: right;
}

/* متغیرهای رنگی برای حالت تاریک و روشن */
:root {
    /* حالت روشن (پیش‌فرض) */
    --primary-color: #004d99; /* آبی دانشگاهی (شهید بهشتی) */
    --accent-color: #ff9900; /* نارنجی/زرد برای آمار و آیکون‌ها */
    --secondary-color: #f7f7f7; /* پس‌زمینه روشن */
    --text-color: #333; /* متن تیره */
    --card-background: #ffffff; /* پس‌زمینه کارت روشن */
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-color: #003366;
}

/* حالت تاریک */
body.dark-mode {
    --primary-color: #0061c2; /* آبی روشن‌تر */
    --accent-color: #ffb447; /* نارنجی روشن‌تر */
    --secondary-color: #121212; /* پس‌زمینه تیره */
    --text-color: #e0e0e0; /* متن روشن */
    --card-background: #1e1e1e; /* پس‌زمینه کارت تیره */
    --shadow-color: rgba(255, 255, 255, 0.1);
    --hover-color: #003366;
}

body {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 0;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px var(--shadow-color);
}

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

.logo-container {
    height: 40px;
}

.sbu-logo {
    height: 100%;
    width: auto;
    
    transition: transform 0.3s;
}

.sbu-logo:hover {
    transform: scale(1.05);
}

.university-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

.faculty-title-bar {
    background-color: var(--hover-color); /* رنگ کمی تیره‌تر */
    text-align: center;
    padding: 8px 0;
}

.faculty-title-bar h2 {
    color: white;
    font-size: 1.2rem;
    margin: 0;
    font-weight: 400;
}

#theme-toggle {
    background: none;
    border: 2px solid white;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#theme-toggle:hover {
    background-color: var(--accent-color);
}

/* Buttons - بهبود یافته */
.btn {
    display: inline-block;
    padding: 12px 25px; /* کمی بزرگتر */
    border-radius: 25px; /* گوشه‌های گردتر */
    text-decoration: none;
    font-weight: 700;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s; /* اضافه شدن box-shadow */
    margin-top: 15px;
    text-align: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* سایه ملایم برای عمق */
}

/* دکمه اصلی - حالت روشن */
.primary-btn {
    background-color: var(--accent-color);
    color: var(--hover-color); /* رنگ متن تیره برای کنتراست */
}

/* دکمه اصلی - حالت روشن (هاور) */
.primary-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px); /* حرکت عمودی کمی بیشتر */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3); /* سایه قوی‌تر هنگام هاور */
}

/* دکمه اصلی - حالت تاریک */
body.dark-mode .primary-btn {
    background-color: var(--accent-color); 
    color: var(--hover-color); 
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.15); /* سایه روشن‌تر برای تاریک */
}

/* دکمه اصلی - حالت تاریک (هاور) */
body.dark-mode .primary-btn:hover {
    background-color: var(--primary-color); 
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.25); /* سایه قوی‌تر و روشن‌تر هنگام هاور در تاریک */
}

/* Sections */
section {
    padding: 40px 0;
    border-bottom: 1px solid var(--shadow-color);
}

h2, h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    padding: 60px 0;
    background: linear-gradient(to top, var(--secondary-color), var(--card-background));
}

.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: 25px; 
}

/* Intro text, video and current-program spacing */
.intro-text {
    font-size: 1.05rem;
    line-height: 1.9;
    text-align: justify;
    padding-top: 18px;
    padding-bottom: 18px;
    margin-bottom: 100px; /* space between intro text and video */
}

.wide-video-wrapper {
    /* give breathing room from surrounding text */
    margin-top: 64px;
    margin-bottom: 150px;
    width: 100%;
    max-width: 100vw;
    box-shadow: 0 8px 16px var(--shadow-color);
    overflow: hidden;
    background: #000;
}

.responsive-video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.intro-current-programs {
    font-size: 1rem;
    line-height: 1.9;
    font-weight: 700;
    color: var(--primary-color);
    padding: 20px 15px;
    margin-top: 100px; /* space between video and this block */
    border-top: 2px solid var(--accent-color);
    text-align: justify;
}

/* History Section */
.history-section p, .history-section ul {
    line-height: 1.8;
    margin-bottom: 15px;
}

.history-section ul {
    list-style: none;
    padding-right: 20px;
}

.history-section li {
    background: var(--card-background);
    padding: 10px;
    border-right: 3px solid var(--accent-color);
    margin-bottom: 8px;
    border-radius: 4px;
}

.history-section .current-programs {
    font-weight: 700;
    color: var(--primary-color);
}

/* Stats Section (New) */
.stats-section {
    background-color: var(--card-background);
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* واکنش گرا برای موبایل */
    gap: 20px;
    margin-top: 30px;
}

.stat-item {
    padding: 15px;
    border-radius: 10px;
    background-color: var(--secondary-color);
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: background-color 0.3s, transform 0.3s;
}

body.dark-mode .stat-item {
    background-color: #282828;
}

.stat-item:hover {
    transform: translateY(-5px);
    background-color: #eee;
}

body.dark-mode .stat-item:hover {
    background-color: #3a3a3a;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    font-size: 1.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 10px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-description {
    font-size: 0.85rem;
    opacity: 0.9;
}


/* Gallery Section */
.image-gallery {
    display: grid;
    grid-template-columns: 1fr; /* یک ستون برای موبایل */
    gap: 15px;
}

.gallery-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: opacity 0.3s;
}

.gallery-image:hover {
    opacity: 0.9;
}

/* دکمه بیشتر بدانید - center within content column */
.centered-btn-container {
    /* match the main .container width and center this block */
    width: 100%;
    max-width: 100%;
    margin: 0 auto; /* centers the container */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
    background: var(--card-background);
    border-top: 1px solid var(--shadow-color);
}


/* Footer */
footer {
    background-color: var(--text-color);
    color: white;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
}

body.dark-mode footer {
    background-color: #000;
}

.social-links {
    margin-top: 10px;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    margin: 0 10px;
    text-decoration: none;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--accent-color);
}

/* === Media Queries for Tablet and Desktop === */

@media (min-width: 768px) {
    .header-content {
        padding: 15px 0;
    }

    .university-name {
        font-size: 2rem;
    }

    .faculty-title-bar h2 {
        font-size: 1.5rem;
    }

    .logo-container {
        height: 50px;
    }

    .image-gallery {
        grid-template-columns: repeat(3, 1fr); /* سه ستون برای تبلت و دسکتاپ */
    }

    .welcome-section {
        padding: 80px 0;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr); /* چهار ستون برای تبلت */
    }
}