/* ============================================
   myjs.ir – Main Stylesheet
   JavaScript theme: dark + golden yellow
   ============================================ */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-card: #2d2d30;
    --text-primary: #d4d4d4;
    --text-secondary: #9d9d9d;
    --accent: #F0DB4F;
    --accent-hover: #e6c200;
    --accent-glow: rgba(240,219,79,0.25);
    --border: #3e3e42;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow: 0 8px 24px rgba(0,0,0,0.6);
    --transition: 0.25s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: 'Vazir', Tahoma, Geneva, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    direction: rtl;
}
img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; }

/* --- Typography --- */
.text-gradient {
    background: linear-gradient(135deg, var(--accent), #ffd700);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.65rem 1.6rem; border-radius: var(--radius-md); font-weight: 700;
    font-size: 0.95rem; cursor: pointer; transition: all var(--transition);
    border: 2px solid transparent; white-space: nowrap;
}
.btn--primary {
    background: var(--accent); color: #1e1e1e;
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn--primary:hover {
    background: var(--accent-hover); transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(240,219,79,0.6);
}
.btn--outline {
    border-color: var(--accent); color: var(--accent); background: transparent;
}
.btn--outline:hover {
    background: var(--accent); color: #1e1e1e;
}
.btn--lg { padding: 0.8rem 2rem; font-size: 1.05rem; border-radius: var(--radius-lg); }

/* --- Header --- */
.header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(30,30,30,0.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header__inner {
    display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0;
}
.logo {
    display: flex; align-items: center; gap: 0.5rem; font-weight: 700;
    font-size: 1.5rem; color: var(--accent);
}
.logo__dot { color: white; }
.logo__icon svg { width: 38px; height: 38px; }

.hamburger {
    display: none; flex-direction: column; gap: 5px; background: none;
    border: none; cursor: pointer; padding: 8px;
}
.hamburger span {
    width: 24px; height: 2.5px; background: var(--accent); border-radius: 3px;
    transition: var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav__list { display: flex; gap: 1.8rem; }
.nav__link {
    color: var(--text-secondary); font-weight: 600; font-size: 0.95rem;
    transition: color var(--transition); position: relative;
}
.nav__link::after {
    content: ''; position: absolute; bottom: -4px; right: 0; width: 0; height: 2px;
    background: var(--accent); transition: width var(--transition); border-radius: 2px;
}
.nav__link:hover, .nav__link.active { color: var(--accent); }
.nav__link:hover::after, .nav__link.active::after { width: 100%; }

@media (max-width: 991px) {
    .hamburger { display: flex; }
    .nav {
        position: fixed; top: 0; right: 0; width: 280px; height: 100vh;
        background: var(--bg-secondary); flex-direction: column; align-items: flex-start;
        padding: 6rem 2rem 2rem; gap: 1.5rem; transform: translateX(100%);
        transition: transform var(--transition); box-shadow: var(--shadow); z-index: 999;
    }
    .nav.active { transform: translateX(0); }
    .nav__list { flex-direction: column; width: 100%; gap: 1rem; }
}

/* --- Hero (Home) --- */
.hero--home {
    padding: 4rem 0; background: radial-gradient(circle at 20% 50%, #2d2d1a, var(--bg-primary));
    position: relative; overflow: hidden;
}
.hero__grid {
    display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center;
    position: relative; z-index: 1;
}
@media (min-width: 992px) { .hero__grid { grid-template-columns: 1fr 1fr; } }
.hero__console {
    background: #111; border-radius: var(--radius-md); overflow: hidden;
    border: 1px solid var(--border); box-shadow: 0 0 30px rgba(240,219,79,0.15);
    max-width: 500px; margin: 0 auto;
}
.console-header {
    background: #2d2d2d; padding: 0.6rem 1rem; display: flex; align-items: center; gap: 8px;
}
.console-dot { width: 12px; height: 12px; border-radius: 50%; }
.console-dot.red { background: #ff5f56; }
.console-dot.yellow { background: #ffbd2e; }
.console-dot.green { background: #27c93f; }
.console-body {
    padding: 1rem; font-family: 'Courier New', monospace; font-size: 0.9rem;
    line-height: 1.6; color: #d4d4d4;
}
.console-body pre { direction: ltr; text-align: left; }
.code-keyword { color: #569cd6; }
.code-string { color: #ce9178; }
.code-comment { color: #6a9955; }
.code-func { color: #dcdcaa; }
.code-number { color: #b5cea8; }
.cursor { animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero__badge {
    display: inline-block; background: rgba(240,219,79,0.15); color: var(--accent);
    padding: 0.3rem 1rem; border-radius: 50px; font-weight: 600; font-size: 0.85rem;
    margin-bottom: 1rem;
}
.hero__title { font-size: 2.4rem; font-weight: 900; color: white; line-height: 1.3; }
.hero__desc { font-size: 1.05rem; color: var(--text-secondary); margin: 1rem 0 1.5rem; max-width: 500px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* --- Features Section --- */
.features { padding: 4rem 0; background: var(--bg-secondary); }
.section__header { text-align: center; margin-bottom: 2rem; }
.section__tag {
    display: inline-block; background: rgba(240,219,79,0.15); color: var(--accent);
    padding: 0.25rem 1rem; border-radius: 50px; font-size: 0.8rem; margin-bottom: 0.5rem;
}
.section__title { font-size: 2rem; font-weight: 900; color: white; }
.features-grid {
    display: grid; grid-template-columns: 1fr; gap: 1.5rem;
}
@media (min-width: 600px) { .features-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 992px) { .features-grid { grid-template-columns: repeat(4,1fr); } }
.feature-card {
    background: var(--bg-card); padding: 1.8rem; border-radius: var(--radius-md);
    border: 1px solid var(--border); transition: all var(--transition); text-align: center;
    backdrop-filter: blur(5px);
}
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 0 20px var(--accent-glow); }
.feature-icon { font-size: 2.5rem; margin-bottom: 0.8rem; display: block; }
.feature-card h3 { color: var(--accent); margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; }

/* --- Lessons Grid (Home & Lessons Page) --- */
.latest-lessons { padding: 4rem 0; }
.lessons-grid {
    display: grid; grid-template-columns: 1fr; gap: 1.5rem;
}
@media (min-width: 600px) { .lessons-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 992px) { .lessons-grid { grid-template-columns: repeat(3,1fr); } }
.lesson-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 1.5rem; display: flex; align-items: center; gap: 1rem;
    transition: all var(--transition); color: white; position: relative; overflow: hidden;
}
.lesson-card:hover { transform: translateY(-3px); box-shadow: 0 0 25px var(--accent-glow); }
.lesson-card__icon { font-size: 2rem; }
.lesson-card__content h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.lesson-card__content p { font-size: 0.85rem; color: var(--text-secondary); }
.lesson-card__arrow { margin-right: auto; color: var(--accent); font-size: 1.2rem; }

.section__footer-link { text-align: center; margin-top: 2rem; }

/* --- CTA --- */
.cta-section { padding: 3rem 0; }
.cta-box {
    background: linear-gradient(135deg, #2d2d1a, #1e1e1e);
    border: 1px solid var(--accent); border-radius: var(--radius-xl);
    padding: 3rem 2rem; text-align: center; box-shadow: 0 0 30px var(--accent-glow);
}
.cta-box__title { font-size: 1.8rem; color: white; margin-bottom: 0.5rem; }
.cta-box__desc { color: var(--text-secondary); margin-bottom: 1.5rem; }

/* --- Page Hero (inner pages) --- */
.page-hero {
    background: radial-gradient(circle at top left, #2d2d1a, var(--bg-primary));
    padding: 2.5rem 0; text-align: center;
}
.page-hero__title { font-size: 2rem; font-weight: 900; color: white; }
.page-hero__subtitle { color: var(--text-secondary); margin-top: 0.5rem; }

/* --- Content Sections --- */
.content-section { padding: 3rem 0; }
.content-text { max-width: 900px; margin: 0 auto; }
.content-text h2 { color: var(--accent); margin: 2rem 0 0.8rem; font-size: 1.5rem; }
.content-text p { margin-bottom: 1rem; color: #c9d1d9; }
.content-text ul { list-style-type: square; margin-right: 1.5rem; color: #c9d1d9; margin-bottom: 1rem; }
.content-text li { margin-bottom: 0.5rem; }

/* --- Contact Grid --- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-info-card {
    background: var(--bg-card); padding: 1.8rem; border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.contact-info-card h3 { color: var(--accent); margin-bottom: 0.8rem; }
.contact-info-list li { margin-bottom: 0.8rem; color: var(--text-secondary); }

/* --- Footer (creative) --- */
.footer {
    background: var(--bg-primary);
    position: relative;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    padding-top: 3rem;
    overflow: hidden;
}
.footer::before {
    content: "console.log('Hello JS')";
    position: absolute;
    top: 10px;
    left: 20px;
    font-family: 'Courier New', monospace;
    color: rgba(240,219,79,0.08);
    font-size: 4rem;
    font-weight: bold;
    z-index: 0;
    transform: rotate(-5deg);
}
.footer__inner {
    display: grid; grid-template-columns: 1fr; gap: 2rem; padding-bottom: 2rem;
    position: relative; z-index: 1;
}
@media (min-width: 600px) { .footer__inner { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 992px) { .footer__inner { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer__col--brand .logo__text { font-size: 1.4rem; }
.footer__desc { font-size: 0.9rem; color: var(--text-secondary); margin-top: 0.5rem; line-height: 1.8; }
.footer__title { color: var(--accent); font-weight: 700; margin-bottom: 0.8rem; }
.footer__links li { margin-bottom: 0.3rem; }
.footer__links a { color: var(--text-secondary); font-size: 0.9rem; transition: color var(--transition); }
.footer__links a:hover { color: var(--accent); }
.footer__contact li { margin-bottom: 0.5rem; color: var(--text-secondary); }
.footer__bottom {
    border-top: 1px solid var(--border); padding: 1rem 0; text-align: center;
    font-size: 0.85rem; color: var(--text-secondary); position: relative; z-index: 1;
}
.footer__js-symbol {
    position: absolute;
    bottom: 60px;
    right: 20px;
    width: 80px;
    height: 80px;
    opacity: 0.15;
}
.footer__js-symbol svg { width: 100%; height: 100%; }

/* --- Article / Lesson Page (for future lessons) --- */
.article-page {
    max-width: 800px; margin: 2rem auto; background: var(--bg-secondary);
    padding: 2.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.article-header .article-tag {
    background: rgba(240,219,79,0.15); color: var(--accent); padding: 0.2rem 0.8rem;
    border-radius: 50px; font-size: 0.8rem; margin-bottom: 0.5rem; display: inline-block;
}
.article-header h1 { font-size: 2rem; margin: 0.5rem 0; }
.article-meta { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }
.article-content p { margin-bottom: 1.2rem; color: #c9d1d9; line-height: 2; }
.article-content h2 { color: var(--accent); margin: 2rem 0 0.5rem; font-size: 1.4rem; }
.article-content ul { list-style-type: square; margin-right: 1.5rem; color: #c9d1d9; margin-bottom: 1rem; }
.article-content li { margin-bottom: 0.5rem; }
pre, code {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed;
    font-family: 'Courier New', monospace;
}
pre {
    background: #1a1a1a;
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    color: var(--accent);
    margin: 1.5rem 0;
}
code {
    background: rgba(240,219,79,0.1);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: var(--accent);
}
pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.lesson-nav { display: flex; justify-content: space-between; margin-top: 2rem; }

/* Scroll Top */
.scroll-top {
    position: fixed; bottom: 25px; left: 25px; width: 44px; height: 44px;
    border-radius: 50%; background: var(--accent); color: #1e1e1e; border: none;
    font-size: 1.2rem; cursor: pointer; opacity: 0; visibility: hidden;
    transform: translateY(15px); transition: all var(--transition); z-index: 999;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 15px var(--accent-glow);
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }