/* --- تنظیمات کلی و متغیرها --- */
:root {
    --bg-color: #0b1120;
    --primary-color: #0ea5e9;
    --secondary-color: #6366f1;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    
    /* متغیرهای صفحه ویدیو */
    --vp-red: #ff0000;
    
    /* رنگ‌های گیت‌هاب */
    --gh-bg: #0d1117;
    --gh-border: #30363d;
    --gh-text-main: #c9d1d9;
    --gh-text-desc: #8b949e;
    --gh-link: #58a6ff;
    --gh-btn-bg: #238636;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body { overflow-x: hidden; width: 100%; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
}

/* =========================================
   استایل‌های صفحه ویدیو (Video Page)
========================================= */
.video-page-body {
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Outfit', sans-serif;
    background: #000;
}

.vp-background { position: fixed; inset: 0; z-index: -1; background: radial-gradient(circle at center, #1a1a2e 0%, #000 100%); }
.vp-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
}
.vp-blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4; }
.vb-1 { width: 400px; height: 400px; background: #ff0000; top: -100px; left: -100px; animation: floatBlob 10s infinite alternate; }
.vb-2 { width: 300px; height: 300px; background: #6366f1; bottom: -50px; right: -50px; animation: floatBlob 8s infinite alternate-reverse; }

@keyframes floatBlob { from { transform: translate(0,0); } to { transform: translate(50px, 50px); } }

.back-home-btn {
    position: absolute; top: 20px; left: 20px;
    color: rgba(255,255,255,0.6); text-decoration: none;
    font-size: 0.9rem; z-index: 100; transition: 0.3s;
    display: flex; align-items: center; gap: 8px;
}
.back-home-btn:hover { color: #fff; transform: translateX(5px); }

.vp-container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.vp-left-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.vp-header { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; flex-wrap: nowrap; }
.vp-star-icon {
    font-size: 2rem; color: #ffd700;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    animation: spinStar 5s linear infinite;
}
@keyframes spinStar { 100% { transform: rotate(360deg); } }

.vp-title {
    font-size: 1.8rem; /* سایز مناسب برای یک خط */
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(to right, #fff, #ffffaa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin: 0; line-height: 1;
}

.vp-text-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    min-height: 100px;
    margin-bottom: 30px;
    border-radius: 4px;
    color: #ddd;
    font-family: 'Vazirmatn', sans-serif;
    text-align: right;
    direction: rtl;
    font-size: 1.1rem;
    position: relative;
}
.vp-text-box::before {
    content: ''; position: absolute; top: -5px; left: 10px; right: 10px; height: 2px; background: rgba(255,255,255,0.3);
}

.vp-red-btn {
    background: var(--vp-red);
    color: #fff;
    padding: 15px 40px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(255, 0, 0, 0.4);
    transition: all 0.3s ease;
    align-self: flex-start;
}
.vp-red-btn:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 0, 0, 0.6);
    background: #ff3333;
}

.vp-right-video {
    flex: 1.2;
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.trapezoid-frame {
    width: 100%;
    max-width: 550px;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    transform: skewX(-10deg); /* شکل ذوزنقه */
    border: 8px solid #fff;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.trapezoid-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: skewX(10deg) scale(1.2); /* اصلاح کجی ویدیو */
}

@media (max-width: 900px) {
    .vp-container { flex-direction: column-reverse; padding: 20px; margin-top: 60px; height: auto; }
    .video-page-body { overflow-y: auto; height: auto; align-items: flex-start; }
    .vp-left-content { align-items: center; width: 100%; }
    .vp-text-box { text-align: center; }
    .vp-red-btn { align-self: center; }
    .trapezoid-frame { width: 100%; transform: skewX(0); border-width: 4px; border-radius: 15px; }
    .trapezoid-frame video { transform: none; }
    .vp-title { font-size: 1.4rem; }
}

/* =========================================
   استایل‌های صفحه اصلی
========================================= */
.background-wrapper { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; overflow: hidden; }
.shape { position: absolute; opacity: 0.15; filter: blur(5px); animation: floatShape 20s infinite linear; }
.shape-1 { top: 20%; left: 10%; width: 150px; height: 150px; border-radius: 50%; border: 2px solid var(--primary-color); animation-duration: 25s; }
.shape-2 { bottom: 20%; right: 10%; width: 200px; height: 200px; background: var(--secondary-color); clip-path: polygon(50% 0%, 0% 100%, 100% 100%); animation-duration: 30s; animation-direction: reverse; }
.shape-3 { top: 60%; left: 40%; width: 50px; height: 50px; background: var(--primary-color); border-radius: 50%; animation-duration: 15s; }
@keyframes floatShape { 0% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(20px, 40px) rotate(180deg); } 100% { transform: translate(0, 0) rotate(360deg); } }
.blob { position: absolute; filter: blur(90px); opacity: 0.3; border-radius: 50%; z-index: -1; }
.blob-1 { top: -10%; left: -10%; width: 600px; height: 600px; background: var(--primary-color); }
.blob-2 { bottom: -10%; right: -10%; width: 500px; height: 500px; background: var(--secondary-color); }

header {
    position: fixed; top: 0; width: 100%; padding: 15px 25px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1000; backdrop-filter: blur(15px); background: rgba(11, 17, 32, 0.85);
    border-bottom: var(--glass-border);
}
.logo {
    font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 900;
    color: var(--text-color); text-decoration: none; text-transform: uppercase;
    background: linear-gradient(to right, #fff, var(--primary-color));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-menu ul { display: flex; list-style: none; gap: 35px; }
.nav-menu a { color: var(--text-color); text-decoration: none; font-weight: 500; font-size: 1rem; transition: 0.3s; display: flex; align-items: center; gap: 8px; }
.nav-menu a:hover { color: var(--primary-color); }
.hamburger { display: none; cursor: pointer; font-size: 1.5rem; color: var(--text-color); }

.hero {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 120px 20px 50px;
}
.hero-content h1 { font-size: 2.5rem; margin-bottom: 20px; color: var(--text-color); font-weight: 900; line-height: 1.2; min-height: 60px; }
.cursor { color: var(--primary-color); animation: blink 0.7s infinite; font-weight: 100; margin-right: 5px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.highlight-text { color: var(--primary-color); font-weight: 700; }
.hero-desc { max-width: 700px; margin: 0 auto 30px; color: var(--text-muted); font-size: 1rem; }

.hero-socials { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; margin-bottom: 40px; }
.social-mini-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 12px;
    color: #fff; text-decoration: none; font-size: 0.95rem; font-weight: 700;
    transition: 0.3s; border: 1px solid rgba(255,255,255,0.1);
}
.youtube-gradient { background: linear-gradient(45deg, #ff0000, #ff4d4d); box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3); }
.telegram-gradient { background: linear-gradient(45deg, #229ED9, #0088cc); box-shadow: 0 5px 15px rgba(34, 158, 217, 0.3); }
.github-gradient { background: linear-gradient(45deg, #333, #555); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); }
.contact-gradient { background: linear-gradient(45deg, #10b981, #059669); box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3); }

.social-mini-btn:hover {
    transform: translateY(-5px) scale(1.05);
    filter: brightness(1.2);
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewport="0 0 24 24" fill="%23ff0000"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>') 12 12, pointer;
}

.hero-buttons { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; width: 250px; padding: 12px 25px;
    background: rgba(14, 165, 233, 0.1); border: 1px solid var(--primary-color);
    color: var(--primary-color); border-radius: 50px; text-decoration: none;
    font-weight: 700; transition: 0.3s; font-size: 0.95rem;
}
.btn:hover { background: var(--primary-color); color: #fff; transform: translateY(-3px); }
.btn-watch { background: rgba(99, 102, 241, 0.1); border-color: var(--secondary-color); color: var(--secondary-color); }
.btn-watch:hover { background: var(--secondary-color); color: #fff; transform: translateY(-3px); }

section { padding: 60px 20px; }
.section-title { text-align: center; font-size: 2rem; margin-bottom: 50px; position: relative; font-weight: 800; }
.section-title::before { content: ''; position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%); width: 60px; height: 4px; background: linear-gradient(to right, var(--primary-color), var(--secondary-color)); border-radius: 10px; }

.about-modern-container { display: flex; align-items: stretch; justify-content: center; gap: 50px; flex-wrap: wrap; }
.about-visual { flex: 1; display: flex; justify-content: center; align-items: center; min-width: 300px; }
.image-wrapper { position: relative; width: 340px; height: 340px; display: flex; align-items: center; justify-content: center; }
.image-wrapper img { width: 300px; height: 300px; border-radius: 50%; object-fit: cover; z-index: 2; border: 5px solid var(--bg-color); box-shadow: 0 0 30px rgba(14, 165, 233, 0.3); }
.circle-spin { position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--primary-color); border-right-color: var(--secondary-color); animation: spin 10s linear infinite; z-index: 1; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.about-details { flex: 1; min-width: 300px; display: flex; flex-direction: column; justify-content: center; }
.about-card { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); padding: 30px; border-radius: 20px; backdrop-filter: blur(10px); height: 100%; display: flex; flex-direction: column; justify-content: center; }
.about-card h3 { font-size: 1.8rem; margin-bottom: 10px; color: #fff; }
.about-card h4 { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 20px; }
.about-card p { color: #cbd5e1; line-height: 1.8; text-align: justify; margin-bottom: 25px; }

.wave { display: inline-block; animation: wave-animation 2.5s infinite; transform-origin: 70% 70%; }
@keyframes wave-animation {
    0% { transform: rotate(0deg); } 10% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); } 100% { transform: rotate(0deg); }
}

.skills-modern { display: flex; gap: 15px; flex-wrap: wrap; }
.skill-item { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.3); padding: 8px 15px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; border-left: 3px solid var(--color); }
.skill-item i { color: var(--color); }

.projects-grid-wrapper { display: grid; grid-template-columns: 350px 1fr; gap: 25px; max-width: 1150px; margin: 0 auto; padding: 20px 40px; direction: ltr; }
.profile-side, .projects-side { display: flex; flex-direction: column; transform: skewX(-10deg); }
.profile-side { height: 100%; }
.projects-side { justify-content: space-between; gap: 20px; height: 100%; }
.anim-wrapper { width: 100%; display: flex; }
.projects-side .anim-wrapper { flex: 1; }
.profile-side .anim-wrapper { height: 100%; }

.skewed-card { background: var(--gh-bg); border: 1px solid var(--gh-border); border-radius: 15px; padding: 25px; position: relative; overflow: hidden; transition: 0.3s ease; box-shadow: 0 5px 15px rgba(0,0,0,0.2); width: 100%; }
.unskew-content { transform: skewX(10deg); direction: rtl; height: 100%; display: flex; flex-direction: column; }
.full-height { height: 100%; min-height: 400px; background: linear-gradient(160deg, #0d1117, #161b22); display: flex; flex-direction: column; justify-content: center; }
.centered-content { align-items: center; text-align: center; justify-content: center; }
.gh-avatar { width: 120px; height: 120px; border-radius: 50%; border: 4px solid var(--gh-border); margin-bottom: 15px; box-shadow: 0 0 20px rgba(14, 165, 233, 0.3); }
.gh-names h4 { font-size: 1.5rem; color: #fff; margin-bottom: 5px; font-weight: 800; }
.gh-names span { color: var(--gh-text-desc); font-size: 0.9rem; }
.gh-bio { margin: 20px 0; color: var(--gh-text-main); font-size: 0.95rem; }
.github-btn-large { background: var(--gh-btn-bg); color: #fff; padding: 10px 30px; border-radius: 50px; text-decoration: none; font-weight: bold; display: flex; align-items: center; gap: 10px; transition: 0.3s; margin-top: auto; }
.github-btn-large:hover { background: #2ea043; transform: scale(1.05); }
.project-item { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.gh-repo-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gh-repo-header i { color: var(--gh-text-desc); }
.gh-repo-name { color: var(--gh-link); font-weight: bold; font-size: 1.1rem; }
.gh-desc { color: var(--gh-text-desc); font-size: 0.9rem; margin-bottom: 10px; flex-grow: 1; }
.gh-meta { margin-top: auto; display: flex; gap: 15px; font-size: 0.8rem; color: var(--gh-text-desc); }
.gh-meta span { display: flex; align-items: center; gap: 5px; }
.lang-tag { position: relative; padding-left: 15px; }
.lang-tag::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 10px; height: 10px; border-radius: 50%; }
.html-color::before { background: #e34c26; }
.py-color::before { background: #3572A5; }
.skewed-card:hover { border-color: var(--gh-link); transform: translateY(-5px); z-index: 5; box-shadow: 0 10px 25px rgba(0,0,0,0.4); }

@media (max-width: 900px) {
    .projects-grid-wrapper { display: flex; flex-direction: column; direction: rtl; padding: 20px; grid-template-columns: 1fr; }
    .profile-side, .projects-side { transform: none; }
    .skewed-card { margin-bottom: 0; border-radius: 12px; }
    .unskew-content { transform: none; }
    .profile-side { order: 1; margin-bottom: 20px; }
    .projects-side { order: 2; }
    .full-height { height: auto; padding: 30px; }
    .project-item { padding: 25px; }
    .anim-wrapper { display: block; margin-bottom: 15px; }
    .about-modern-container { flex-direction: column; align-items: center; }
    .about-card { height: auto; }
}

/* --- استایل جدید بخش تلگرام --- */
.telegram-cta {
    display: flex; flex-direction: column; align-items: center; gap: 25px; margin-top: 60px;
}
.msg-bot-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 25px 40px; border-radius: 20px;
    text-align: center; max-width: 600px; width: 90%;
    backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative; overflow: hidden;
}
.msg-bot-box::before {
    content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}
.msg-bot-box h3 { font-size: 1.4rem; color: #fff; margin-bottom: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; }
.msg-bot-box p { font-size: 1.1rem; color: var(--text-muted); font-weight: 400; line-height: 1.6; }

.telegram-btn {
    display: inline-flex; align-items: center; gap: 10px;
    background-color: #229ED9; color: #fff;
    padding: 12px 25px; border-radius: 50px;
    font-size: 1rem; font-weight: 700; text-decoration: none;
    box-shadow: 0 10px 20px rgba(34, 158, 217, 0.3); width: 90%; justify-content: center;
}
@media (min-width: 769px) { .telegram-btn { width: auto; padding: 15px 35px; font-size: 1.2rem; } }
.telegram-btn:hover { background-color: #1e8bc0; transform: translateY(-5px); }

footer { background: rgba(13, 17, 23, 0.95); padding: 40px 20px; text-align: center; border-top: 1px solid var(--glass-border); margin-top: 30px; }
.social-links { margin-bottom: 20px; }
.social-links a { display: inline-flex; justify-content: center; align-items: center; width: 45px; height: 45px; background: rgba(255,255,255,0.03); border-radius: 50%; margin: 0 8px; color: var(--text-color); text-decoration: none; font-size: 1.3rem; border: 1px solid var(--glass-border); }
.social-links a:hover { background: var(--primary-color); color: #fff; transform: translateY(-5px); }

@media (max-width: 991px) {
    .hamburger { display: block; }
    .nav-menu { position: absolute; top: 100%; left: 0; width: 100%; background: #0b1120; border-bottom: 1px solid rgba(255,255,255,0.1); padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.4s ease-in-out; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
    .nav-menu.active { max-height: 350px; padding: 20px 0; }
    .nav-menu ul { flex-direction: column; align-items: center; gap: 20px; }
    .hero-content h1 { font-size: 2.2rem; }
    .msg-bot-box { padding: 20px; }
}

#back-to-top { position: fixed; bottom: 25px; right: 25px; width: 50px; height: 50px; background: var(--primary-color); color: #fff; border: none; border-radius: 50%; font-size: 1.2rem; cursor: pointer; box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4); opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.3s ease; z-index: 1000; display: flex; align-items: center; justify-content: center; }
#back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { background: var(--secondary-color); transform: translateY(-5px); }