
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', monospace;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    transition: all 0.3s ease;
}

body.ltr {
    direction: ltr;
    text-align: left;
}

body.rtl {
    direction: rtl;
    text-align: right;
}

.fade-transition {
    transition: opacity 0.4s ease-in-out;
}

.fade-out {
    opacity: 0;
}

.fade-in {
    opacity: 1;
}

.code-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(45deg, rgba(0, 255, 255, 0.02) 0px, rgba(0, 255, 255, 0.02) 2px, transparent 2px, transparent 8px);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.dev-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    border-radius: 2.5rem;
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.dev-header {
    background: linear-gradient(125deg, #0f172a 0%, #1e3a5f 50%, #2dd4bf20 100%);
    padding: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    border-bottom: 2px solid #38bdf8;
    position: relative;
}

.lang-switch {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
}

body.rtl .lang-switch {
    right: auto;
    left: 2rem;
}

.lang-btn {
    background: #1e293b;
    border: 1px solid #38bdf8;
    color: #38bdf8;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    font-family: inherit;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    position: relative;
}

.lang-btn:hover {
    background: #38bdf8;
    color: #0f172a;
    transform: translateY(-2px);
}

.info-section {
    flex: 2;
}

.code-badge {
    background: #0a0f1e;
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #7dd3fc;
    border: 1px solid #38bdf8;
    margin-bottom: 1.2rem;
}

.info-section h1 {
    font-size: 2.6rem;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: linear-gradient(120deg, #38bdf8, #a855f7, #2dd4bf);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.job-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 500;
    color: #cbd5e1;
}

.job-title i {
    background: #1e293b;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.9rem;
}

.bio {
    color: #94a3b8;
    max-width: 550px;
    line-height: 1.7;
}

body.ltr .bio {
    max-width: 600px;
}

.avatar-code {
    position: relative;
}

.code-frame {
    width: 180px;
    height: 180px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 35% 65% 45% 55% / 70% 40% 60% 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.code-frame img {
    width: 92%;
    height: 92%;
    object-fit: cover;
    border-radius: 30% 70% 42% 58% / 65% 38% 62% 35%;
}

.terminal-icon {
    position: absolute;
    bottom: 0;
    left: 0;
    background: #0f172a;
    border-radius: 30px;
    padding: 8px 12px;
    border: 1px solid #38bdf8;
    color: #0ff;
    font-size: 1.2rem;
}

body.ltr .terminal-icon {
    left: auto;
    right: 0;
}

.coding-tools {
    background: #0f172a80;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    border-bottom: 1px solid #334155;
}

.coding-tools i {
    font-size: 1.5rem;
    color: #60a5fa;
    transition: 0.2s;
}

.coding-tools i:hover {
    color: #38bdf8;
    transform: scale(1.15);
    text-shadow: 0 0 8px cyan;
}

.skills-dev {
    padding: 2.5rem;
}

.section-title-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    border-right: 4px solid #38bdf8;
    padding-right: 1rem;
}

body.ltr .section-title-custom {
    border-right: none;
    border-left: 4px solid #38bdf8;
    padding-right: 0;
    padding-left: 1rem;
}

.section-title-custom i {
    font-size: 2rem;
    color: #38bdf8;
}

.section-title-custom h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e2e8f0;
}

.skills-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.skill-category {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 1.5rem;
    padding: 1.2rem 1.5rem;
    border: 1px solid #334155;
    transition: 0.2s;
}

.skill-category:hover {
    border-color: #38bdf8;
    background: rgba(30, 41, 59, 0.7);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #b9e2ff;
    margin-bottom: 1.2rem;
    border-bottom: 1px dashed #475569;
    padding-bottom: 0.5rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.skill-chip {
    background: #0f172a;
    padding: 0.7rem 1rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.25s ease;
    border: 1px solid #334155;
    cursor: default;
}

.skill-chip i {
    font-size: 1.4rem;
    width: 30px;
    color: #38bdf8;
}

.skill-chip span {
    color: #cbd5e6;
    font-weight: 500;
    font-size: 0.95rem;
}

.skill-chip:hover {
    background: #1e293b;
    border-color: #38bdf8;
    transform: translateX(-5px);
    box-shadow: 0 5px 12px rgba(56, 189, 248, 0.2);
}

body.ltr .skill-chip:hover {
    transform: translateX(5px);
}

.nav-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 0.8rem 1.8rem;
    border-radius: 60px;
    color: #38bdf8;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #38bdf8;
    transition: 0.3s;
    font-size: 0.95rem;
}

.nav-btn:hover {
    background: #38bdf8;
    color: #0f172a;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px #38bdf880;
}

.about-contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem 2.5rem;
    background: rgba(10, 20, 35, 0.5);
    border-top: 1px solid #334155;
    border-bottom: 1px solid #334155;
}

.about-box, .contact-box {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #334155;
    transition: 0.3s;
}

.about-box:hover, .contact-box:hover {
    border-color: #38bdf8;
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.1);
}

.box-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #334155;
}

.about-text {
    color: #cbd5e6;
    line-height: 1.8;
    font-size: 0.95rem;
}

.about-text p {
    margin-bottom: 1rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5e6;
    font-size: 0.95rem;
    padding: 0.5rem;
    border-radius: 0.8rem;
    transition: 0.2s;
}

.contact-item i {
    width: 30px;
    font-size: 1.2rem;
    color: #38bdf8;
}

.contact-item:hover {
    background: #1e293b;
    transform: translateX(-5px);
}

body.ltr .contact-item:hover {
    transform: translateX(5px);
}

.contact-item a {
    color: #cbd5e6;
    text-decoration: none;
    transition: 0.2s;
}

.contact-item a:hover {
    color: #38bdf8;
}

.simple-form {
    margin-top: 1rem;
}

.simple-form input, .simple-form textarea {
    width: 100%;
    padding: 0.7rem;
    margin-bottom: 0.8rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.8rem;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.9rem;
    transition: 0.2s;
}

.simple-form input:focus, .simple-form textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 5px #38bdf8;
}

.simple-form button {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #38bdf8;
    border: 1px solid #38bdf8;
    padding: 0.7rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    font-family: inherit;
}

.simple-form button:hover {
    background: #38bdf8;
    color: #0f172a;
}

.social-section {
    padding: 1.5rem 2.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #334155;
}

.social-title {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.8rem;
    flex-wrap: wrap;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #1e293b;
    border-radius: 50%;
    color: #94a3b8;
    font-size: 1.6rem;
    transition: all 0.3s ease;
    border: 1px solid #334155;
    text-decoration: none;
}

.social-icons a:hover {
    transform: translateY(-5px);
    border-color: #38bdf8;
    color: #38bdf8;
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.3);
}

.footer-dev {
    background: #020617cc;
    padding: 1.3rem;
    text-align: center;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #7e8aa2;
}

.main-content {
    transition: opacity 0.4s ease-in-out;
}

@media (max-width: 880px) {
    .about-contact {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .dev-header {
        flex-direction: column;
        text-align: center;
    }
    .bio {
        margin: 0 auto;
    }
    .skills-grid {
        grid-template-columns: 1fr;
    }
    .social-icons {
        gap: 1rem;
    }
    .nav-links {
        justify-content: center;
    }
    .lang-switch {
        position: static;
        margin-bottom: 1rem;
        display: flex;
        justify-content: flex-end;
    }
    body.rtl .lang-switch {
        justify-content: flex-start;
    }
}