:root {
    --midnight-code: #0F1C2E;
    --lapis-guard: #1F3A5F;
    --achaemenid-gold: #C8A24A;
    --persepolis-stone: #F5F1E8;
    --turquoise-glaze: #2A9D8F;
    --royal-brick: #A64B2A;
    --glass-bg: rgba(15, 28, 46, 0.7);
    --glass-border: rgba(200, 162, 74, 0.2);
}

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

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip; /* جلوگیری کامل از اسکرول افقی */
    overflow-y: auto;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--midnight-code);
    color: var(--persepolis-stone);
    scroll-behavior: smooth;
    position: relative;
}

body.en {
    direction: ltr;
}

/* در صورت نیاز، اسکرول بدنه را قفل می‌کنیم وقتی سایدبار باز است */
body.no-scroll {
    overflow: hidden;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--midnight-code);
}

::-webkit-scrollbar-thumb {
    background: var(--achaemenid-gold);
    border-radius: 4px;
}

#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.main-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw; /* برای موبایل */
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    z-index: 100;
    overflow-y: auto;
    padding: 20px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body.en .sidebar {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--glass-border);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--achaemenid-gold);
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.project-3d-card {
    background: rgba(31, 58, 95, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.4s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-3d-card:hover {
    transform: rotateY(-5deg) rotateX(5deg) translateZ(10px);
    border-color: var(--achaemenid-gold);
    box-shadow: 0 20px 60px rgba(200, 162, 74, 0.15);
}

.project-3d-card .card-visual {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--lapis-guard), var(--turquoise-glaze));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.project-3d-card .card-visual::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--achaemenid-gold), transparent);
    animation: rotateGlow 4s linear infinite;
    opacity: 0.3;
}

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

.project-3d-card .card-visual i {
    font-size: 2.5rem;
    color: var(--persepolis-stone);
    z-index: 1;
}

.project-3d-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--persepolis-stone);
}

.project-3d-card p {
    font-size: 0.75rem;
    color: rgba(245, 241, 232, 0.6);
}

.project-3d-card .tech-stack {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.project-3d-card .tech-stack span {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(42, 157, 143, 0.2);
    color: var(--turquoise-glaze);
    border: 1px solid rgba(42, 157, 143, 0.3);
}

.content-area {
    flex: 1;
    margin-right: 320px;
    width: calc(100% - 320px);
    max-width: calc(100% - 320px);
}

body.en .content-area {
    margin-right: 0;
    margin-left: 320px;
    width: calc(100% - 320px);
    max-width: calc(100% - 320px);
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 320px;
    height: 70px;
    background: rgba(15, 28, 46, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 99;
    transition: all 0.3s;
}

body.en .navbar {
    right: 0;
    left: 320px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--achaemenid-gold), var(--royal-brick));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--midnight-code);
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--achaemenid-gold), var(--persepolis-stone));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--persepolis-stone);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--achaemenid-gold);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--achaemenid-gold);
    transition: width 0.3s;
}

body.en .nav-links a::after {
    right: auto;
    left: 0;
}

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

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(31, 58, 95, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 5px 15px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--persepolis-stone);
    font-size: 0.85rem;
}

.lang-toggle:hover {
    border-color: var(--achaemenid-gold);
    background: rgba(200, 162, 74, 0.1);
}

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 60px;
    position: relative;
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(42, 157, 143, 0.15);
    border: 1px solid rgba(42, 157, 143, 0.3);
    border-radius: 30px;
    padding: 8px 20px;
    font-size: 0.85rem;
    color: var(--turquoise-glaze);
    margin-bottom: 30px;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--turquoise-glaze);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 25px;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--achaemenid-gold), var(--royal-brick));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(245, 241, 232, 0.7);
    line-height: 1.8;
    margin-bottom: 40px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--achaemenid-gold), var(--royal-brick));
    color: var(--midnight-code);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(200, 162, 74, 0.3);
}

.btn-secondary {
    padding: 15px 40px;
    background: transparent;
    color: var(--persepolis-stone);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-secondary:hover {
    border-color: var(--achaemenid-gold);
    background: rgba(200, 162, 74, 0.1);
    transform: translateY(-3px);
}

.section {
    padding: 100px 60px;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.section-header h2 .highlight {
    background: linear-gradient(135deg, var(--achaemenid-gold), var(--turquoise-glaze));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    color: rgba(245, 241, 232, 0.6);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 35px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--achaemenid-gold), var(--turquoise-glaze));
    transform: scaleX(0);
    transition: transform 0.4s;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--achaemenid-gold);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(200, 162, 74, 0.2), rgba(42, 157, 143, 0.2));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--achaemenid-gold);
}

.service-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--persepolis-stone);
}

.service-card p {
    font-size: 0.9rem;
    color: rgba(245, 241, 232, 0.6);
    line-height: 1.8;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    align-items: stretch;
}

.pricing-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    transition: all 0.4s;
    position: relative;
}

.pricing-card.featured {
    border-color: var(--achaemenid-gold);
    transform: scale(1.05);
    background: rgba(31, 58, 95, 0.6);
}

.pricing-card.featured::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 26px;
    background: linear-gradient(135deg, var(--achaemenid-gold), var(--turquoise-glaze), var(--royal-brick));
    z-index: -1;
    opacity: 0.5;
}

.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-10px);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--achaemenid-gold), var(--royal-brick));
    color: var(--midnight-code);
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pricing-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--persepolis-stone);
}

.pricing-card .price {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--achaemenid-gold);
    margin: 20px 0;
}

.pricing-card .price span {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(245, 241, 232, 0.5);
}

.pricing-features {
    list-style: none;
    margin: 25px 0;
    text-align: start;
}

.pricing-features li {
    padding: 10px 0;
    font-size: 0.9rem;
    color: rgba(245, 241, 232, 0.7);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(245, 241, 232, 0.05);
}

.pricing-features li i {
    color: var(--turquoise-glaze);
    font-size: 0.8rem;
}

.pricing-card .btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: 20px;
}

.contact-section {
    background: rgba(31, 58, 95, 0.2);
    border-radius: 30px;
    margin: 0 60px 100px;
    padding: 60px;
    border: 1px solid var(--glass-border);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.contact-info h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.contact-info p {
    color: rgba(245, 241, 232, 0.6);
    line-height: 1.8;
    margin-bottom: 30px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(15, 28, 46, 0.5);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.contact-item i {
    color: var(--achaemenid-gold);
    font-size: 1.1rem;
    width: 20px;
}

.contact-item span {
    font-size: 0.9rem;
    color: rgba(245, 241, 232, 0.8);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 16px 20px;
    background: rgba(15, 28, 46, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--persepolis-stone);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s;
    outline: none;
}

.form-group textarea {
    min-height: 130px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--achaemenid-gold);
    box-shadow: 0 0 20px rgba(200, 162, 74, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(245, 241, 232, 0.4);
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 60px;
}

.stat-item {
    text-align: center;
    padding: 30px;
    background: var(--glass-bg);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
}

.stat-item:hover {
    transform: translateY(-5px);
    border-color: var(--turquoise-glaze);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--achaemenid-gold);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(245, 241, 232, 0.6);
}

.footer {
    text-align: center;
    padding: 40px;
    border-top: 1px solid var(--glass-border);
    color: rgba(245, 241, 232, 0.5);
    font-size: 0.85rem;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-socials a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(31, 58, 95, 0.5);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--persepolis-stone);
    text-decoration: none;
    transition: all 0.3s;
}

.footer-socials a:hover {
    background: var(--achaemenid-gold);
    color: var(--midnight-code);
    transform: translateY(-3px);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--persepolis-stone);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 1200px) {
    .sidebar {
        transform: translateX(100%);
    }

    body.en .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content-area {
        margin-right: 0;
        width: 100%;
        max-width: 100%;
    }

    body.en .content-area {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }

    .navbar {
        right: 0;
        left: 0;
    }

    body.en .navbar {
        left: 0;
        right: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* جلوگیری از اسکرول بدنه وقتی سایدبار باز است */
    body.sidebar-open {
        overflow: hidden;
    }
}

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

    .section {
        padding: 60px 20px;
    }

    .contact-section {
        margin: 0 20px 60px;
        padding: 30px;
    }

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

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
        padding: 30px 20px;
    }

    .nav-links {
        display: none;
    }

    .pricing-card.featured {
        transform: scale(1);
    }

    .pricing-card.featured:hover {
        transform: translateY(-10px);
    }
}

.fade-up {
    opacity: 0;
    transform: translateY(40px);
}

.sidebar-toggle-mobile {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--achaemenid-gold), var(--royal-brick));
    border: none;
    color: var(--midnight-code);
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(200, 162, 74, 0.3);
}

body.en .sidebar-toggle-mobile {
    right: auto;
    left: 20px;
}

@media (max-width: 1200px) {
    .sidebar-toggle-mobile {
        display: flex;
    }
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
}

.glow-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--achaemenid-gold);
    top: 10%;
    left: 10%;
}

.glow-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--turquoise-glaze);
    bottom: 20%;
    right: 20%;
}

.glow-orb-3 {
    width: 250px;
    height: 250px;
    background: var(--royal-brick);
    top: 50%;
    left: 50%;
}

.glow-orb {
    max-width: 100vw;
}

.project-3d-card > a {
    width: 100%;
}

.project-3d-card > a img {
    max-height: 100%;
    height: auto;
}

.toast {
    position: fixed;

    top: 25px;
    left: 50%;

    width: min(420px, calc(100% - 30px));

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 14px 18px;

    border-radius: 12px;

    background: #1e1e1e;
    color: #fff;

    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);

    transform: translate(-50%, -30px);

    opacity: 0;
    visibility: hidden;

    transition: opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease;

    z-index: 99999;

    direction: rtl;
}


.toast.show {
    opacity: 1;
    visibility: visible;

    transform: translate(-50%, 0);
}


.toast i {
    flex-shrink: 0;

    font-size: 20px;
}


.toast-message {
    flex: 1;

    line-height: 1.6;

    font-size: 14px;
}


.toast.success {
    border-top: 3px solid #2ecc71;
}


.toast.success i {
    color: #2ecc71;
}


.toast.error {
    border-top: 3px solid #e74c3c;
}


.toast.error i {
    color: #e74c3c;
}


/* Mobile */
@media (max-width: 576px) {

    .toast {
        top: 15px;

        width: calc(100% - 24px);

        padding: 13px 15px;

        border-radius: 10px;
    }

    .toast i {
        font-size: 18px;
    }

    .toast-message {
        font-size: 13px;
    }
}
