/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0F0F23;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    /* Block scrolling during loading */
    pointer-events: auto;
    overflow: hidden;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Force loading screen to be visible on all devices */
#loading-screen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #0F0F23 !important;
    /* Block scrolling during loading */
    pointer-events: auto !important;
    overflow: hidden !important;
}

/* Main Content Fade-in Animation */
.main-content {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity;
}

.main-content.fade-in {
    opacity: 1;
}

/* Smooth site entrance animation */
@keyframes siteFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content.site-entrance {
    animation: siteFadeIn 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Enhanced slideInUp animation for hero elements */
@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
        visibility: visible;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }
}

/* From Uiverse.io by dexter-st */ 
.loader-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 180px;
    font-family: "Inter", sans-serif;
    font-size: 1.2em;
    font-weight: 300;
    color: white;
    border-radius: 50%;
    background-color: transparent;
    user-select: none;
    direction: ltr !important;
    text-align: center !important;
}

.loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background-color: transparent;
    animation: loader-rotate 2s linear infinite;
    z-index: 0;
}

@keyframes loader-rotate {
    0% {
        transform: rotate(90deg);
        box-shadow:
            0 10px 20px 0 #fff inset,
            0 20px 30px 0 #ad5fff inset,
            0 60px 60px 0 #471eec inset;
    }
    50% {
        transform: rotate(270deg);
        box-shadow:
            0 10px 20px 0 #fff inset,
            0 20px 10px 0 #d60a47 inset,
            0 40px 60px 0 #311e80 inset;
    }
    100% {
        transform: rotate(450deg);
        box-shadow:
            0 10px 20px 0 #fff inset,
            0 20px 30px 0 #ad5fff inset,
            0 60px 60px 0 #471eec inset;
    }
}

.loader-letter {
    display: inline-block;
    opacity: 0.4;
    transform: translateY(0);
    animation: loader-letter-anim 2s infinite;
    z-index: 1;
    border-radius: 50ch;
    border: none;
}

.loader-letter:nth-child(1) {
    animation-delay: 0s;
}
.loader-letter:nth-child(2) {
    animation-delay: 0.1s;
}
.loader-letter:nth-child(3) {
    animation-delay: 0.2s;
}
.loader-letter:nth-child(4) {
    animation-delay: 0.3s;
}
.loader-letter:nth-child(5) {
    animation-delay: 0.4s;
}
.loader-letter:nth-child(6) {
    animation-delay: 0.5s;
}
.loader-letter:nth-child(7) {
    animation-delay: 0.6s;
}
.loader-letter:nth-child(8) {
    animation-delay: 0.7s;
}
.loader-letter:nth-child(9) {
    animation-delay: 0.8s;
}
.loader-letter:nth-child(10) {
    animation-delay: 0.9s;
}

@keyframes loader-letter-anim {
    0%,
    100% {
        opacity: 0.4;
        transform: translateY(0);
    }
    20% {
        opacity: 1;
        transform: scale(1.15);
    }
    40% {
        opacity: 0.7;
        transform: translateY(0);
    }
}

:root {
    --primary-color: #8B5CF6;
    --secondary-color: #A855F7;
    --accent-color: #F59E0B;
    --dark-bg: #0F0F23;
    --darker-bg: #0A0A1A;
    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;
    --gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
    --gradient-secondary: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
    --shadow-primary: 0 10px 30px rgba(139, 92, 246, 0.3);
    --shadow-secondary: 0 5px 15px rgba(0, 0, 0, 0.3);
}

html {
    scroll-behavior: smooth;
    /* Optimize for mobile scrolling */
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    /* Optimize for mobile scrolling */
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
    /* Ensure smooth scrolling */
    scroll-behavior: smooth;
    /* Prevent double scrollbar */
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo .logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

.language-switcher {
    margin-left: 1rem;
}

.lang-btn {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1000;
    pointer-events: auto;
    user-select: none;
}

.lang-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.lang-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.lang-btn:active {
    transform: translateY(0);
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    will-change: transform;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 20s linear infinite;
}

@keyframes twinkle {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-100px); }
}

.mountains {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(45deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 25%, 
        var(--darker-bg) 50%, 
        var(--primary-color) 75%, 
        var(--secondary-color) 100%);
    clip-path: polygon(0 100%, 0 40%, 20% 20%, 40% 30%, 60% 10%, 80% 25%, 100% 15%, 100% 100%);
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.floating-icons {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-icons i {
    position: absolute;
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.6;
    animation: floatIcon 8s ease-in-out infinite;
}

.floating-icons i:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.floating-icons i:nth-child(2) { top: 30%; right: 15%; animation-delay: 1s; }
.floating-icons i:nth-child(3) { top: 60%; left: 20%; animation-delay: 2s; }
.floating-icons i:nth-child(4) { top: 70%; right: 25%; animation-delay: 3s; }
.floating-icons i:nth-child(5) { top: 40%; left: 50%; animation-delay: 4s; }
.floating-icons i:nth-child(6) { top: 80%; right: 10%; animation-delay: 5s; }

@keyframes floatIcon {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.title-line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    visibility: hidden;
    /* Animation will be triggered by JavaScript after loading screen */
}

.title-line:nth-child(1) {
    /* Animation delay will be set by JavaScript */
}

.title-line:nth-child(2) {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.subtitle-line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    visibility: hidden;
    /* Animation will be triggered by JavaScript after loading screen */
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(30px);
    visibility: hidden;
    /* Animation will be triggered by JavaScript after loading screen */
}

.btn {
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-primary);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
}

.btn-secondary:hover {
    background: var(--text-primary);
    color: var(--dark-bg);
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 30px;
    height: 30px;
    border-right: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    transform: rotate(45deg);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-15px);
    }
    60% {
        transform: translateX(-50%) translateY(-8px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Section Styles */
section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* About Section */
.about {
    background: var(--darker-bg);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.about-traits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.trait {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

.trait:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

.trait i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.profile-card {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(10px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.card-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.card-info p {
    color: var(--text-secondary);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

.info-item i {
    color: var(--primary-color);
    width: 20px;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.skill-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-5px);
    background: rgba(139, 92, 246, 0.2);
    box-shadow: var(--shadow-primary);
}

.skill-item i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.skill-item span {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* Education Section */
.education {
    background: var(--darker-bg);
}

.education-timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.education-timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-primary);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 80px;
}

.timeline-marker {
    position: absolute;
    left: 20px;
    top: 0;
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    border: 4px solid var(--dark-bg);
}

.timeline-content {
    background: rgba(139, 92, 246, 0.1);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(10px);
}

.timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.timeline-location {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.timeline-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.timeline-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Portfolio Section */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.portfolio-item {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-primary);
}

.portfolio-image {
    position: relative;
    height: 250px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-preview {
    font-size: 4rem;
    color: white;
    opacity: 0.8;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-link {
    color: white;
    font-size: 2rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.portfolio-link:hover {
    transform: scale(1.2);
}

.portfolio-content {
    padding: 2rem;
}

.portfolio-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.portfolio-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.portfolio-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: var(--gradient-primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Contact Section */
.contact {
    background: var(--darker-bg);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-2px);
    background: rgba(139, 92, 246, 0.2);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 30px;
}

.contact-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: var(--primary-color);
}

.contact-item p {
    color: var(--text-secondary);
}

/* Phone Contact Actions */
.phone-item {
    position: relative;
    transition: all 0.3s linear;
}

.phone-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

/* Telegram Contact Actions */
.telegram-item {
    position: relative;
    transition: all 0.3s linear;
    cursor: pointer;
}

.telegram-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.3);
}

.telegram-username {
    cursor: pointer;
    transition: all 0.3s linear;
}

.telegram-username:hover {
    color: #0088cc;
    transform: scale(1.05);
}

/* Instagram Contact Actions */
.instagram-item {
    position: relative;
    transition: all 0.3s linear;
    cursor: pointer;
}

.instagram-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(225, 48, 108, 0.3);
}

.instagram-username {
    cursor: pointer;
    transition: all 0.3s linear;
}

.instagram-username:hover {
    color: #e1306c;
    transform: scale(1.05);
}


.copy-btn, .call-btn, .telegram-btn, .instagram-btn {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s linear;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.telegram-btn {
    background: rgba(0, 136, 204, 0.2);
    border: 1px solid rgba(0, 136, 204, 0.5);
}

.instagram-btn {
    background: rgba(225, 48, 108, 0.2);
    border: 1px solid rgba(225, 48, 108, 0.5);
}

.copy-btn:hover, .call-btn:hover {
    background: rgba(139, 92, 246, 0.4);
    border-color: rgba(139, 92, 246, 0.8);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.telegram-btn:hover {
    background: rgba(0, 136, 204, 0.4);
    border-color: rgba(0, 136, 204, 0.8);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.instagram-btn:hover {
    background: rgba(225, 48, 108, 0.4);
    border-color: rgba(225, 48, 108, 0.8);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3);
}

.copy-btn:active, .call-btn:active {
    transform: scale(0.95);
}

.copy-btn i, .call-btn i {
    font-size: 0.9rem;
}

/* Copy Success Animation */
.copy-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(100%);
    transition: all 0.3s linear;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.copy-success.show {
    transform: translateX(0);
}

.copy-success i {
    margin-left: 8px;
    font-size: 1.1rem;
}

/* Notification styles */
.notification {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-content i {
    font-size: 1.2rem;
}

/* Form loading state */
button[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.contact-form {
    background: rgba(139, 92, 246, 0.1);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    white-space: pre-wrap; /* Allow spaces and line breaks */
    word-wrap: break-word; /* Break long words */
    resize: vertical; /* Allow vertical resize */
    box-sizing: border-box; /* Include padding in width */
}

/* Specific textarea styles */
.form-group textarea {
    min-height: 120px;
    line-height: 1.5;
    white-space: pre-wrap !important;
    word-break: break-word;
    overflow-wrap: break-word;
    font-family: 'Vazirmatn', sans-serif !important;
    direction: rtl !important;
    text-align: right !important;
}

/* Force textarea to accept spaces */
#message {
    white-space: pre-wrap !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    font-family: 'Vazirmatn', sans-serif !important;
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

/* Override any conflicting styles */
textarea[name="message"] {
    white-space: pre-wrap !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    font-family: 'Vazirmatn', sans-serif !important;
    direction: rtl !important;
    text-align: right !important;
}

/* Force textarea to accept spaces - more specific */
#message, textarea#message, textarea[name="message"] {
    white-space: pre-wrap !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    font-family: 'Vazirmatn', sans-serif !important;
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: auto !important;
    -moz-osx-font-smoothing: auto !important;
    font-feature-settings: normal !important;
    font-variant-ligatures: normal !important;
    text-transform: none !important;
    font-kerning: auto !important;
}

/* Additional textarea fixes */
textarea {
    white-space: pre-wrap !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-primary);
}

/* Footer */
.footer {
    background: var(--darker-bg);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
}

.footer p {
    color: var(--text-muted);
}

/* Mobile Performance Optimizations */
@media (max-width: 768px) {
    /* Optimize scroll performance */
    body {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
        overflow-x: hidden;
    }
    
    /* Ensure proper viewport */
    html {
        overflow-x: hidden;
    }
    
    /* Container responsive */
    .container {
        max-width: 100%;
        padding: 0 1rem;
        margin: 0 auto;
    }
    
    /* Reduce animations on mobile for better performance */
    .floating-icons i {
        animation: none;
    }
    
    .stars {
        animation: none;
    }
    
    .mountains {
        animation: none;
    }
    
    /* Simplify transitions on mobile */
    .nav-link, .btn, .skill-item, .portfolio-item, .contact-item, .trait {
        transition: transform 0.2s ease, opacity 0.2s ease;
    }
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--darker-bg);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.3);
        padding: 2rem 0;
        z-index: 1000;
        height: calc(100vh - 70px);
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
    }

    .nav-menu.active {
        left: 0;
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: flex;
        z-index: 1001;
        cursor: pointer;
        position: relative;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Ensure hamburger menu works properly */
    .nav-toggle .bar {
        width: 25px;
        height: 3px;
        background: var(--text-primary);
        margin: 3px 0;
        transition: 0.3s;
        display: block;
    }
    
    /* Remove overlay - use JavaScript instead */
    
    .nav-link {
        padding: 1rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(139, 92, 246, 0.1);
        display: block;
        width: 100%;
        text-decoration: none;
        color: var(--text-primary);
        transition: color 0.3s ease;
    }
    
    .nav-link:hover {
        color: var(--primary-color);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    /* Language button styling */
    .language-switcher {
        margin-left: 0;
        margin-top: 1rem;
        position: relative;
        z-index: 1002;
    }
    
    .lang-btn {
        background: var(--gradient-primary);
        border: none;
        color: white;
        padding: 8px 16px;
        border-radius: 20px;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.3s ease;
        font-size: 0.9rem;
        position: relative;
        z-index: 1002;
        pointer-events: auto;
    }
    
    .lang-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-primary);
    }
    
    .lang-btn:active {
        transform: translateY(0);
    }
    
    .lang-btn:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .skill-items {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .copy-btn, .call-btn, .telegram-btn, .instagram-btn {
        min-width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }

    .about-traits {
        grid-template-columns: 1fr;
    }

    .timeline-item {
        padding-left: 60px;
    }

    .education-timeline::before {
        left: 20px;
    }

    .timeline-marker {
        left: 10px;
    }
    
    /* Navigation responsive fixes */
    .nav-container {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .nav-brand {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--darker-bg);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.3);
        padding: 2rem 0;
        z-index: 1000;
        height: calc(100vh - 70px);
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
    }
    
    .nav-menu.active {
        left: 0;
        opacity: 1;
        visibility: visible;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1001;
        cursor: pointer;
        position: relative;
    }
    
    .nav-toggle .bar {
        width: 25px;
        height: 3px;
        background: var(--text-primary);
        margin: 3px 0;
        transition: 0.3s;
        display: block;
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .nav-link {
        padding: 1rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(139, 92, 246, 0.1);
        display: block;
        width: 100%;
        text-decoration: none;
        color: var(--text-primary);
        transition: color 0.3s ease;
    }
    
    .nav-link:hover {
        color: var(--primary-color);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    /* Language button styling */
    .language-switcher {
        margin-left: 0;
        margin-top: 1rem;
        position: relative;
        z-index: 1002;
    }
    
    .lang-btn {
        background: var(--gradient-primary);
        border: none;
        color: white;
        padding: 8px 16px;
        border-radius: 20px;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.3s ease;
        font-size: 0.9rem;
        position: relative;
        z-index: 1002;
        pointer-events: auto;
    }
    
    .lang-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-primary);
    }
    
    .lang-btn:active {
        transform: translateY(0);
    }
    
    .lang-btn:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    /* Hero section responsive */
    .hero {
        height: 100vh;
        padding: 0 1rem;
    }
    
    .hero-content {
        padding: 0 1rem;
        text-align: center;
        max-width: 100%;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
        margin-bottom: 2rem;
        line-height: 1.6;
    }
    
    /* Sections responsive */
    .section {
        padding: 3rem 1rem;
        max-width: 100%;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        text-align: center;
    }
    
    /* About section responsive */
    .about-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 100%;
    }
    
    .about-text {
        font-size: 0.9rem;
        line-height: 1.6;
        text-align: center;
    }
    
    .about-traits {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Skills section responsive */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 100%;
    }
    
    .skill-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .skill-item {
        padding: 1rem;
        font-size: 0.9rem;
        text-align: center;
    }
    
    /* Portfolio section responsive */
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 100%;
    }
    
    .portfolio-item {
        padding: 1.5rem;
        text-align: center;
    }
    
    .portfolio-item h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .portfolio-item p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .portfolio-item ul {
        font-size: 0.8rem;
        margin-bottom: 1rem;
        text-align: left;
    }
    
    /* Education section responsive */
    .education-timeline {
        padding-left: 0;
    }
    
    .timeline-item {
        padding-left: 50px;
        margin-bottom: 1.5rem;
    }
    
    .timeline-marker {
        left: 15px;
        width: 10px;
        height: 10px;
    }
    
    .timeline-content h3 {
        font-size: 1.1rem;
    }
    
    .timeline-content p {
        font-size: 0.9rem;
    }
    
    /* Contact section responsive */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 100%;
    }
    
    .contact-item {
        padding: 1rem;
        text-align: center;
    }
    
    .contact-item h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .contact-item p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .contact-actions {
        opacity: 1;
        transform: translateY(0);
        margin-top: 8px;
        justify-content: center;
    }
    
    .copy-btn, .call-btn, .telegram-btn, .instagram-btn {
        min-width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
    
    
    /* Buttons responsive */
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Form responsive */
    .contact-form {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 0.9rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-group textarea {
        min-height: 120px;
    }
    
    /* Footer responsive */
    .footer {
        padding: 2rem 1rem;
        text-align: center;
        max-width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        max-width: 100%;
    }
    
    .social-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .social-links a {
        margin: 0.5rem;
    }
    
    /* Loading screen responsive */
    .loading-screen {
        padding: 1rem;
        max-width: 100%;
    }
    
    .loading-text {
        font-size: 1.2rem;
        text-align: center;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
    
    /* Ensure all elements are responsive */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix any overflow issues */
    .container, .section, .hero, .nav-container {
        overflow-x: hidden;
    }
    
    /* RTL mobile fixes */
    [dir="rtl"] .nav-menu {
        left: auto;
        right: -100%;
        transition: right 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    }
    
    [dir="rtl"] .nav-menu.active {
        left: auto;
        right: 0;
    }
    
    [dir="rtl"] .timeline-item {
        padding-left: 0;
        padding-right: 50px;
    }
    
    [dir="rtl"] .education-timeline::before {
        left: auto;
        right: 20px;
    }
    
    [dir="rtl"] .timeline-marker {
        left: auto;
        right: 15px;
    }
    
    /* Prevent mobile layout jumping */
    [dir="rtl"] body, [dir="ltr"] body {
        transition: none !important;
    }
    
    [dir="rtl"] html, [dir="ltr"] html {
        transition: none !important;
    }

    /* Hide auto scroll navigator on mobile */
    .auto-scroll-navigator {
        display: none !important;
    }
    
    /* Hide scroll progress on mobile for better performance */
    .scroll-progress {
        display: none;
    }
}

@media (max-width: 1024px) {
    .auto-scroll-navigator {
        right: 20px;
    }
    
    .current-section-indicator {
        width: 35px;
        height: 55px;
        padding: 10px 0;
        transition: all 0.3s linear;
    }
    
    .section-number {
        width: 14px;
        height: 14px;
    }
    
    .scroll-arrow-down {
        width: 10px;
        height: 10px;
    }
    
    .section-separator {
        width: 1px;
        height: 5px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .skill-items {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
    }
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(139, 92, 246, 0.2);
    z-index: 1001;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* Auto Scroll Navigator - Minimalist Design */
.auto-scroll-navigator {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scroll-indicator-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.current-section-indicator {
    width: 40px;
    height: 60px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    cursor: pointer;
    transition: all 0.3s linear;
    position: relative;
    backdrop-filter: blur(5px);
    overflow: hidden;
    will-change: transform, border-color, box-shadow;
}

.current-section-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: all 0.3s linear;
    border-radius: 20px;
}

.current-section-indicator:hover {
    transform: scale(1.05) translateX(-3px);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.1);
}

.current-section-indicator:hover::before {
    opacity: 1;
}

.section-number {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s linear;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
}

.section-separator {
    width: 1px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0.5px;
    transition: all 0.3s linear;
    position: relative;
    z-index: 2;
    border-style: dotted;
    border-width: 0 1px 0 0;
    border-color: rgba(255, 255, 255, 0.6);
}

.scroll-arrow-down {
    width: 12px;
    height: 12px;
    border-right: 1.5px solid rgba(255, 255, 255, 0.8);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.8);
    transform: rotate(45deg);
    animation: bounceArrow 2.5s infinite;
    position: relative;
    z-index: 2;
    transition: all 0.3s linear;
}

.current-section-indicator:hover .scroll-arrow-down {
    border-color: rgba(255, 255, 255, 1);
    animation: bounceArrow 1.5s infinite;
    transform: rotate(45deg) scale(1.05);
}

.current-section-indicator:hover .section-separator {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
}

.current-section-indicator:hover .section-number {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
}

@keyframes bounceArrow {
    0%, 20%, 50%, 80%, 100% {
        transform: rotate(45deg) translateY(0);
        opacity: 0.7;
    }
    40% {
        transform: rotate(45deg) translateY(-3px);
        opacity: 1;
    }
    60% {
        transform: rotate(45deg) translateY(-2px);
        opacity: 0.8;
    }
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Smooth Section Transitions */
section {
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1;
    transform: translateY(0);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced scroll smoothness */
* {
    scroll-behavior: smooth;
}

/* Disable scroll during auto scroll */
body.scrolling-disabled {
    overflow: hidden;
}

/* Ensure loading screen blocks scrolling */
body.loading {
    overflow: hidden !important;
}

html.loading {
    overflow: hidden !important;
}

/* Smooth transitions for specific elements only - not all elements */
.nav-link, .btn, .skill-item, .portfolio-item, .contact-item, .trait {
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Simple scroll indicator animations */
.current-section-indicator:hover {
    animation: none;
}

/* Clean section styling - no transitions for smooth scroll */
section {
    opacity: 1;
    transform: translateY(0);
}

/* Ultra smooth scroll container */
.auto-scroll-container {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Remove section transitions for better mobile performance */
section {
    /* No transitions on sections for better mobile scroll performance */
}

/* Enhanced Hero Scroll Indicator */
.hero .scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 3s infinite;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero .scroll-indicator:hover {
    animation-play-state: paused;
    transform: translateX(-50%) scale(1.1);
}

.hero .scroll-indicator .scroll-arrow {
    width: 30px;
    height: 30px;
    border-right: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    transform: rotate(45deg);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.hero .scroll-indicator .scroll-arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero .scroll-indicator:hover .scroll-arrow {
    transform: rotate(45deg) scale(1.2);
    border-color: var(--accent-color);
}

.hero .scroll-indicator:hover .scroll-arrow::before {
    background: var(--accent-color);
    animation: pulse 1s infinite;
}

/* RTL Support - Fixed to prevent jumping */
[dir="rtl"] .hero-buttons {
    direction: rtl;
}

[dir="rtl"] .about-traits {
    direction: rtl;
}

[dir="rtl"] .skill-items {
    direction: rtl;
}

[dir="rtl"] .timeline-item {
    padding-left: 0;
    padding-right: 80px;
}

[dir="rtl"] .education-timeline::before {
    left: auto;
    right: 30px;
}

[dir="rtl"] .timeline-marker {
    left: auto;
    right: 20px;
}

[dir="rtl"] .auto-scroll-navigator {
    right: auto;
    left: 30px;
}

[dir="rtl"] .current-section-indicator:hover {
    transform: scale(1.1) translateX(5px);
}

/* Prevent layout jumping when switching languages */
body {
    overflow-x: hidden;
    position: relative;
    /* Force scrollbar to always be on the right */
    direction: ltr;
}

html {
    overflow-x: hidden;
    /* Prevent double scrollbar */
    margin: 0;
    padding: 0;
    height: 100%;
    /* Force scrollbar to always be on the right */
    direction: ltr;
}

/* Ensure smooth language switching */
[dir="rtl"], [dir="ltr"] {
    transition: none !important;
}

/* Force scrollbar to always be on the right for all languages */
[dir="rtl"] body,
[dir="ltr"] body {
    direction: ltr !important;
}

[dir="rtl"] html,
[dir="ltr"] html {
    direction: ltr !important;
}

/* Text alignment for different languages */
[dir="rtl"] {
    text-align: right;
}

[dir="ltr"] {
    text-align: left;
}

/* Force text alignment for specific elements - only text content */
[dir="rtl"] .about-description,
[dir="rtl"] .timeline-description,
[dir="rtl"] .portfolio-content p,
[dir="rtl"] .info-item span,
[dir="rtl"] .timeline-content p {
    text-align: right !important;
    direction: rtl !important;
}

[dir="ltr"] .about-description,
[dir="ltr"] .timeline-description,
[dir="ltr"] .portfolio-content p,
[dir="ltr"] .info-item span,
[dir="ltr"] .timeline-content p {
    text-align: left !important;
    direction: ltr !important;
}

/* Specific text alignment for profile card - only text content */
[dir="rtl"] .profile-card .card-info p,
[dir="rtl"] .profile-card .card-content .info-item span {
    text-align: right !important;
    direction: rtl !important;
}

[dir="ltr"] .profile-card .card-info p,
[dir="ltr"] .profile-card .card-content .info-item span {
    text-align: left !important;
    direction: ltr !important;
}

/* Force text alignment for timeline items - only text content */
[dir="rtl"] .timeline-item .timeline-content p {
    text-align: right !important;
    direction: rtl !important;
}

[dir="ltr"] .timeline-item .timeline-content p {
    text-align: left !important;
    direction: ltr !important;
}

/* Force text alignment for portfolio items - only text content */
[dir="rtl"] .portfolio-item .portfolio-content p {
    text-align: right !important;
    direction: rtl !important;
}

[dir="ltr"] .portfolio-item .portfolio-content p {
    text-align: left !important;
    direction: ltr !important;
}


/* Force text alignment for form elements - only input content */
[dir="rtl"] .form-group input,
[dir="rtl"] .form-group textarea {
    text-align: right !important;
    direction: rtl !important;
}

[dir="ltr"] .form-group input,
[dir="ltr"] .form-group textarea {
    text-align: left !important;
    direction: ltr !important;
}


/* Keep section titles centered */
.section-title {
    text-align: center !important;
}

/* Keep hero content centered */
.hero-title,
.hero-subtitle {
    text-align: center !important;
}

/* Keep navigation centered */
.nav-menu {
    text-align: center !important;
}

/* Keep footer centered */
.footer p {
    text-align: center !important;
}

/* Force contact items to be left-aligned */
.contact-item {
    text-align: left !important;
    direction: ltr !important;
}

.contact-item h3,
.contact-item p {
    text-align: left !important;
    direction: ltr !important;
}

.contact-info {
    text-align: left !important;
    direction: ltr !important;
}

/* Make email item clickable */
.email-item {
    cursor: pointer;
}

.email-item:hover {
    opacity: 0.8;
}

/* Override RTL for contact items - keep them left-aligned */
[dir="rtl"] .contact-item {
    text-align: left !important;
    direction: ltr !important;
}

[dir="rtl"] .contact-item h3,
[dir="rtl"] .contact-item p {
    text-align: left !important;
    direction: ltr !important;
}

[dir="rtl"] .contact-info {
    text-align: left !important;
    direction: ltr !important;
}

/* Force profile title to be left-aligned */
.profile-card .card-info p {
    text-align: left !important;
    direction: ltr !important;
}

[dir="rtl"] .profile-card .card-info p {
    text-align: left !important;
    direction: ltr !important;
}

/* Force profile card info to be left-aligned */
.profile-card .card-info {
    text-align: left !important;
    direction: ltr !important;
}

[dir="rtl"] .profile-card .card-info {
    text-align: left !important;
    direction: ltr !important;
}

/* Force portfolio tech tags alignment */
[dir="rtl"] .portfolio-tech {
    text-align: right !important;
    direction: rtl !important;
}

[dir="rtl"] .tech-tag {
    text-align: right !important;
    direction: rtl !important;
}

[dir="ltr"] .portfolio-tech {
    text-align: left !important;
    direction: ltr !important;
}

[dir="ltr"] .tech-tag {
    text-align: left !important;
    direction: ltr !important;
}

/* Prevent layout jumping */
body, html {
    transition: none !important;
}

/* Simple smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Force scroll to work */
body {
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Ensure sections are scrollable */
section {
    position: relative;
    z-index: 1;
}

/* Remove any scroll blocking */
* {
    scroll-behavior: smooth;
}

/* Fix scroll issues */
html, body {
    height: auto;
    min-height: 100%;
}

/* Ensure main content is scrollable */
.main-content {
    overflow: visible;
    position: relative;
}

/* Navigation link hover effects */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Beautiful Custom Scrollbar - Always on the right */
::-webkit-scrollbar {
    width: 8px;
    /* Force scrollbar to always be on the right */
    direction: ltr;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
    border-radius: 10px;
    /* Ensure track is always on the right */
    direction: ltr;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    border: 2px solid var(--darker-bg);
    /* Ensure thumb is always on the right */
    direction: ltr;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--accent-color), var(--primary-color));
}

/* Firefox scrollbar - Always on the right */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--darker-bg);
    /* Force scrollbar to always be on the right */
    direction: ltr;
}

/* Smooth scrollbar transitions */
::-webkit-scrollbar-thumb {
    transition: all 0.3s ease;
}

/* Force scrollbar position for all languages */
[dir="rtl"] ::-webkit-scrollbar,
[dir="ltr"] ::-webkit-scrollbar {
    direction: ltr !important;
}

[dir="rtl"] ::-webkit-scrollbar-track,
[dir="ltr"] ::-webkit-scrollbar-track {
    direction: ltr !important;
}

[dir="rtl"] ::-webkit-scrollbar-thumb,
[dir="ltr"] ::-webkit-scrollbar-thumb {
    direction: ltr !important;
}

/* Prevent double scrollbar */
* {
    box-sizing: border-box;
}

/* Ensure only one scrollbar */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    /* Force scrollbar to always be on the right */
    direction: ltr;
}

/* Force scrollbar position for all languages */
[dir="rtl"] body,
[dir="ltr"] body {
    direction: ltr !important;
}

[dir="rtl"] html,
[dir="ltr"] html {
    direction: ltr !important;
}

/* Hide scrollbar on mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        /* Force scrollbar to always be on the right */
        direction: ltr;
    }
    
    ::-webkit-scrollbar-thumb {
        border: 1px solid var(--darker-bg);
        /* Force scrollbar to always be on the right */
        direction: ltr;
    }
    
    /* Hide scrollbar completely on mobile for cleaner look */
    body {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    body::-webkit-scrollbar {
        display: none;
    }
    
    /* Force scrollbar position for all languages on mobile */
    [dir="rtl"] ::-webkit-scrollbar,
    [dir="ltr"] ::-webkit-scrollbar {
        direction: ltr !important;
    }
    
    [dir="rtl"] ::-webkit-scrollbar-thumb,
    [dir="ltr"] ::-webkit-scrollbar-thumb {
        direction: ltr !important;
    }
}

/* Fix RTL navigation positioning */
[dir="rtl"] .nav-menu {
    left: auto;
    right: -100%;
    transition: right 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

[dir="rtl"] .nav-menu.active {
    left: auto;
    right: 0;
}

/* Fix RTL layout issues */
[dir="rtl"] .nav-menu {
    left: auto;
    right: -100%;
}

[dir="rtl"] .nav-menu.active {
    left: auto;
    right: 0;
}

[dir="rtl"] .timeline-item {
    padding-left: 0;
    padding-right: 80px;
}

[dir="rtl"] .education-timeline::before {
    left: auto;
    right: 30px;
}

[dir="rtl"] .timeline-marker {
    left: auto;
    right: 20px;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}
