/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

/* --- Custom Properties (Theme Colors) --- */
:root {
    --primary-color: #1F3A5A;  /* A deeper, more corporate blue */
    --secondary-color: #4A658A;
    --accent-color: #F39C12;  /* A richer, golden orange */
    --background-color: #F5F7FA; /* A very light, clean gray */
    --card-background: #FFFFFF;
    --text-color: #34495E;
    --light-text-color: #7f8c8d;
    --border-color: #EAECEF;
}

/* --- Global Styles & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--background-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23dce4f0' fill-opacity='0.4'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 50px 20px;
    line-height: 1.8;
}

/* --- Main Card Layout --- */
.card-container {
    width: 100%;
    max-width: 850px;
}
.card {
    background: var(--card-background);
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid var(--border-color);
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

/* --- Card Header --- */
.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 50px 30px;
    position: relative;
}
.profile-picture {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    border: 7px solid var(--card-background);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    object-fit: cover;
    margin-bottom: 20px;
}
.name {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}
.title {
    font-size: 1.3rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin: 5px 0 15px;
}
.location-details p {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin: 5px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.location-details i {
    margin-left: 8px;
    color: var(--accent-color);
    font-size: 0.9em;
}

/* --- Card Body & Sections --- */
.card-body {
    padding: 40px 50px;
}
section {
    margin-bottom: 40px;
}
section:last-child {
    margin-bottom: 0;
}
section h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}
section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to left, var(--accent-color), #f7b733);
    border-radius: 2px;
}
.about p {
    text-align: justify;
    font-size: 1.1rem;
    color: var(--text-color);
}
.about p strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* --- Expertise Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Force 2 columns */
    gap: 15px;
    text-align: right;
}
.skills-grid span {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}
.skills-grid span:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 6px 15px rgba(0,0,0,0.07);
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.skills-grid i {
    margin-left: 12px;
    color: var(--accent-color);
    font-size: 1.4rem;
    transition: color 0.3s ease;
    width: 25px;
    text-align: center;
}
.skills-grid span:hover i {
    color: white;
}

/* --- Contact Section --- */
.contact-grid {
    display: grid;
    /* تغییر: ستون‌ها برای جا شدن 4 آیتم تنظیم شدند */
    grid-template-columns: repeat(4, 1fr);
    gap: 15px; /* تغییر: فاصله کمتر شد */
}
.contact-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px; /* تغییر: پدینگ کمتر شد */
    border-radius: 12px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    height: 100%;
}
.contact-item a:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.07);
    color: var(--accent-color);
    border-color: var(--accent-color);
}
.contact-item i {
    /* تغییر: آیکون‌ها کوچکتر شدند */
    font-size: 2rem;
    margin-bottom: 10px;
}
.contact-item span{
    font-size: 0.9rem;
}


/* --- Footer --- */
.card-footer {
    background-color: #f8f9fa;
    padding: 20px;
    font-size: 0.95rem;
    color: var(--light-text-color);
    border-top: 1px solid var(--border-color);
}
.card-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
.card-footer a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

/* --- Responsive Design for Mobiles & Tablets --- */
@media (max-width: 850px) {
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body { padding: 30px 15px; }
    .card-body { padding: 30px; }
    .name { font-size: 2rem; }
    .title { font-size: 1.1rem; }
    .profile-picture { width: 140px; height: 140px; }
    .skills-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    body { padding: 20px 10px; }
    .card-body { padding: 25px 20px; }
    .location-details p {
        font-size: 0.9rem;
    }
}