:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0f4c75;
    --highlight: #00b4d8;
    --text: #e6e6e6;
    --text-secondary: #b0b0b0;
    --card-bg: rgba(30, 30, 46, 0.7);
    --glass: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

body[dir="rtl"] {
    font-family: 'Vazirmatn', sans-serif;
}

body[dir="ltr"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body[dir="rtl"] .project-link i,
body[dir="rtl"] .btn i {
    transform: rotate(180deg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Language Selector */
.language-selector {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 10px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass);
}

.lang-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--highlight));
    color: white;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Particles Background */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Header Styles */
header {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 20px;
}

.floating-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.floating-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(15, 76, 117, 0.1) 0%, transparent 70%);
    z-index: -1;
}

.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--highlight));
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 180, 216, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.avatar i {
    font-size: 4rem;
    color: white;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, var(--text), var(--highlight));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.tagline {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-weight: 300;
}

.highlight {
    color: var(--highlight);
    font-weight: 500;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--highlight));
    color: white;
    box-shadow: 0 5px 15px rgba(0, 180, 216, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 180, 216, 0.4);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

/* Section Styles */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title h2 {
    font-size: 2.5rem;
    display: inline-block;
    position: relative;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--highlight));
    border-radius: 2px;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 20px;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.skill-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass);
    transition: transform 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
}

.skill-card i {
    font-size: 2.5rem;
    color: var(--highlight);
    margin-bottom: 15px;
}

.skill-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

/* Experience Section */
.experience {
    background: rgba(10, 10, 20, 0.5);
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--accent), var(--highlight));
    right: 50%;
    transform: translateX(50%);
    border-radius: 2px;
}

.timeline-item {
    padding: 20px 40px;
    position: relative;
    width: 50%;
    margin-bottom: 50px;
}

.timeline-item:nth-child(odd) {
    right: 0;
}

.timeline-item:nth-child(even) {
    right: 50%;
}

.timeline-content {
    padding: 30px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass);
    position: relative;
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
}

.timeline-content::after {
    content: '';
    position: absolute;
    top: 30px;
    width: 20px;
    height: 20px;
    background: var(--card-bg);
    transform: rotate(45deg);
    border: 1px solid var(--glass);
    border-top: none;
    border-left: none;
}

.timeline-item:nth-child(odd) .timeline-content::after {
    left: -10px;
}

.timeline-item:nth-child(even) .timeline-content::after {
    right: -10px;
}

.timeline-date {
    font-weight: 600;
    color: var(--highlight);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-date i {
    font-size: 1.1rem;
}

.timeline-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.timeline-content h4 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass);
    transition: all 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, var(--accent), var(--highlight));
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 3.5rem;
    position: relative;
    overflow: hidden;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
}

.project-content {
    padding: 25px;
}

.project-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    color: var(--highlight);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.project-link:hover {
    gap: 12px;
}

/* Contact Section */
.contact {
    background: rgba(10, 10, 20, 0.7);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass);
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-5px);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent), var(--highlight));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
}

.contact-form {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass);
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--highlight);
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    background: rgba(5, 5, 10, 0.9);
    padding: 40px 0;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-link {
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text);
    font-size: 1.3rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--glass);
}

.social-link:hover {
    background: linear-gradient(135deg, var(--accent), var(--highlight));
    color: white;
    transform: translateY(-5px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass);
    text-align: center;
}

.modal h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--highlight);
}

.modal p {
    margin-bottom: 20px;
}

.close-modal {
    background: var(--highlight);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: var(--accent);
}

/* Responsive */
@media (max-width: 992px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .language-selector {
        top: 10px;
        left: 10px;
        right: 10px;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1.2rem;
    }
    
    .timeline::before {
        right: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-right: 70px;
        padding-left: 25px;
    }
    
    .timeline-item:nth-child(even) {
        right: 0;
    }
    
    .timeline-item:nth-child(odd) .timeline-content::after,
    .timeline-item:nth-child(even) .timeline-content::after {
        left: -10px;
        right: auto;
    }
    
    .skills-container {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .language-selector {
        flex-direction: column;
        border-radius: 15px;
    }
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.loading {
    display: none;
    text-align: center;
    margin-top: 10px;
}

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid var(--highlight);
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}