/* ==========================================================================
   DualSub (دوآل‌ساب) - Extended Application Styles
   Auth Modals, Cart Drawer, User Dashboard & Admin Management System
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Auth Modal (Login / Register)
   -------------------------------------------------------------------------- */
.auth-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 10, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.auth-modal-backdrop.active {
  display: flex !important;
}

.auth-modal-box {
  width: 100%;
  max-width: 460px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(0, 240, 255, 0.25);
  overflow: hidden;
  position: relative;
  margin: auto;
}

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-darkest);
  border-bottom: 1px solid var(--border-card);
  padding: 0 0.5rem 0 0;
}

.auth-tabs {
  display: flex;
  flex: 1;
  align-self: stretch;
}

.auth-tab-btn {
  flex: 1;
  padding: 1.1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-fa);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-tab-btn.active {
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
  border-bottom: 2px solid var(--neon-cyan);
}

/* --------------------------------------------------------------------------
   Cyberpunk Close Button (.cyber-close-btn)
   Shared between Auth Modal, Cart Drawer, and Admin Modals
   -------------------------------------------------------------------------- */
.cyber-close-btn,
.auth-close-btn,
.cart-close-btn {
  background: rgba(13, 18, 29, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--text-muted, #94a3b8);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  outline: none;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-close-btn {
  margin-left: 0.85rem;
  margin-right: 0.85rem;
  align-self: center;
}

.cyber-close-btn svg,
.auth-close-btn svg,
.cart-close-btn svg {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.2s ease;
  stroke: currentColor;
}

.cyber-close-btn:hover,
.auth-close-btn:hover,
.cart-close-btn:hover {
  background: rgba(244, 63, 94, 0.16);
  border-color: #f43f5e;
  color: #fff;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.5), inset 0 0 8px rgba(244, 63, 94, 0.2);
  transform: scale(1.06);
}

.cyber-close-btn:hover svg,
.auth-close-btn:hover svg,
.cart-close-btn:hover svg {
  transform: rotate(90deg);
  stroke: #ff3366;
}

.cyber-close-btn:active,
.auth-close-btn:active,
.cart-close-btn:active {
  transform: scale(0.95);
}

.auth-modal-body {
  padding: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #cbd5e1;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(7, 9, 14, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-fa);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.auth-alert-msg {
  display: none;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.auth-alert-msg.error {
  display: block;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fca5a5;
}

.auth-alert-msg.success {
  display: block;
  background: rgba(0, 255, 102, 0.15);
  border: 1px solid rgba(0, 255, 102, 0.4);
  color: #86efac;
}

/* --------------------------------------------------------------------------
   2. Slide-over Cart Drawer
   -------------------------------------------------------------------------- */
.cart-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 10, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  justify-content: flex-start;
}

.cart-drawer-backdrop.active {
  display: flex !important;
}

.cart-drawer {
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-cyan);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  animation: slide-in-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-in-left {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-card);
  background: var(--bg-darkest);
}

.cart-body,
.cart-items-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cart-item-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(7, 9, 14, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  position: relative;
  transition: all var(--transition-fast);
}

.cart-item-card:hover {
  border-color: rgba(0, 240, 255, 0.35);
  background: rgba(12, 16, 26, 0.85);
}

.cart-item-img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  flex-shrink: 0;
}

.cart-item-info {
  flex-grow: 1;
  min-width: 0;
}

.cart-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.82rem;
  color: var(--neon-cyan);
  font-weight: 700;
}

.cart-item-remove-btn {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #f43f5e;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.cart-item-remove-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
  color: #fff;
  transform: scale(1.08);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-card);
  background: var(--bg-darkest);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.25rem;
}

#headerCartBtn {
  position: relative !important;
}

.cart-badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #f43f5e;
  color: #fff;
  font-family: var(--font-en);
  font-size: 0.76rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.8);
  pointer-events: none;
  z-index: 5;
  direction: ltr;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   3. Dashboard & Admin Layout Components
   -------------------------------------------------------------------------- */
.dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 3rem 0;
}

.dashboard-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  height: fit-content;
}

.dashboard-user-card {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.user-avatar-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--grad-cyan-btn);
  color: #05070a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  margin: 0 auto 0.75rem auto;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.dashboard-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dashboard-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dashboard-nav-item:hover, .dashboard-nav-item.active {
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
}

.dashboard-nav-item.logout {
  color: #f43f5e;
  margin-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

.dashboard-panel {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
}

.dashboard-panel.active {
  display: block;
}

/* Metric / Stat Cards */
.stats-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: rgba(7, 9, 14, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--neon-cyan-dim);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Data Tables */
.data-table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--bg-darkest);
  padding: 0.9rem 1rem;
  color: #94a3b8;
  border-bottom: 1px solid var(--border-card);
  font-weight: 700;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: #cbd5e1;
}

.license-key-tag {
  direction: ltr;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   5. Game Rating & Comments System (بخش اختصاصی امتیاز خریداران و نظرات)
   -------------------------------------------------------------------------- */
.game-rating-section {
  position: relative;
}

.game-rating-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(7, 9, 14, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.rating-score-badge {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #f59e0b;
  font-weight: 900;
  font-size: 1.25rem;
  font-family: var(--font-en);
}

.game-rating-card-body {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

/* Rating Locked Box */
.rating-locked-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  width: 100%;
  max-width: 540px;
}

.rating-locked-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Rating Buyer Active Box */
.rating-buyer-active-box {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.4rem;
  width: 100%;
}

.interactive-star-group {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.35rem;
}

.buyer-star-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  color: #334155;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.buyer-star-btn svg {
  fill: currentColor;
  transition: transform 0.2s, filter 0.2s;
}

.buyer-star-btn:hover,
.buyer-star-btn.hovered,
.buyer-star-btn.active {
  color: #f59e0b;
}

.buyer-star-btn:hover svg,
.buyer-star-btn.hovered svg {
  transform: scale(1.22);
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.7));
}

/* Comments Section */
.comments-section-wrapper {
  margin: 2.5rem 0 3.5rem 0;
}

/* Locked Comment Card */
.comment-locked-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

/* Comment Input Panel (When Logged In) */
.comment-input-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
}

.comment-input-panel::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-cyan), transparent);
}

/* Comments Feed & Cards */
.comments-feed {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.comment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  transition: all 0.25s ease;
}

.comment-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.comment-card.is-buyer-card {
  border-color: rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.02) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.comment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.comment-author-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  color: #020617;
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.2);
  flex-shrink: 0;
}

.comment-author-name {
  font-weight: 800;
  color: #fff;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-verified-buyer {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #10b981;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.comment-date {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.comment-body-text {
  color: #cbd5e1;
  line-height: 1.85;
  font-size: 0.92rem;
  word-break: break-word;
}

/* Admin Reply Box */
.admin-reply-box {
  margin-top: 1rem;
  padding: 0.9rem 1.15rem;
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.04) 0%, rgba(15, 23, 42, 0.7) 100%);
  border: 1px solid rgba(217, 70, 239, 0.25);
  border-right: 3px solid var(--neon-magenta);
  border-radius: var(--radius-sm);
}

.admin-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-reply-content {
  color: #e2e8f0;
  font-size: 0.88rem;
  line-height: 1.75;
}

.btn-reply-toggle {
  background: rgba(217, 70, 239, 0.08);
  border: 1px solid rgba(217, 70, 239, 0.3);
  color: #f472b6;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}

.btn-reply-toggle:hover {
  background: rgba(217, 70, 239, 0.2);
  border-color: var(--neon-magenta);
  color: #fff;
}

/* Empty comments state */
.empty-comments-box {
  text-align: center;
  padding: 3rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
  .game-rating-card {
    flex-direction: column;
    align-items: stretch;
  }
  .game-rating-card-body {
    justify-content: stretch;
  }
  .rating-locked-box {
    max-width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }
  .comment-locked-card {
    flex-direction: column;
    align-items: flex-start;
  }
}


