/* متغیرهای رنگ */
:root {
    --sharif-blue: #0066b3;
    --primary: #2c3e50;
    --secondary: #076b34;
    --accent: #3498db;
    --gold: #9cf2a7;
    --dark: #2c3e50;
    --light: #f8f9fa;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #17a2b8;
}

/* Reset و استایل‌های پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: var(--dark);
    background: #f5f5f5;
    overflow-x: hidden;
    text-align: right;
    direction: rtl;
}

/* تعریف فونت نستعلیق */
@font-face {
    font-family: 'IranNastaliq';
    src: url('fonts/IranNastaliq.woff2') format('woff2'),
         url('fonts/IranNastaliq.woff') format('woff'),
         url('fonts/IranNastaliq.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* استایل‌های عمومی برای نسخه انگلیسی */
.english-version {
    direction: ltr;
    text-align: left;
}

.english-version .about-me-section,
.english-version .publications-section,
.english-version .feature-card,
.english-version .scrollable-content,
.english-version .publication-card,
.english-version .form-control {
    direction: ltr;
    text-align: left;
}

/* استایل‌های عمومی برای محتوای فارسی */
.persian-content {
    direction: rtl;
    text-align: right;
}

.persian-poem {
    direction: rtl;
    text-align: center;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--sharif-blue) 0%, var(--primary) 100%) !important;
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.6rem;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sharif-logo {
    width: 35px;
    height: 35px;
    background: white;
    border-radius: 50%;
    padding: 5px;
}

.language-switcher {
    display: flex;
    gap: 10px;
    margin-right: auto;
}

.language-btn {
    width: 35px;
    height: 35px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.3s ease;
}

.language-btn:hover {
    border-color: white;
    transform: scale(1.1);
}

.language-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 400;
    padding: 0.5rem 1.2rem !important;
    margin: 0 0.2rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: white !important;
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--sharif-blue) 0%, #004a8f 100%);
    color: white;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,1000 1000,0 1000,1000"/></svg>');
}

.hero-content {
    position: relative;
    z-index: 2;
}

.university-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 2rem;
}

.sharif-logo-large {
    width: 150px;
    height: 150px;
    background: white;
    border-radius: 50%;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.university-info {
    flex: 1;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    opacity: 0.95;
}

/* Einstein Section */
.einstein-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.einstein-image-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.einstein-image {
    width: 100%;
    max-width: 400px;
    border-radius: 15px;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.einstein-section {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 1.6rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    width: 80%;
    text-align: center;
}

.einstein-quote {
    flex: 1;
}

.quote-text {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.quote-author {
    font-weight: 600;
    opacity: 0.9;
}

/* Date Time Widget */
.datetime-widget {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    font-size: 1.1rem;
    text-align: center;
    margin: -40px auto 40px;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    z-index: 10;
}

/* Section Styling */
.section {
    padding: 80px 0;
}

.section-light {
    background: var(--light);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 3rem;
    position: relative;
    display: inline-block; /* اضافه شده */
    left: 50%; /* اضافه شده */
    transform: translateX(-50%); /* اضافه شده */
    padding: 0 20px 15px 20px; /* اضافه شده */
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0; /* تغییر از right به left */
    width: 100%; /* تغییر به 100% */
    height: 4px;
    background: linear-gradient(135deg, var(--secondary1) 0%, var(--gold1) 100%);
    border-radius: 2px;
}

/* Cards */
.feature-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--gold) 100%);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.feature-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-text {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Scrollable Content */
.scrollable-content {
    max-height: 300px;
    overflow-y: auto;
    padding-left: 10px;
    margin-bottom: 1.5rem;
}

.scrollable-content::-webkit-scrollbar {
    width: 6px;
}

.scrollable-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.scrollable-content::-webkit-scrollbar-thumb {
    background: var(--sharif-blue);
    border-radius: 10px;
}

.scrollable-content::-webkit-scrollbar-thumb:hover {
    background: #004a8f;
}

/* Bilingual Content */
.bilingual-container {
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 10px;
    background-color: rgba(0, 102, 179, 0.05);
}

.bilingual-container:hover {
    background-color: rgba(0, 102, 179, 0.1);
}

.english-content {
    display: block;
    direction: ltr;
    text-align: left;
}

.persian-content {
    display: none;
    direction: rtl;
    text-align: right;
}

.english-poem {
    font-style: italic;
    line-height: 1.8;
    color: #e26912;
    text-align: center;
    margin-bottom: 10px;
}

.german-poem {
    font-style: italic;
    line-height: 1.8;
    color: #4539e7;
    text-align: center;
    margin-bottom: 10px;
}

.persian-poem {
    font-style: italic;
    line-height: 2.5;
    color: #0066b3;
    text-align: center;
    font-size: 1.1rem;
}

.click-hint {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin-top: 5px;
    font-style: italic;
}

/* Publications Grid */
.publication-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.publication-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-right: 5px solid var(--sharif-blue);
}

.publication-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Books Gallery */
.books-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.book-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.book-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.book-content {
    padding: 1.5rem;
}

/* Buttons */
.btn-custom {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--gold) 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.btn-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.4);
    color: white;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--primary) 0%, #34495e 100%);
    color: white;
    padding: 3rem 0 2rem;
}

/* Alert Styles */
.alert-success {
    background: linear-gradient(135deg, var(--success), #2ecc71);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.alert-error {
    background: linear-gradient(135deg, var(--danger), #c0392b);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: none;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Form Styles */
.form-control {
    text-align: right;
    direction: rtl;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--sharif-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 179, 0.25);
}

/* استایل‌های فونت نستعلیق */
.about-title {
    font-family: 'IranNastaliq', 'B Nazanin', 'Iranian Sans', Tahoma, serif;
    font-size: 2em;
    margin-bottom: 20px;
    color: #000000;
    text-align: center;
    display: inline-block;
    position: relative;
    padding-bottom: 8px;
}

/*.about-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
    background-color: #ff0000;
}*/

.poem1, .poem2 {
    font-family: 'IranNastaliq', 'B Nazanin', 'Iranian Sans', Tahoma, serif;
    text-align: center;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
    display: block;
}

.poem1 {
    font-size: 1.2em;
    line-height: 2.5;
    margin: 30px 0;
    padding: 20px;
}

.poem2 {
    font-size: 1em;
    line-height: 2.5;
    margin: 30px 0;
    padding: 20px;
}

.normal-text {
    font-family: Tahoma, sans-serif;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* استایل‌های ریسپانسیو */
@media (max-width: 1200px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 991px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .university-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .sharif-logo-large {
        width: 120px;
        height: 120px;
    }
    
    .einstein-container {
        margin-top: 2rem;
    }
    
    .einstein-section {
        width: 90%;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .feature-card {
        margin-bottom: 2rem;
        padding: 2rem;
    }
    
    .language-switcher {
        margin-right: 0;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .feature-card {
        padding: 1.5rem;
        border-radius: 15px;
        margin: 0 10px 2rem 10px;
    }
    
    .poem1, .poem2 {
        font-size: 1.1em;
        line-height: 2.2;
        padding: 15px;
        margin: 20px 0;
    }
    
    .bilingual-container {
        margin: 0;
        padding: 12px;
    }
    
    .scrollable-content {
        max-height: none;
        padding-left: 0;
    }
    
    .university-header {
        gap: 15px;
    }
    
    .sharif-logo-large {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 576px) {
    body {
        padding: 1rem;
    }
    
    .hero-section {
        padding: 80px 0 40px;
        min-height: 80vh;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }
    
    .about-title {
        font-size: 1.6em;
    }
    
    .feature-card {
        padding: 1.2rem;
        margin: 0 5px 1.5rem 5px;
        border-radius: 12px;
    }
    
    .feature-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .feature-title {
        font-size: 1.2rem;
    }
    
    .poem1, .poem2 {
        font-size: 1em;
        line-height: 2;
        padding: 12px;
        margin: 15px 0;
    }
    
    .bilingual-container {
        padding: 10px;
    }
    
    .datetime-widget {
        margin: -30px auto 30px;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.4rem 1rem !important;
        font-size: 0.9rem;
    }
    
    .btn-custom {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
}

@media (max-width: 380px) {
    .hero-title {
        font-size: 1.4rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .about-title {
        font-size: 1.4em;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .poem1, .poem2 {
        font-size: 0.95em;
        line-height: 1.8;
        padding: 10px;
    }
    
    .sharif-logo-large {
        width: 80px;
        height: 80px;
    }
}

/* استایل‌های utility */
.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

/* انیمیشن‌ها */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* استایل برای تصاویر */
.img-fluid {
    max-width: 100%;
    height: auto;
}

.rounded-circle {
    border-radius: 50% !important;
}

/* استایل‌های اضافی برای زیبایی */
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.shadow {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.shadow-lg {
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
}

.border-radius-10 {
    border-radius: 10px !important;
}

.border-radius-15 {
    border-radius: 15px !important;
}

.border-radius-20 {
    border-radius: 20px !important;
}