/* ============================================================
   THEME: Midnight Gold (الذهبى الليلى)
   Dark luxury — glass-morphism, gold gradients, 3D hover effects
   ============================================================ */

/* --- ROOT VARIABLES --- */
.theme-midnight {
  --bg-primary: #0a0a12;
  --bg-secondary: #12121a;
  --bg-card: rgba(18, 18, 26, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-elevated: #1a1a2e;
  --border-subtle: #2a2a35;
  --border-glass: rgba(212, 160, 23, 0.15);
  --text-primary: #e8e8f0;
  --text-secondary: #8888aa;
  --text-muted: #555577;
  --accent-gold: #d4a017;
  --accent-gold-light: #f5c842;
  --accent-gold-dim: rgba(212, 160, 23, 0.12);
  --accent-green: #4ade80;
  --accent-red: #f87171;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.6);
  --gold-gradient: linear-gradient(135deg, #d4a017 0%, #f5c842 50%, #d4a017 100%);
  --gold-gradient-subtle: linear-gradient(135deg, rgba(212, 160, 23, 0.08), rgba(245, 200, 66, 0.03));
  --hero-gradient: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 40%, #0d0d20 100%);
  --glass-border: 1px solid rgba(212, 160, 23, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- BODY --- */
.theme-midnight body,
body.theme-midnight {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background var(--transition-medium), color var(--transition-medium);
}

/* --- NAV --- */
.theme-midnight nav {
  background: rgba(18, 18, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background var(--transition-medium);
}

.theme-midnight nav h1 {
  font-size: 20px;
  font-weight: 700;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-midnight nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 20px;
  font-size: 14px;
  transition: color var(--transition-fast);
  position: relative;
}

.theme-midnight nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold-gradient);
  transition: width var(--transition-medium);
  border-radius: 2px;
}

.theme-midnight nav a:hover {
  color: var(--accent-gold);
}

.theme-midnight nav a:hover::after {
  width: 100%;
}

/* --- THEME SWITCHER --- */
.theme-midnight .theme-switcher {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: 20px;
}

.theme-midnight .theme-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  outline: none;
}

.theme-midnight .theme-btn:hover {
  transform: scale(1.2);
}

.theme-midnight .theme-btn.active {
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(212, 160, 23, 0.4);
}

.theme-midnight .theme-btn-midnight { background: #0a0a12; border-color: #d4a017; }
.theme-midnight .theme-btn-arctic { background: #f8f9fa; border-color: #2563eb; }
.theme-midnight .theme-btn-neon { background: #ff0055; border-color: #00ff88; }

/* --- HERO SECTION --- */
.theme-midnight .hero {
  background: var(--hero-gradient);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  margin-bottom: 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.theme-midnight .hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(212, 160, 23, 0.06), transparent, rgba(212, 160, 23, 0.03), transparent);
  animation: midnight-hero-rotate 12s linear infinite;
  pointer-events: none;
}

@keyframes midnight-hero-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.theme-midnight .hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 50% 0%, rgba(212, 160, 23, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.theme-midnight .hero h2 {
  font-size: 36px;
  color: var(--text-primary);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.theme-midnight .hero p {
  color: var(--text-secondary);
  font-size: 16px;
  position: relative;
  z-index: 1;
}

.theme-midnight .hero .highlight {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- STATS CARDS --- */
.theme-midnight .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.theme-midnight .stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: all var(--transition-medium);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.theme-midnight .stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold-gradient);
  opacity: 0.6;
}

.theme-midnight .stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 160, 23, 0.3);
  box-shadow: var(--shadow-hover);
}

.theme-midnight .stat-card .num {
  font-size: 30px;
  font-weight: 700;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-midnight .stat-card .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- PRODUCT GRID --- */
.theme-midnight .products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* --- PRODUCT CARDS --- */
.theme-midnight .product-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-medium);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  position: relative;
  perspective: 1000px;
}

.theme-midnight .product-card:hover {
  transform: translateY(-8px) rotateX(2deg);
  border-color: rgba(212, 160, 23, 0.35);
  box-shadow: var(--shadow-hover);
}

.theme-midnight .product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-elevated);
  transition: transform var(--transition-slow);
}

.theme-midnight .product-card:hover img {
  transform: scale(1.05);
}

.theme-midnight .product-card .body {
  padding: 16px;
}

.theme-midnight .product-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.theme-midnight .product-card:hover h3 {
  color: var(--accent-gold);
}

.theme-midnight .product-card .price {
  font-size: 22px;
  font-weight: 700;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-midnight .product-card .compare {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 8px;
}

.theme-midnight .product-card .category {
  display: inline-block;
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  margin-top: 8px;
  border: 1px solid rgba(212, 160, 23, 0.15);
}

.theme-midnight .product-card .stock {
  font-size: 12px;
  color: var(--accent-green);
  margin-top: 4px;
}

.theme-midnight .product-card .btn {
  display: block;
  background: var(--gold-gradient);
  color: #0a0a0f;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  margin-top: 12px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.theme-midnight .product-card .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.theme-midnight .product-card .btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(212, 160, 23, 0.4);
}

.theme-midnight .product-card .btn:hover::before {
  left: 100%;
}

/* --- PRODUCT DETAIL PAGE --- */
.theme-midnight .product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.theme-midnight .product-detail img {
  width: 100%;
  border-radius: var(--radius-md);
  border: var(--glass-border);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-medium);
}

.theme-midnight .product-detail img:hover {
  transform: scale(1.02);
}

.theme-midnight .product-detail .product-name {
  font-size: 24px;
  margin: 12px 0 8px;
  color: var(--text-primary);
  font-weight: 700;
}

.theme-midnight .product-detail .product-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.theme-midnight .product-detail .product-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.theme-midnight .product-detail .features-section {
  list-style: none;
  padding: 0;
}

.theme-midnight .product-detail .features-section li {
  padding: 6px 0;
  color: var(--text-primary);
  font-size: 13px;
}

.theme-midnight .product-detail .pipeline-status {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  border: var(--glass-border);
  backdrop-filter: blur(12px);
}

.theme-midnight .product-detail .pipeline-status h3 {
  font-size: 14px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.theme-midnight .product-detail .back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--accent-gold);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--transition-fast);
}

.theme-midnight .product-detail .back-link:hover {
  color: var(--accent-gold-light);
}

/* --- BUTTONS --- */
.theme-midnight .btn-primary {
  display: inline-block;
  background: var(--gold-gradient);
  color: #0a0a0f;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.theme-midnight .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 160, 23, 0.35);
}

.theme-midnight .btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--accent-gold);
  padding: 10px 24px;
  border-radius: 8px;
  border: 1px solid rgba(212, 160, 23, 0.3);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.theme-midnight .btn-secondary:hover {
  border-color: var(--accent-gold);
  background: rgba(212, 160, 23, 0.08);
}

/* --- CATEGORY BADGES --- */
.theme-midnight .category-badge {
  display: inline-block;
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid rgba(212, 160, 23, 0.15);
}

/* --- FOOTER --- */
.theme-midnight .footer {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 48px;
}

/* --- DASHBOARD CARDS --- */
.theme-midnight .dashboard-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-medium);
}

.theme-midnight .dashboard-card:hover {
  border-color: rgba(212, 160, 23, 0.25);
  box-shadow: var(--shadow-hover);
}

.theme-midnight .dashboard-card h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--accent-gold);
}

.theme-midnight .dashboard-card .item-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.theme-midnight .dashboard-card .item-row:last-child {
  border-bottom: none;
}

/* --- API REFERENCE BOX --- */
.theme-midnight .api-ref {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.theme-midnight .api-ref code {
  display: block;
  font-size: 13px;
  color: var(--accent-green);
}

.theme-midnight .api-ref .comment {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 8px;
}

/* --- EMPTY STATE --- */
.theme-midnight .empty-state {
  text-align: center;
  padding: 64px 0;
  color: var(--text-muted);
}

.theme-midnight .empty-state code {
  background: var(--bg-elevated);
  padding: 12px 16px;
  border-radius: 8px;
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  border: 1px solid var(--border-subtle);
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
  .theme-midnight .hero h2 { font-size: 24px; }
  .theme-midnight .products-grid { grid-template-columns: 1fr 1fr; }
  .theme-midnight .product-detail { grid-template-columns: 1fr; }
}
