/* =========================================================
   آکادمی خورشید — استایل پایه
   بازسازی دقیق از design tokens و کامپوننت‌های پروژه اصلی (Tailwind/shadcn)
   ========================================================= */

:root {
    --color-primary: #ff6b35;
    --color-primary-glow: #f7931e;
    --color-primary-foreground: #fffaf0;
    --color-secondary: #6c5ce7;
    --color-secondary-foreground: #fffaf0;
    --color-accent: #e84393;
    --color-accent-foreground: #fffaf0;
    --color-success: #2f9e5c;
    --color-destructive: #e5484d;

    --color-bg: #fdfbf5;
    --color-card: #ffffff;
    --color-foreground: #2c2540;
    --color-muted: #f4eee0;
    --color-muted-foreground: #6e6580;
    --color-border: #ecdfc9;

    --gradient-sunset: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-glow) 45%, var(--color-accent) 100%);
    --gradient-dusk: linear-gradient(140deg, var(--color-accent) 0%, var(--color-secondary) 100%);
    --gradient-soft: linear-gradient(180deg, rgba(255,107,53,0.08), transparent);

    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-2xl: 2rem;
    --radius-3xl: 2.5rem;
    --radius-4xl: 3.25rem;

    --shadow-soft: 0 2px 8px -2px rgba(44, 37, 64, 0.12);
    --shadow-card: 0 18px 40px -24px rgba(108, 92, 231, 0.4);
    --shadow-glow: 0 20px 45px -20px rgba(255, 107, 53, 0.55);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Vazirmatn", "Tahoma", sans-serif;
    background: var(--color-bg);
    color: var(--color-foreground);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: inherit;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 800px; }
.section { padding: 48px 20px; }
.muted { color: var(--color-muted-foreground); }
.small { font-size: 0.8rem; }
.lead { font-size: 1.05rem; color: var(--color-muted-foreground); margin-top: 12px; }

.text-gradient-sunset {
    background: var(--gradient-sunset);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.logo { font-weight: 800; font-size: 1.2rem; }
.main-nav ul { display: flex; gap: 24px; list-style: none; padding: 0; }
.main-nav a { font-weight: 600; font-size: 0.92rem; color: var(--color-muted-foreground); transition: color 0.2s; }
.main-nav a.active, .main-nav a:hover { color: var(--color-primary); }
.nav-cta { white-space: nowrap; }
@media (max-width: 900px) { .main-nav { display: none; } }

/* ---------- Buttons (pill-shaped, matches button.tsx cva) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn-sm { height: 32px; padding: 0 16px; font-size: 0.75rem; }
.btn-lg { height: 48px; padding: 0 32px; font-size: 1rem; }

.btn-primary { background: var(--color-primary); color: var(--color-primary-foreground); box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-primary) 90%, black); }

.btn-hero { background: var(--gradient-sunset); color: var(--color-primary-foreground); box-shadow: var(--shadow-glow); }
.btn-hero:hover { transform: translateY(-2px); }

.btn-outline { background: var(--color-card); color: var(--color-foreground); border: 2px solid rgba(255,107,53,0.3); }
.btn-outline:hover { border-color: var(--color-primary); background: var(--color-muted); }

.btn-outline-white { background: #fff; color: var(--color-primary); }
.btn-outline-white:hover { background: var(--color-muted); }

/* ---------- Badges (rounded-md, matches badge.tsx cva — NOT pill-shaped) ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-md);
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
}
.badge-featured,
.badge-primary { background: var(--color-primary); color: var(--color-primary-foreground); }
.badge-dusk { background: var(--gradient-dusk); color: var(--color-accent-foreground); }
.badge-secondary { background: var(--color-secondary); color: var(--color-secondary-foreground); }
.badge-card { background: var(--color-card); color: var(--color-foreground); box-shadow: var(--shadow-soft); }
.badge-new { background: var(--gradient-dusk); color: var(--color-accent-foreground); }

/* ---------- Surface card (matches @utility surface-card) ---------- */
.surface-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}
.surface-card:hover { box-shadow: var(--shadow-card); transform: translateY(-3px); }

.card { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); padding: 20px; }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; padding: 56px 20px 40px; }
.hero-copy h1 { font-size: 2.6rem; line-height: 1.3; margin: 16px 0; }
.hero-copy p { color: var(--color-muted-foreground); max-width: 520px; font-size: 1rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 36px; padding: 0; list-style: none; }
.hero-stats .stat { background: var(--color-card); border-radius: var(--radius-lg); padding: 14px; text-align: center; box-shadow: var(--shadow-soft); }
.hero-stats dt { font-weight: 800; color: var(--color-primary); font-size: 1.15rem; margin: 0; }
.hero-stats dd { margin: 4px 0 0; font-size: 0.72rem; color: var(--color-muted-foreground); }
.hero-image img { width: 100%; display: block; border-radius: var(--radius-4xl); border: 1px solid var(--color-border); box-shadow: var(--shadow-card); }
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; } }

/* ---------- Bento grid ---------- */
.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.bento-tile { position: relative; overflow: hidden; border-radius: var(--radius-3xl); border: 1px solid var(--color-border); background: var(--color-card); padding: 1.5rem; box-shadow: var(--shadow-soft); }
.bento-tile p { color: var(--color-muted-foreground); font-size: 0.9rem; margin: 12px 0 0; }
.bento-tile h2 { font-size: 1.4rem; }
.bento-tile h3 { font-size: 1.05rem; }
.bento-lg { grid-column: span 2; }
.bento-md { grid-column: span 2; }
.gradient-sunset { background: var(--gradient-sunset); color: #fff; border: none; }
.gradient-sunset p { color: rgba(255,255,255,0.92); }
.gradient-dusk { background: var(--gradient-dusk); color: #fff; border: none; }
.gradient-dusk p { color: rgba(255,255,255,0.92); }

.grade-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill { background: var(--color-muted); padding: 8px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; transition: background 0.2s, color 0.2s; }
.pill:hover { background: var(--color-primary); color: #fff; }

@media (max-width: 900px) { .bento-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .bento-grid { grid-template-columns: 1fr; } .bento-lg, .bento-md { grid-column: span 1; } }

/* ---------- Section head ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; }
.section-head h2 { font-size: 1.7rem; }

/* ---------- Course card (matches course-card.tsx) ---------- */
.course-card { display: flex; flex-direction: column; height: 100%; }
.course-cover { position: relative; }
.course-cover img { width: 100%; height: 160px; object-fit: cover; display: block; }
.course-cover-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.course-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.course-kicker { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; font-weight: 700; color: var(--color-primary); }
.course-kicker .dot { color: var(--color-muted-foreground); }
.course-body h3 { margin-top: 8px; font-size: 1.1rem; line-height: 1.5; }
.course-subtitle { margin: 8px 0 0; font-size: 0.85rem; color: var(--color-muted-foreground); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.78rem; color: var(--color-muted-foreground); }
.course-meta li { display: flex; align-items: center; gap: 8px; }
.meta-icon { color: var(--color-primary); }
.course-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.price-old { font-size: 0.72rem; color: var(--color-muted-foreground); text-decoration: line-through; }
.price-new { font-size: 1rem; font-weight: 800; color: var(--color-foreground); }

.new-courses-panel { padding: 32px; }
.new-courses-panel h2 { font-size: 1.6rem; }

/* ---------- Teacher card (matches teacher-card.tsx) ---------- */
.teacher-card { padding: 24px; display: flex; flex-direction: column; height: 100%; }
.teacher-head { display: flex; align-items: center; gap: 16px; }
.teacher-avatar-img { width: 64px; height: 64px; border-radius: var(--radius-2xl); object-fit: cover; }
.teacher-avatar-fallback {
    width: 64px; height: 64px; border-radius: var(--radius-2xl);
    background: var(--gradient-sunset); color: var(--color-primary-foreground);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 800; flex-shrink: 0;
}
.teacher-card h3 { font-size: 1.1rem; }
.teacher-title { margin: 4px 0 0; font-size: 0.78rem; color: var(--color-muted-foreground); }
.teacher-bio { margin: 16px 0 0; font-size: 0.85rem; color: var(--color-muted-foreground); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.teacher-subjects { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.teacher-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.social-links { display: flex; align-items: center; gap: 8px; }
.social-icon {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 999px;
    background: var(--color-muted); font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
.social-icon:hover { background: var(--color-primary); color: #fff; }
.teacher-link { display: block; margin-top: 16px; font-size: 0.85rem; font-weight: 700; color: var(--color-primary); }
.teacher-link:hover { text-decoration: underline; }

/* ---------- CTA banner ---------- */
.cta-banner { border-radius: var(--radius-4xl); padding: 56px 40px; text-align: center; box-shadow: var(--shadow-glow); }
.cta-banner h2 { font-size: 1.8rem; }
.cta-banner p { max-width: 560px; margin: 14px auto 0; opacity: 0.95; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--color-border);
    border-radius: var(--radius-md); font-family: inherit; font-size: 0.95rem; background: var(--color-card);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--color-primary);
}
.form-group textarea { resize: vertical; min-height: 100px; }

/* فیلد هانی‌پات ضد اسپم — از کاربر واقعی مخفیه، فقط ربات‌ها پرش می‌کنن */
.honeypot-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.alert { padding: 14px 18px; border-radius: var(--radius-md); margin-bottom: 20px; font-size: 0.9rem; }
.alert-success { background: #e7f7ee; color: var(--color-success); }
.alert-error { background: #fdecec; color: var(--color-destructive); }

/* ---------- Accordion ---------- */
.accordion-item { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 10px; background: var(--color-card); }
.accordion-item summary { font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.accordion-item p { margin: 12px 0 0; font-size: 0.88rem; }

/* ---------- Filters bar (courses.php) ---------- */
.filters-bar { padding: 24px; }
.filters-grid { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 16px; align-items: end; }
.filters-grid .form-group { margin-bottom: 0; }
.filters-actions { display: flex; gap: 12px; margin-top: 16px; }
.results-count { font-size: 0.85rem; }
.empty-state { padding: 40px; text-align: center; }
@media (max-width: 900px) { .filters-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .filters-grid { grid-template-columns: 1fr; } }

/* نوار فیلتر معلمان (teachers.php) فقط دو فیلد داره */
.filters-grid-teachers { grid-template-columns: 2fr 1fr; }
@media (max-width: 700px) { .filters-grid-teachers { grid-template-columns: 1fr; } }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.page-link {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: var(--radius-md);
    background: var(--color-card); border: 1px solid var(--color-border);
    font-size: 0.85rem; font-weight: 700; transition: background 0.2s, color 0.2s;
}
.page-link:hover { background: var(--color-muted); }
.page-link.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--color-muted-foreground); flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--color-primary); }

/* ---------- Course detail page (course.php) ---------- */
.course-detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: start; }
.course-detail-cover { border-radius: var(--radius-3xl); overflow: hidden; position: relative; box-shadow: var(--shadow-card); }
.course-detail-cover img { width: 100%; height: 340px; object-fit: cover; display: block; }
.course-detail-cover .course-cover-badges { position: absolute; top: 16px; left: 16px; }

.syllabus-list { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 10px; }
.syllabus-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.92rem; color: var(--color-foreground); }
.syllabus-check {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 22px; height: 22px; border-radius: 999px; margin-top: 2px;
    background: var(--gradient-sunset); color: #fff; font-size: 0.7rem;
}

.price-box { padding: 24px; position: sticky; top: 20px; }
.price-box-amount { font-size: 1.6rem; font-weight: 800; color: var(--color-primary); margin-top: 4px; }

@media (max-width: 900px) {
    .course-detail-grid { grid-template-columns: 1fr; }
    .price-box { position: static; }
}

/* ---------- Teacher detail page (teacher.php) ---------- */
.teacher-detail-head { display: flex; align-items: flex-start; gap: 24px; }
.teacher-detail-avatar-img { width: 120px; height: 120px; border-radius: var(--radius-3xl); object-fit: cover; flex-shrink: 0; box-shadow: var(--shadow-card); }
.teacher-detail-avatar-fallback {
    width: 120px; height: 120px; border-radius: var(--radius-3xl);
    background: var(--gradient-sunset); color: var(--color-primary-foreground);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; font-weight: 800; flex-shrink: 0; box-shadow: var(--shadow-card);
}
.teacher-detail-meta { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; font-size: 0.85rem; }
@media (max-width: 600px) { .teacher-detail-head { flex-direction: column; align-items: flex-start; } }

/* ---------- Contact page (contact.php) ---------- */
.contact-grid { align-items: start; }
.contact-info-card { padding: 28px; }
.contact-info-list { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 18px; }
.contact-info-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 0.9rem; }
.contact-info-label { font-weight: 700; font-size: 0.78rem; color: var(--color-muted-foreground); margin-bottom: 2px; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-muted); margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding: 48px 20px; }
.footer-links h4, .footer-contact h4 { font-size: 0.95rem; margin-bottom: 12px; }
.footer-links ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; }
.footer-links a:hover { color: var(--color-primary); }
.footer-brand p { color: var(--color-muted-foreground); font-size: 0.85rem; margin-top: 8px; }
.footer-contact p { color: var(--color-muted-foreground); font-size: 0.85rem; }
.footer-bottom { text-align: center; padding: 16px; border-top: 1px solid var(--color-border); color: var(--color-muted-foreground); font-size: 0.8rem; }
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; } }
