/* ======== Skip Navigation Link ======== */
.skip-link {
  position: absolute;
  top: -100%;
  right: 0;
  background: var(--gold, #c9a352);
  color: #07101f;
  padding: 10px 20px;
  font-family: 'Heebo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  z-index: 9999;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #07101f;
}

/* ======== Google Fonts ======== */
@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@300;400;700;900&family=Heebo:wght@300;400;500;700&display=swap');

/* ======== CSS Variables ======== */
:root {
  --bg:        #07101f;
  --bg2:       #0d1b30;
  --card-bg:   rgba(13, 27, 48, 0.82);
  --gold:      #c9a352;
  --gold-light:#e8c97a;
  --gold-dark: #8a6f2e;
  --cream:     #f0e8d8;
  --cream-dim: rgba(240, 232, 216, 0.72);
  --border:    rgba(201, 163, 82, 0.18);
  --radius:    16px;
  --nav-h:     68px;
  --shadow:    0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ======== Reset & Base ======== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  background:
    radial-gradient(ellipse at 15% 30%, rgba(120, 90, 168, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 10%, rgba(201, 163, 82, 0.06) 0%, transparent 40%),
    var(--bg);
  color: var(--cream);
  font-family: 'Heebo', sans-serif;
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  width: 90%;
  margin: auto;
  padding-top: calc(var(--nav-h) + 40px);
  padding-bottom: 60px;
}

/* ======== Typography ======== */
h1 {
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 900;
  font-size: 2.4rem;
  text-align: center;
  color: var(--gold-light);
  letter-spacing: 0.01em;
  margin: 28px 0 12px;
  animation: fadeDown 0.7s ease both;
}

h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 14px auto 0;
  border-radius: 2px;
}

h2 {
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 700;
  font-size: 1.8rem;
  text-align: center;
  color: var(--gold-light);
  margin: 24px 0 10px;
  animation: fadeDown 0.8s ease both;
}


h3 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.45rem;
  text-align: center;
  color: var(--gold);
  margin: 16px 0 8px;
}

h4 {
  text-align: right;
  width: 95%;
  margin: auto;
  line-height: 1.8;
  font-family: 'Heebo', sans-serif;
  font-weight: 500;
  color: var(--cream);
}

p {
  text-align: right;
  font-family: 'Heebo', sans-serif;
  font-weight: 300;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--cream-dim);
  text-align: justify;
}

/* ======== Chapter Divider & Accordion ======== */
.chapter-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 22px 0 14px;
  opacity: 0.6;
}

details.chapter {
  border-top: 1px solid rgba(201, 163, 82, 0.25);
  margin: 0;
}

details.chapter > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold);
  user-select: none;
  transition: color 0.2s;
}

details.chapter > summary::-webkit-details-marker { display: none; }
details.chapter > summary::marker { display: none; }

details.chapter > summary::before {
  content: '▶';
  font-size: 0.65rem;
  color: var(--gold-dark);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details.chapter[open] > summary::before {
  transform: rotate(90deg);
}

details.chapter > summary:hover {
  color: var(--gold-light);
}

.chapter-content {
  padding: 2px 8px 14px;
  line-height: 2;
}

/* ======== Main layout ======== */
#main {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

#main div { margin-right: 20px; }

#news div { justify-items: center; }

/* ======== Glass Content Cards ======== */
body > div:not(#window1):not(#window2):not(:empty),
body > form.pagehtml {
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-bottom: 16px;
  animation: fadeUp 0.6s ease both;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* ======== Navigation ======== */
#menu-toggle { display: none; }

#window1, #window2 {
  background: rgba(7, 16, 31, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: fixed;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 90%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  border-radius: 0 0 12px 12px;
  padding: 0 12px;
}

#window1 { top: -100px; transition: top 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
#window2 { top: 0; }

#window2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 163, 82, 0.3), transparent);
}

#window1 a, #window2 a {
  display: block;
  color: rgba(240, 232, 216, 0.75);
  text-align: center;
  padding: 20px 13px;
  font-size: 14px;
  font-family: 'Heebo', sans-serif;
  font-weight: 400;
  text-decoration: none;
  position: relative;
  transition: color 0.25s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

#window1 a::after, #window2 a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 13px;
  right: 13px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: right;
}

#window1 a:hover, #window2 a:hover {
  color: var(--gold-light);
}

#window1 a:hover::after, #window2 a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ======== Forms / Page panels ======== */
.pagehtml {
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px;
  width: 55%;
  margin: 40px auto;
  animation: fadeUp 0.6s ease both;
}

/* ======== Inputs — global text color ======== */
input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]):not([type=range]),
select,
textarea {
  color: var(--cream);
}

/* Override browser autocomplete yellow/white background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--cream) !important;
  -webkit-box-shadow: 0 0 0px 1000px rgba(13, 27, 48, 0.95) inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ======== Inputs ======== */
#llogin input,
#llogin2 input {
  padding: 12px 20px;
  font-size: 1rem;
  font-family: 'Heebo', sans-serif;
  display: block;
  margin: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  color: var(--cream);
}

#llogin input:focus, #llogin2 input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 163, 82, 0.1);
}

#userEmail, #pswd, #pswdC, #telId, #gender {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-sizing: border-box;
  font-size: 1rem;
  font-family: 'Heebo', sans-serif;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  color: var(--cream);
}

#userEmail:focus, #pswd:focus, #pswdC:focus, #telId:focus, #gender:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 163, 82, 0.1);
}

#userEmail::placeholder { text-align: right; color: rgba(240, 232, 216, 0.35); }

#first, #last {
  width: 49.5%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-sizing: border-box;
  font-size: 1rem;
  font-family: 'Heebo', sans-serif;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s;
  outline: none;
  color: var(--cream);
}

#telId,
#mobileNo {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-sizing: border-box;
  font-family: 'Heebo', sans-serif;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

#telId:focus,
#mobileNo:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 163, 82, 0.1);
}

#month {
  width: 40%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-sizing: border-box;
  font-family: 'Heebo', sans-serif;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
}

#day {
  width: 32%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-sizing: border-box;
  font-family: 'Heebo', sans-serif;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
}

#year {
  width: 26.5%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-sizing: border-box;
  font-size: 1rem;
  font-family: 'Heebo', sans-serif;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
}

/* ======== Forgot Password Section ======== */
#forgotSection {
  animation: fadeUp 0.35s ease both;
}

.forgot-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 20px 0;
}

#forgotEmailWrap {
  margin-bottom: 4px;
}

#forgotEmailWrap label {
  display: block;
  margin-bottom: 8px;
  text-align: right;
  color: var(--cream-dim);
}

#forgotEmail {
  width: 100%;
  padding: 12px 20px;
  font-size: 1rem;
  font-family: 'Heebo', sans-serif;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  color: var(--cream);
  box-sizing: border-box;
}

#forgotEmail:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 163, 82, 0.1);
}

#forgotEmail::placeholder {
  color: rgba(240, 232, 216, 0.35);
  text-align: right;
}

#forgotBtn {
  background: linear-gradient(135deg, #b8722a 0%, #c95425 50%, #a0481a 100%);
  color: white;
  display: block;
  width: auto;
  min-width: 160px;
  margin: 16px auto 0;
  font-size: 1rem;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
  padding: 11px 24px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 20px rgba(180, 90, 30, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
}

#forgotBtn:hover {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold-dark) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(201, 163, 82, 0.35);
}

#forgotBtn:active {
  transform: translateY(0) scale(0.98);
}

#forgotBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ======== Buttons ======== */
button,
input[type=submit],
#userSubmit,
#rishom,
#rishomm {
  background: linear-gradient(135deg, #b8722a 0%, #c95425 50%, #a0481a 100%);
  color: white;
  display: block;
  width: auto;
  min-width: 160px;
  margin: 20px auto 0;
  font-size: 1.05rem;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
  padding: 13px 28px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 20px rgba(180, 90, 30, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
  position: relative;
  overflow: hidden;
}

button:hover,
input[type=submit]:hover,
#userSubmit:hover {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold-dark) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(201, 163, 82, 0.35);
}

button:active,
input[type=submit]:active {
  transform: translateY(0) scale(0.98);
}

#userSubmit { width: 35%; font-size: 1.1rem; }

#rishom, #rishomm {
  width: 30%;
  text-align: center;
  text-decoration: none;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ======== Validation ======== */
#pswd:invalid, #pswdC:invalid, #telId:invalid {
  border-color: rgba(220, 80, 80, 0.4);
  background: rgba(220, 80, 80, 0.05);
}

/* ======== Game Board ======== */
#gameBoard {
  display: flex;
  flex-wrap: wrap;
  width: 90%;
  margin: auto;
  gap: 12px;
  justify-content: center;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Heebo', sans-serif;
  color: var(--cream);
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 6px;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card img {
  height: 100px;
  width: 100px;
  border-radius: 8px;
}

.card:hover {
  border-color: var(--gold);
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(201, 163, 82, 0.1);
}

#numberOfcards {
  background: linear-gradient(135deg, #b8722a 0%, #c95425 50%, #a0481a 100%);
  color: white;
  display: block;
  width: auto;
  min-width: 180px;
  margin: 20px auto 0;
  font-size: 1.05rem;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
  padding: 13px 28px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 20px rgba(180, 90, 30, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
  outline: none;
  text-align: center;
  text-align-last: center;
}

#numberOfcards:focus {
  box-shadow: 0 0 0 3px rgba(201, 163, 82, 0.2);
}

#numberOfcards:hover {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold-dark) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(201, 163, 82, 0.35);
}

/* ======== Labels ======== */
label {
  text-align: center;
  font-family: 'Heebo', sans-serif;
  font-size: 1rem;
  color: var(--cream-dim);
}

#hiddenUser label { font-size: 2rem; }

/* ======== User Cards (Gallery) ======== */
#oneUser {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: 12px;
  transition: color 0.2s;
}

#usersDetails {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 80px 10px 10px;
  gap: 12px;
}

#oneUser img {
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  height: 156px;
  width: 226px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#oneUser img:hover {
  border-color: var(--gold);
  transform: scale(1.04);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

#oneUser:hover { color: var(--gold); }

#hiddenUser {
  background: rgba(7, 16, 31, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 40px;
  border: none;
  z-index: 2000;
  padding: 60px 5% 40px;
  overflow-y: auto;
  animation: fadeUp 0.35s ease both;
}

#hiddenUser p {
  flex: 1;
  max-width: 520px;
  font-size: 0.8rem;
  line-height: 1.7;
  text-align: right;
  color: var(--cream);
  direction: rtl;
}

#hiddenUser img {
  border-radius: 12px;
  max-width: 150px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  #hiddenUser {
    flex-direction: column;
    overflow-y: auto;
    justify-content: flex-start;
    padding: 60px 20px 30px;
    gap: 20px;
  }
  #hiddenUser img {
    max-width: 85%;
    max-height: 40vh;
  }
  #hiddenUser p {
    font-size: 0.9rem;
    text-align: center;
  }
}

#hiddenUser span {
  font-size: 2rem;
  position: absolute;
  top: 10px;
  right: 20px;
  cursor: pointer;
  color: var(--gold-dark);
  transition: color 0.2s, transform 0.2s;
  line-height: 1;
}

#hiddenUser span:hover {
  color: #e05555;
  transform: scale(1.2) rotate(90deg);
}

/* ======== Animations ======== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ======== Responsive ======== */
@media (max-width: 768px) {
  body { width: 100%; padding: 10px; padding-top: calc(var(--nav-h) + 20px); }

  #window2, #window1 {
    flex-direction: column;
    width: 100%;
    left: 0;
    transform: none;
    border-radius: 0;
    max-height: var(--nav-h);
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0;
    top: 0 !important;
  }

  #window2.open, #window1.open { max-height: 600px; }

  #menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-light);
    font-family: 'Heebo', sans-serif;
    font-size: 1.1rem;
    padding: 20px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: right;
    justify-content: flex-start;
  }
  #menu-toggle:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
  }

  #window1 a, #window2 a {
    font-size: 13px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(201, 163, 82, 0.08);
  }

  .pagehtml { width: 95%; padding: 20px; }
  #first, #last { width: 100%; }
  #telId { width: 100%; }
  #month, #day, #year { width: 100%; }
  #numberOfcards { width: auto; min-width: 160px; }
  button, input[type=submit] { min-width: 120px; font-size: 1rem; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
}
