/*
Theme Name: Roman Luxury Theme
Theme URI: https://k38.ir
Author: Web Novel Studio
Description: پوسته فوق مدرن، سبک و اختصاصی دانلود و خرید اشتراکی رمان
Version: 1.2.0
Text Domain: roman-luxury
*/

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* ===================================================
   ۱. متغیرها و تنظیمات پایه
   =================================================== */
:root {
  --bg-main: #0c0f17;
  --bg-card: #151a26;
  --bg-glass: rgba(21, 26, 38, 0.92);
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --secondary: #6366f1;
  --accent: #10b981;
  --danger: #ef4444;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --font: 'Vazirmatn', system-ui, -apple-system, Tahoma, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font);
  direction: rtl;
  line-height: 1.8;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

a { 
  color: inherit; 
  text-decoration: none; 
  transition: 0.25s ease; 
}

img { 
  max-width: 100%; 
  height: auto; 
  display: block; 
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ===================================================
   ۲. هدر سایت
   =================================================== */
.site-header {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  width: 100%;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-menu {
  display: flex;
  gap: 20px;
  list-style: none;
  align-items: center;
}

.nav-menu a {
  color: #e5e7eb;
  font-size: 14px;
}

.nav-menu a:hover {
  color: var(--primary);
}

.user-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ===================================================
   ۳. دکمه‌ها و المان‌های عمومی
   =================================================== */
.btn {
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  font-family: var(--font);
}

.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { opacity: 0.9; transform: translateY(-2px); }
.btn-outline {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.08); }

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 30px 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  border-right: 4px solid var(--primary);
  padding-right: 12px;
}

/* ===================================================
   ۴. اسلایدر و کارت‌های رمان در صفحه اصلی
   =================================================== */
.hero-slider {
  margin: 25px 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1a2233 0%, #121722 100%);
  border: 1px solid var(--border);
  padding: 25px;
}

.slider-card {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 25px;
  align-items: center;
}

.slider-info h2 { font-size: 22px; margin-bottom: 12px; color: #fff; }
.slider-info p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; line-height: 1.8; }
.slider-cover img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.grid-novels,
.novels-grid,
.latest-novels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}

.novel-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.novel-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: var(--shadow);
}

.novel-thumb {
  position: relative;
  width: 100%;
  height: 250px;
  background: #1f2937;
}

.novel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.novel-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  z-index: 2;
}

.badge-free { background: var(--accent); color: #fff; }
.badge-vip { background: var(--primary); color: #000; }

.novel-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.novel-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.novel-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===================================================
   ۵. پنل کاربری (Dashboard) در دسکتاپ
   =================================================== */
.dashboard-container,
.dashboard-wrapper,
.roman-dashboard-container {
  display: flex;
  gap: 25px;
  margin: 30px auto;
  width: 100%;
  max-width: 1200px;
}

.dashboard-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.dashboard-menu,
.dashboard-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-menu a,
.dashboard-nav a,
.dashboard-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
  background: transparent;
  border: none;
  width: 100%;
  text-align: right;
  cursor: pointer;
}

.dashboard-menu a:hover,
.dashboard-menu a.active,
.dashboard-nav a.active {
  background: rgba(245, 158, 11, 0.1);
  color: var(--primary);
  font-weight: 700;
}

.dashboard-content {
  flex-grow: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 25px;
  min-width: 0;
}

.dashboard-stats,
.dash-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

/* جدول‌های پنل */
.dashboard-table-wrapper,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 15px;
}

table.dash-table,
.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

table.dash-table th,
.dashboard-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

table.dash-table td,
.dashboard-table td {
  padding: 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

/* پلن‌های VIP */
.vip-plans-grid,
.vip-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.vip-plan-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

/* فرم‌ها */
.dash-form input,
.dash-form select,
.dash-form textarea,
.ticket-form input,
.ticket-form textarea,
.ticket-form select {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  margin-bottom: 15px;
  outline: none;
}

.dash-form input:focus,
.ticket-form input:focus,
.ticket-form textarea:focus {
  border-color: var(--primary);
}

/* ===================================================
   ۶. پاورقی
   =================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 25px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: #090c13;
}

/* ===================================================
   ۷. استایل حالت روشن (Light Mode)
   =================================================== */
body.light-mode {
  --bg-main: #f3f4f6 !important;
  --bg-card: #ffffff !important;
  --bg-glass: rgba(255, 255, 255, 0.9) !important;
  --text-main: #1f2937 !important;
  --text-muted: #4b5563 !important;
  --border: rgba(0, 0, 0, 0.08) !important;
}

body.light-mode .site-header {
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

body.light-mode .nav-menu a {
  color: #374151;
}

body.light-mode .section-title,
body.light-mode .novel-title {
  color: #111827;
}

/* ===================================================
   ۸. ریسپانسیو و بهینه‌سازی موبایل (Mobile Responsive)
   =================================================== */
@media (max-width: 860px) {
  .slider-card { grid-template-columns: 1fr; }
  .slider-cover { order: -1; height: 220px; }
  .nav-menu { display: none; }
}

@media (max-width: 768px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* گرید ۲ ستونه رمان‌ها در موبایل */
  .grid-novels,
  .novels-grid,
  .latest-novels-grid,
  .purchased-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .novel-card .novel-thumb {
    height: 180px !important;
  }

  .novel-card .novel-title {
    font-size: 13px !important;
    white-space: normal !important;
  }

  /* پنل کاربری تک‌ستونه عمودی */
  .dashboard-container,
  .dashboard-wrapper,
  .roman-dashboard-container {
    flex-direction: column !important;
    gap: 15px !important;
    padding: 0 4px !important;
    margin: 15px auto !important;
  }

  .dashboard-sidebar {
    width: 100% !important;
    padding: 12px !important;
  }

  /* دکمه‌های منوی پنل در موبایل */
  .dashboard-menu,
  .dashboard-nav {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .dashboard-menu a,
  .dashboard-nav a,
  .dashboard-nav button {
    font-size: 12px !important;
    padding: 10px 6px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .dashboard-content {
    width: 100% !important;
    padding: 15px 12px !important;
  }

  .dashboard-stats,
  .dash-cards-grid,
  .vip-plans-grid,
  .vip-pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* اسکرول مستقل برای جداول */
  table.dash-table,
  .dashboard-table {
    min-width: 460px !important;
  }
}

@media (max-width: 420px) {
  .grid-novels,
  .novels-grid {
    grid-template-columns: 1fr !important;
  }

  .dashboard-menu,
  .dashboard-nav {
    grid-template-columns: 1fr !important;
  }
}
/* حل قطعی مشکل بیرون‌زدگی پنل در موبایل */
@media (max-width: 991px) {
  /* ۱. مجبور کردن کانتینر اصلی به چیدمان عمودی */
  .dashboard-container,
  .dashboard-wrapper,
  .roman-dashboard-container,
  .panel-container,
  div[class*="dashboard"] {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 10px auto !important;
    padding: 0 10px !important;
    gap: 20px !important;
  }

  /* ۲. تمام‌عرض شدن سایدبار (بخش پروفایل و دکمه‌ها) */
  .dashboard-sidebar,
  .panel-sidebar,
  div[class*="sidebar"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* ۳. تمام‌عرض شدن باکس محتوا و آمارها و قرارگیری زیر منو */
  .dashboard-content,
  .panel-content,
  .dashboard-main,
  div[class*="content"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* ۴. جلوگیری از اسکرول افقی کل صفحه */
  body, html {
    overflow-x: hidden !important;
  }
}
/* جلوگیری از بیرون‌زدگی کل بدنه صفحه در موبایل */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

@media (max-width: 768px) {
    /* ۱. ریسپانسیو کردن بدنه اصلی پنل */
    .dashboard-container,
    .dashboard-wrap,
    .user-panel-wrapper,
    .roman-dashboard,
    .main-panel,
    main.site-main > div {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 10px !important;
        margin: 0 auto !important;
        gap: 15px !important;
    }

    /* ۲. تمام‌عرض کردن بخش منوی راست (عکس و دکمه‌ها) */
    .dashboard-sidebar,
    .panel-sidebar,
    .user-sidebar,
    aside.dashboard-sidebar,
    .dashboard-menu {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        flex: 1 1 100% !important;
        box-sizing: border-box !important;
        float: none !important;
    }

    /* ۳. تمام‌عرض کردن باکس چپ (اطلاعات و کیف پول) و آمدن به زیر منو */
    .dashboard-content,
    .panel-content,
    .user-content,
    .dashboard-main,
    section.dashboard-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 100% !important;
        box-sizing: border-box !important;
        float: none !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    /* ۴. تک‌ستونه شدن کارت‌های آمار داخل پنل */
    .dash-stats,
    .dashboard-cards,
    .stats-grid {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
}
.btn-bookmark {
    border: 1px solid #f39c12; /* رنگ زرد/نارنجی ملایم */
    color: #f39c12;
    background: transparent;
    transition: all 0.3s ease;
}
.btn-bookmark:hover {
    background: rgba(243, 156, 18, 0.1);
}
.btn-bookmark.bookmarked {
    background: #f39c12;
    color: #111; /* رنگ تیره برای متن روی پس‌زمینه زرد */
}
