/* ============ Dars365 — استایل اصلی ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0b1020;
    --bg-2: #111936;
    --card: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.12);
    --primary: #f5b301;
    --primary-2: #ffd76a;
    --text: #eef1ff;
    --muted: #9aa4c7;
    --radius: 18px;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* پس‌زمینه متحرک */
#glow-canvas, #bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}
.glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .35;
    z-index: -1;
    animation: float 12s ease-in-out infinite;
}
.glow-1 { width: 420px; height: 420px; background: var(--primary); top: -120px; right: -100px; }
.glow-2 { width: 380px; height: 380px; background: var(--primary-2); bottom: -100px; left: -80px; animation-delay: -4s; }
.glow-3 { width: 260px; height: 260px; background: #ff5c8a; top: 45%; left: 55%; opacity: .2; animation-delay: -8s; }

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0) scale(1); }
    50% { transform: translateY(-40px) translateX(30px) scale(1.08); }
}

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

/* ============ هدر ============ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 16, 32, 0.75);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.4rem; font-weight: 800;
    color: var(--text); text-decoration: none;
}
.logo em { font-style: normal; color: var(--primary-2); }
.logo-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; font-size: .85rem; font-weight: 800;
    padding: 6px 10px; border-radius: 12px;
    box-shadow: 0 0 20px rgba(124, 92, 255, .5);
    animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(124,92,255,.4); }
    50% { box-shadow: 0 0 26px rgba(0,224,198,.7); }
}

.main-nav ul { list-style: none; display: flex; gap: 6px; }
.main-nav a {
    position: relative;
    color: var(--muted); text-decoration: none;
    padding: 10px 16px; border-radius: 12px;
    font-weight: 600; transition: color .3s;
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 4px; right: 16px; left: 16px;
    height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    transform: scaleX(0); transform-origin: right;
    transition: transform .35s cubic-bezier(.68,-0.55,.27,1.55);
}
.main-nav a:hover, .main-nav a.active { color: var(--text); }
.main-nav a:hover::after, .main-nav a.active::after { transform: scaleX(1); }

/* کادر ورود / ثبت‌نام */
.auth-box {
    display: flex; align-items: center; gap: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
}
.hello { color: var(--muted); font-size: .9rem; }

/* ============ دکمه‌ها ============ */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 999px;
    font-family: inherit; font-size: .95rem; font-weight: 700;
    text-decoration: none; cursor: pointer;
    border: 1px solid transparent;
    transition: transform .25s, box-shadow .25s, background .25s;
}
.btn:active { transform: scale(.96); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 6px 20px rgba(124, 92, 255, .4);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 224, 198, .45); }
.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--primary-2); color: var(--primary-2); transform: translateY(-3px); }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; text-align: center; }

/* ============ هیرو ============ */
.hero { text-align: center; padding: 90px 0 70px; }
.hero-title {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 900;
    background: linear-gradient(90deg, #fff, var(--primary-2), var(--primary), #fff);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-move 6s linear infinite;
    min-height: 1.4em;
}
@keyframes gradient-move { to { background-position: 300% 0; } }
.cursor { color: var(--primary-2); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { color: var(--muted); margin: 18px auto 30px; font-size: 1.15rem; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ============ بخش مدرس ============ */
.teacher-section { padding: 40px 0 80px; }
.teacher-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
}
.teacher-bio {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    backdrop-filter: blur(8px);
}
.badge {
    display: inline-block;
    background: rgba(0, 224, 198, .12);
    color: var(--primary-2);
    border: 1px solid rgba(0, 224, 198, .35);
    padding: 5px 14px; border-radius: 999px;
    font-size: .8rem; font-weight: 700;
    margin-bottom: 14px;
}
.teacher-bio h2 {
    font-size: 2rem; margin-bottom: 14px;
    background: linear-gradient(90deg, #fff, var(--primary-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.teacher-bio p { color: var(--muted); line-height: 2; margin-bottom: 12px; }
.teacher-bio code {
    background: rgba(255,255,255,.08); padding: 2px 8px;
    border-radius: 6px; font-size: .85em; direction: ltr; display: inline-block;
}
.bio-stats { list-style: none; display: flex; gap: 30px; margin-top: 22px; }
.bio-stats strong {
    display: block; font-size: 1.6rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.bio-stats span { color: var(--muted); font-size: .85rem; }

/* کادر عکس مدرس */
.teacher-photo { display: flex; justify-content: center; }
.photo-frame { position: relative; width: 300px; height: 300px; }
.photo-ring {
    position: absolute; inset: -14px;
    border-radius: 50%;
    border: 2px dashed rgba(124, 92, 255, .6);
    animation: spin 20s linear infinite;
}
.photo-ring.ring-2 {
    inset: -28px;
    border-color: rgba(0, 224, 198, .35);
    animation-duration: 32s;
    animation-direction: reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.photo-placeholder {
    width: 100%; height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(124, 92, 255, .35);
    display: flex; align-items: center; justify-content: center;
    animation: bob 5s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.photo-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.ph-text { flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 20px; }
.ph-text span { font-size: 3rem; }
.ph-text p { color: var(--text); font-weight: 700; }
.ph-text small { color: var(--muted); direction: ltr; }

/* ============ کارت‌های مقاله ============ */
.latest-section, .page-head { padding: 60px 0 30px; }
.section-title, .page-head h1 {
    font-size: 2rem; margin-bottom: 10px; text-align: center;
}
.page-head p { text-align: center; color: var(--muted); }
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
    padding: 30px 0 70px;
}
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    text-decoration: none;
    color: var(--text);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .35s, border-color .35s;
}
.card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(124,92,255,.18), rgba(0,224,198,.12));
    opacity: 0; transition: opacity .35s;
}
.card:hover { transform: translateY(-10px) rotate(-.5deg); border-color: rgba(124,92,255,.6); box-shadow: 0 18px 50px rgba(124, 92, 255, .35); }
.card:hover::before { opacity: 1; }
.card h3 { margin-bottom: 12px; font-size: 1.25rem; position: relative; }
.card p { color: var(--muted); line-height: 1.9; font-size: .95rem; position: relative; }
.card-date { display: block; color: var(--primary-2); font-size: .8rem; margin-top: 16px; position: relative; }
.card-more {
    display: inline-block; margin-top: 8px;
    color: var(--primary-2); font-weight: 700; font-size: .9rem;
    position: relative;
    transition: transform .3s;
}
.card:hover .card-more { transform: translateX(-6px); }
.empty { color: var(--muted); grid-column: 1/-1; text-align: center; padding: 40px 0; }

/* جزئیات مقاله */
.article-detail { padding: 60px 0; }
.article-card h1 { font-size: 2rem; margin-bottom: 10px; }
.article-body { margin: 24px 0; line-height: 2.2; color: #cdd5f0; }

/* ============ فرم‌ها ============ */
.auth-wrap {
    max-width: 480px;
    padding: 40px 20px 80px;
}
.form-card { padding: 34px; }
.form-title { text-align: center; margin-bottom: 24px; font-size: 1.5rem; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 700; font-size: .92rem; }
.form-group input, .form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-family: inherit; font-size: 1rem;
    transition: border-color .3s, box-shadow .3s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-2);
    box-shadow: 0 0 0 4px rgba(0, 224, 198, .12);
}
.form-group .help { display: block; color: var(--muted); font-size: .8rem; margin-top: 6px; }
.form-group .error { display: block; color: #ff7a9c; font-size: .82rem; margin-top: 6px; }
.form-group.has-error input { border-color: #ff5c8a; }
.form-alt { text-align: center; margin-top: 18px; color: var(--muted); font-size: .92rem; }
.form-alt a { color: var(--primary-2); text-decoration: none; font-weight: 700; }

/* ============ پیام‌ها و فوتر ============ */
.messages { margin-top: 20px; }
.alert {
    padding: 14px 18px; border-radius: 12px;
    margin-bottom: 10px; font-weight: 600;
    animation: slide-down .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes slide-down { from { opacity: 0; transform: translateY(-14px); } }
.alert-success { background: rgba(0, 224, 198, .12); border: 1px solid rgba(0, 224, 198, .4); color: var(--primary-2); }
.alert-error { background: rgba(255, 92, 138, .12); border: 1px solid rgba(255, 92, 138, .4); color: #ff9cb4; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding-bottom: 70px; color: var(--muted); }

.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(11, 16, 32, .6);
    padding: 26px 0;
}
.footer-inner {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    color: var(--muted); font-size: .9rem;
}

/* ============ انیمیشن ورود عناصر (reveal) ============ */
.reveal, .reveal-right, .reveal-left {
    opacity: 0;
    transition: opacity .8s ease, transform .8s cubic-bezier(.22,1,.36,1);
}
.reveal { transform: translateY(40px); }
.reveal-right { transform: translateX(60px); }
.reveal-left { transform: translateX(-60px); }
.reveal.visible, .reveal-right.visible, .reveal-left.visible {
    opacity: 1; transform: translate(0, 0);
}

/* ============ ریسپانسیو ============ */
@media (max-width: 820px) {
    .teacher-grid { grid-template-columns: 1fr; }
    .teacher-photo { order: -1; }
    .header-inner { flex-wrap: wrap; justify-content: center; }
    .bio-stats { gap: 20px; flex-wrap: wrap; }
}

/* ============ تم طلایی + بخش‌های جدید ============ */
.glow-3 { background: #ff9d2e; opacity: .18; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(245,179,1,.4); }
    50% { box-shadow: 0 0 26px rgba(255,215,106,.7); }
}
.badge { background: rgba(245,179,1,.12); color: var(--primary-2); border-color: rgba(245,179,1,.35); }
.photo-ring { border-color: rgba(245,179,1,.55); }
.photo-ring.ring-2 { border-color: rgba(255,215,106,.35); }
.photo-placeholder { box-shadow: 0 20px 60px rgba(245,179,1,.3); }
.card:hover { border-color: rgba(245,179,1,.6); box-shadow: 0 18px 50px rgba(245,179,1,.3); }
.card::before { background: linear-gradient(135deg, rgba(245,179,1,.16), rgba(255,215,106,.1)); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(245,179,1,.14);
}
.alert-success { background: rgba(245,179,1,.12); border-color: rgba(245,179,1,.4); color: var(--primary-2); }
.form-group select {
    width: 100%; background: rgba(255,255,255,.05); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 16px; color: var(--text); font-family: inherit; font-size: 1rem;
}
.form-group select option { background: var(--bg-2); }

.logo-img { width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 0 14px rgba(245,179,1,.5); }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.logout-form { display: inline; }
.bell { position: relative; font-size: 1.1rem; text-decoration: none; }
.bell-badge {
    position: absolute; top: -6px; left: -8px; background: #e0245e; color: #fff;
    font-size: .65rem; border-radius: 999px; padding: 1px 5px; font-weight: 800;
}

.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 20px 0; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-card strong { font-size: 1.7rem; color: var(--primary-2); display: block; }
.stat-card span { color: var(--muted); font-size: .88rem; }

.panel-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding-bottom: 70px; align-items: start; }
.panel-side { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; position: sticky; top: 90px; }
.panel-side a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; }
.panel-side a:hover { background: rgba(245,179,1,.12); color: var(--primary-2); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: right; font-size: .9rem; }
.table th { color: var(--muted); }
.table a { color: var(--primary-2); text-decoration: none; }

.badge-status { padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.st-open { background: rgba(245,179,1,.15); color: var(--primary-2); }
.st-progress { background: rgba(56,189,248,.15); color: #7dd3fc; }
.st-answered { background: rgba(52,211,153,.15); color: #6ee7b7; }
.st-closed { background: rgba(148,163,184,.15); color: #cbd5e1; }
.st-high { background: rgba(255,92,92,.18); color: #ff9c9c; }
.st-cat { background: rgba(255,255,255,.07); color: var(--muted); }

.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-head h3 { font-size: 1.1rem; }
.row-line { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.row-line:last-child { border-bottom: none; }
.row-line a { color: var(--text); text-decoration: none; font-weight: 600; }
.row-line a:hover { color: var(--primary-2); }

.notify-item { padding: 12px; border-radius: 12px; margin-bottom: 8px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.notify-item.unread { border-color: rgba(245,179,1,.5); background: rgba(245,179,1,.06); }
.notify-item p { color: var(--muted); font-size: .9rem; margin: 6px 0; }
.notify-item small { color: var(--muted); }

.chat { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.chat-bubble { max-width: 78%; padding: 12px 16px; border-radius: 16px; line-height: 1.9; }
.chat-bubble small { display: block; margin-top: 6px; opacity: .7; font-size: .75rem; }
.chat-me { align-self: flex-start; background: rgba(245,179,1,.14); border: 1px solid rgba(245,179,1,.35); border-bottom-right-radius: 4px; }
.chat-other { align-self: flex-end; background: rgba(255,255,255,.07); border: 1px solid var(--border); border-bottom-left-radius: 4px; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.active-filter { border-color: var(--primary-2) !important; color: var(--primary-2) !important; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }

.footer-links { display: flex; gap: 16px; }
.footer-links a {
    color: var(--text); text-decoration: none; font-weight: 700;
    background: rgba(245,179,1,.12); border: 1px solid rgba(245,179,1,.35);
    padding: 8px 18px; border-radius: 999px; transition: all .3s;
}
.footer-links a:hover { background: rgba(245,179,1,.25); transform: translateY(-3px); }

@media (max-width: 820px) {
    .panel-layout { grid-template-columns: 1fr; }
    .panel-side { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
    .chat-bubble { max-width: 95%; }
}

/* ============ رفع باگ: لایه تزئینی کارت روی فیلدها کلیک می‌گرفت ============ */
.card::before { pointer-events: none; }
.form-card label, .form-card input, .form-card select, .form-card textarea, .form-card button { position: relative; z-index: 1; }
