@font-face {
    font-family: 'Vazir';
    src: url('Vazir.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96c93d);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1200px;
    width: 90%;
    margin: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch; /* باکس‌ها کشیده میشن تا هم‌ارتفاع بشن */
}

.profile-section, .info-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.profile-section:hover, .info-section:hover {
    transform: translateY(-5px);
}

.profile-section {
    flex: 1; /* اندازه نسخه اول */
    min-width: 300px;
    background: linear-gradient(135deg, #dfe6e9, #b2bec3); /* خاکستری ملایم */
    display: flex;
    flex-direction: column;
    align-items: center; /* همه‌چیز وسط‌چین */
    justify-content: center; /* وسط عمودی */
    text-align: center;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 5px solid #fff;
    object-fit: cover;
}

h1 {
    font-size: 32px;
    color: #2d3436;
    margin-bottom: 15px;
}

p {
    font-size: 18px;
    color: #636e72;
    margin-bottom: 10px;
}

.social-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    transition: transform 0.3s ease;
}

.social-links img {
    width: 45px;
    height: 45px;
}

.social-links a:hover {
    transform: scale(1.15);
}

.info-section {
    flex: 2; /* اندازه نسخه اول */
    min-width: 300px;
    background: linear-gradient(135deg, #74b9ff, #a29bfe); /* آبی آسمانی به بنفش ملایم */
    display: flex;
    flex-direction: column;
    justify-content: center; /* وسط عمودی */
    left: 0;
}

.bio h2, .skills h2 {
    font-size: 24px;
    color: #2d3436;
    margin-bottom: 15px;
    border-bottom: 2px solid #ff7675;
    display: inline-block;
    padding-bottom: 5px;
}

.bio p {
    font-size: 16px;
    line-height: 1.6;
}

.skills ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skills li {
    background: #ff7675;
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.skills li:hover {
    background: #e84393;
}

#lang-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #2d3436;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

#lang-toggle:hover {
    background: #636e72;
}

/* دسکتاپ - تنظیم مکان باکس‌ها */
@media (min-width: 768px) {
    .container {
        flex-wrap: nowrap; /* جلوگیری از شکستن خط */
        justify-content: space-between; /* فاصله متعادل بین باکس‌ها */
    }
    /* فقط جهت باکس‌ها رو بر اساس زبان تنظیم می‌کنیم */
    html[lang="fa"] .container {
        flex-direction: row-reverse; /* پروفایل راست، اطلاعات چپ */
    }
    html[lang="fa"] .info-section {
        text-align: right; /* راست‌چین برای فارسی */
    }
    html[lang="en"] .container {
        flex-direction: row; /* پروفایل چپ، اطلاعات راست */
    }
    html[lang="en"] .info-section {
        text-align: left; /* چپ‌چین برای انگلیسی */
    }
    .profile-section, .info-section {
        height: 500px; /* ارتفاع ثابت برای هر دو */
        box-sizing: border-box;
    }
    html[lang="fa"] .profile-section {
        order: 2; /* پروفایل سمت راست */
    }
    
    html[lang="fa"] .info-section {
        order: 1; /* اطلاعات سمت چپ */
    }
    
    html[lang="en"] .profile-section {
        order: 1; /* پروفایل سمت چپ */
    }
    
    html[lang="en"] .info-section {
        order: 2; /* اطلاعات سمت راست */
    }
    
}

/* موبایل - همیشه عکس و اطلاعات اول */
@media (max-width: 767px) {
    .container {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
    }
    .profile-section {
        order: 1; /* اول */
        width: 100%;
        height: auto; /* توی موبایل ارتفاع آزاد */
    }
    .info-section {
        order: 2; /* دوم */
        width: 100%;
        height: auto;
        text-align: center; /* توی موبایل وسط‌چین */
    }
    .profile-pic {
        width: 120px;
        height: 120px;
    }
    h1 {
        font-size: 28px;
    }
    p {
        font-size: 16px;
    }
    .social-links img {
        width: 40px;
        height: 40px;
    }
}

/* جهت متن بر اساس زبان */
html[lang="fa"] {
    direction: rtl;
}
html[lang="en"] {
    direction: ltr;
}

/* فونت فارسی فقط با وزیر */
html[lang="fa"] * {
    font-family: 'Vazir', sans-serif;
}