/* 
  تحدي مسلسلات الطيبين - نظام التصميم التراثي والرجعي (Retro Gulf Heritage System)
*/

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Cairo:wght@400;600;700;800;900&family=Tajawal:wght@500;700;900&display=swap');

:root {
  --wood-dark: #1f140e;
  --wood-medium: #3a2217;
  --wood-light: #5a3825;
  --wood-border: #7c4d32;
  --gold-primary: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.4);
  --amber-light: #f59e0b;
  --brass-dark: #8c6d23;
  --brass-light: #e6ca65;
  --parchment-bg: #1c1815;
  --parchment-card: #27211c;
  --parchment-border: #4a3c31;
  --sadu-red: #8b1d1d;
  --sadu-black: #121212;
  --tv-screen-bg: #090b0e;
  --text-gold: #f3e5ab;
  --text-parchment: #e8ded1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  background-color: var(--wood-dark);
  background-image: 
    radial-gradient(circle at 50% 20%, rgba(212, 175, 55, 0.15), transparent 70%),
    radial-gradient(circle at 20% 80%, rgba(139, 29, 29, 0.12), transparent 50%),
    repeating-linear-gradient(45deg, #18100b 0, #18100b 15px, #130c08 15px, #130c08 30px);
  color: var(--text-parchment);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 2rem;
}

/* Sadu Pattern Header Banner Background */
.sadu-border-top {
  width: 100%;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    #8b1d1d 0, #8b1d1d 20px,
    #d4af37 20px, #d4af37 25px,
    #121212 25px, #121212 45px,
    #ffffff 45px, #ffffff 50px,
    #8b1d1d 50px, #8b1d1d 70px
  );
  box-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* Header & Cassette Player Styling */
.heritage-header {
  width: 100%;
  max-width: 1100px;
  background: linear-gradient(180deg, #2c1b12 0%, #1c100a 100%);
  border: 3px solid var(--wood-border);
  border-radius: 1.5rem;
  padding: 1.25rem 1.75rem;
  margin: 1.5rem 1rem 1rem 1rem;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 25px rgba(212, 175, 55, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 30;
}

@media (min-width: 768px) {
  .heritage-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon-box {
  width: 3.25rem;
  height: 3.25rem;
  background: linear-gradient(135deg, var(--gold-primary), #8c6d23);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 1.65rem;
  box-shadow: 0 0 15px var(--gold-glow), inset 0 2px 4px rgba(255,255,255,0.4);
  border: 2px solid var(--brass-light);
}

.brand-title-group h1 {
  font-family: 'Amiri', serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-gold);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  line-height: 1.2;
}

.brand-title-group p {
  font-size: 0.85rem;
  color: #a89883;
}

/* Radio / Cassette Player Controls */
.cassette-player {
  background: #120b07;
  border: 2px solid #3d271a;
  border-radius: 1rem;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.9);
}

.cassette-reels {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.cassette-reel {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px dashed var(--gold-primary);
  background: #25160d;
}

.cassette-reel.spinning {
  animation: spin 3s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.radio-btn {
  background: linear-gradient(180deg, #4a3424 0%, #291a10 100%);
  border: 1.5px solid var(--brass-dark);
  color: var(--text-gold);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.45rem 0.95rem;
  border-radius: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}

.radio-btn:hover {
  background: linear-gradient(180deg, #5c412e 0%, #3a2517 100%);
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

.radio-btn:active {
  transform: translateY(1px);
}

/* TV Frame & Container */
.tv-outer-frame {
  width: 100%;
  max-width: 1100px;
  background: linear-gradient(145deg, #3d2417 0%, #1f120a 50%, #2b190e 100%);
  border: 8px solid #4a2d1d;
  border-radius: 2.25rem;
  padding: 1.5rem;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.9),
    inset 0 0 40px rgba(0, 0, 0, 0.8),
    0 0 0 4px #140b06;
  position: relative;
  margin: 0 1rem;
}

/* Vintage Brass Control Knobs Side Panel */
.tv-control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #180e08;
  border-radius: 1rem;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1.5px solid #362013;
}

.knob-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.rotary-knob {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, #5c4528 0%, #241a0e 80%);
  border: 2px solid var(--brass-light);
  box-shadow: 0 4px 8px rgba(0,0,0,0.6);
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.rotary-knob::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 10px;
  background: var(--gold-primary);
  border-radius: 2px;
}

/* CRT Screen Box */
.crt-screen-box {
  background: var(--tv-screen-bg);
  border-radius: 1.75rem;
  border: 4px solid #110905;
  overflow: hidden;
  position: relative;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.95);
}

/* CRT Scanlines Overlay */
.crt-scanlines {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,0) 50%,
    rgba(0, 0, 0, 0.35) 50%,
    rgba(0, 0, 0, 0.35)
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 15;
  opacity: 0.85;
}

.crt-scanlines.off {
  display: none;
}

/* CRT Curved Glass Flicker & Glow */
.crt-screen-glow {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  box-shadow: inset 0 0 80px rgba(212, 175, 55, 0.08);
  pointer-events: none;
  z-index: 14;
}

/* Heritage Cards & Grids */
.show-card {
  background: linear-gradient(160deg, #2a1f18 0%, #1b130e 100%);
  border: 2px solid var(--parchment-border);
  border-radius: 1.25rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.show-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.show-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--gold-primary);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.8), 0 0 15px var(--gold-glow);
}

.show-card:hover::before {
  opacity: 1;
}

.show-poster-img {
  width: 100px;
  height: 120px;
  object-fit: cover;
  border-radius: 0.85rem;
  border: 2px solid var(--parchment-border);
  margin-bottom: 0.75rem;
  box-shadow: 0 6px 12px rgba(0,0,0,0.6);
  transition: transform 0.3s ease;
}

.show-card:hover .show-poster-img {
  transform: scale(1.05) rotate(-2deg);
  border-color: var(--gold-primary);
}

.show-title {
  font-family: 'Amiri', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-gold);
  margin-bottom: 0.35rem;
}

.show-badge-info {
  font-size: 0.75rem;
  color: #a39281;
  margin-bottom: 0.75rem;
}

.play-badge-btn {
  width: 100%;
  background: linear-gradient(180deg, var(--gold-primary) 0%, #a6841e 100%);
  color: #120b07;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.45rem;
  border-radius: 0.65rem;
  border: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  transition: background 0.2s ease;
}

.play-badge-btn:hover {
  background: linear-gradient(180deg, #ebd16e 0%, var(--gold-primary) 100%);
}

/* Dedicated Show Page Styling */
.show-detail-hero {
  background: linear-gradient(180deg, rgba(37, 24, 17, 0.95) 0%, rgba(18, 11, 7, 0.98) 100%);
  border: 2px solid var(--parchment-border);
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .show-detail-hero {
    flex-direction: row;
    align-items: flex-start;
  }
}

.show-detail-poster {
  width: 180px;
  height: 230px;
  object-fit: cover;
  border-radius: 1.25rem;
  border: 3px solid var(--gold-primary);
  box-shadow: 0 10px 25px rgba(0,0,0,0.9);
  flex-shrink: 0;
  margin: 0 auto;
}

.character-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.character-card {
  background: #1c130d;
  border: 1.5px solid var(--parchment-border);
  border-radius: 1rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s ease;
}

.character-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-primary);
}

.character-avatar-img {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-primary);
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

.episode-btn {
  background: #23160e;
  border: 1.5px solid #452d1d;
  color: var(--text-parchment);
  font-weight: 700;
  padding: 0.6rem 0.2rem;
  border-radius: 0.75rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.episode-btn:hover {
  border-color: var(--gold-primary);
  color: var(--text-gold);
  background: #362215;
}

.episode-btn.completed {
  background: linear-gradient(180deg, #1d4ed8 0%, #1e3a8a 100%);
  border-color: #60a5fa;
  color: #eff6ff;
}

/* Heritage Buttons */
.btn-heritage-gold {
  background: linear-gradient(180deg, var(--gold-primary) 0%, #8c6d23 100%);
  color: #120b0e;
  font-weight: 900;
  font-size: 1.15rem;
  padding: 0.85rem 2rem;
  border-radius: 1rem;
  border: 2px solid var(--brass-light);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3), 0 4px 8px rgba(0,0,0,0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.btn-heritage-gold:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.5);
  background: linear-gradient(180deg, #f5d76e 0%, var(--gold-primary) 100%);
}

.btn-heritage-dark {
  background: linear-gradient(180deg, #3d291e 0%, #20130b 100%);
  color: var(--text-parchment);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  border-radius: 1rem;
  border: 1.5px solid var(--parchment-border);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-heritage-dark:hover {
  border-color: var(--gold-primary);
  color: var(--text-gold);
  transform: translateY(-2px);
}

/* Question Parchment Card */
.question-card {
  background: linear-gradient(165deg, #241b15 0%, #17110c 100%);
  border: 2px solid var(--parchment-border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.7);
}

.option-btn {
  width: 100%;
  text-align: right;
  background: linear-gradient(180deg, #2d221a 0%, #1e1510 100%);
  border: 2px solid #423226;
  color: var(--text-parchment);
  font-family: 'Cairo', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.option-btn:hover {
  border-color: var(--gold-primary);
  background: linear-gradient(180deg, #3a2c22 0%, #271c15 100%);
  color: var(--text-gold);
  transform: translateX(-4px);
}

.option-btn.correct {
  background: linear-gradient(180deg, #1e4620 0%, #0f2b11 100%) !important;
  border-color: #34d399 !important;
  color: #a7f3d0 !important;
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.4);
}

.option-btn.wrong {
  background: linear-gradient(180deg, #591b1b 0%, #360f0f 100%) !important;
  border-color: #f87171 !important;
  color: #fecaca !important;
  box-shadow: 0 0 15px rgba(248, 113, 113, 0.4);
}

.option-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #17100b;
  border: 1.5px solid var(--parchment-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--gold-primary);
  flex-shrink: 0;
}

/* Tabs for Navigation */
.heritage-nav-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.nav-tab {
  background: #1c120c;
  border: 1.5px solid #3d281c;
  color: #a89785;
  font-weight: 700;
  padding: 0.6rem 1.25rem;
  border-radius: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-tab:hover {
  border-color: var(--gold-primary);
  color: var(--text-gold);
}

.nav-tab.active {
  background: linear-gradient(180deg, #422a1c 0%, #281910 100%);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
}

/* Museum Cards */
.museum-card {
  background: linear-gradient(160deg, #241a14 0%, #16100c 100%);
  border: 2px solid var(--parchment-border);
  border-radius: 1.25rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .museum-card {
    flex-direction: row;
  }
}

.museum-img {
  width: 140px;
  height: 170px;
  object-fit: cover;
  border-radius: 1rem;
  border: 2px solid var(--gold-primary);
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(0,0,0,0.8);
}

/* Animations */
.glow-pulse {
  animation: goldPulse 2s infinite alternate;
}

@keyframes goldPulse {
  0% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.2); }
  100% { box-shadow: 0 0 25px rgba(212, 175, 55, 0.6); }
}

/* Responsive Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #140b07;
}
::-webkit-scrollbar-thumb {
  background: var(--brass-dark);
  border-radius: 5px;
  border: 2px solid #140b07;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}
