@charset "utf-8";

:root{
  --primary:#059669;
  --primary-dark:#047857;
  --bg:#f4f6f8;
  --card:#ffffff;
  --muted:#6b7280;
  --border:#e5e7eb;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--bg);
  color:#111827;
}

/* ===== Header ===== */
.header{
  background:var(--primary);
  color:#fff;
  padding:16px 32px;
  font-weight:700;
  font-size:20px;
}

.header{ background:var(--primary);}
.header-inner{ margin:0 auto; display:flex;align-items:center;justify-content:space-between;}
.logo-link{color:#fff;font-size:20px;font-weight:800; text-decoration:none;}
.nav{ display:flex; align-items:center;gap:22px;}
.nav-link,.lang-switch{color:#ecfdf5;font-size:14px; text-decoration:none;opacity:.9;}
.nav-link:hover,.lang-switch:hover{opacity:1;text-decoration:underline;}
[dir="rtl"] .nav{
  flex-direction:row-reverse;
}
/* ===== Mobile responsive ===== */
@media (max-width:768px){
  .nav{
    gap:14px;
  }
}

/* ===== Container ===== */
.container{
  max-width:900px;
  margin:32px auto 60px;
  padding:0 20px;
}

/* ===== Page title ===== */
.page-title{
/*  text-align:center;*/
  margin-bottom:8px;
}
.page-title h1{
  margin:0;
  font-size:22px;
  font-weight:600;
}
h1 span{display:none;}
.page-title .sub{
  margin-top:6px;
  font-size:14px;
  color:#374151; text-align:right;
}

/* ===== Date + Time Now inline ===== */
.date-line{
  margin-top:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap; /* 移动端自动换行 */
}

.date-text{
  font-size:14px;
  color:#374151;
}

/* Time now 高亮胶囊 */
.time-now{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 12px;
  border-radius:999px;
  background:#ecfdf5;
  border:1px solid #a7f3d0;
}

/* ===== Next Prayer Card ===== */
.next-card{
  margin:32px 0 0 0;
  background:linear-gradient(135deg,var(--primary),var(--primary-dark));
  color:#fff;
  border-radius:20px;
  padding:28px 32px;
  position:relative;
  overflow:hidden;
  box-shadow:0 10px 25px rgba(0,0,0,.08);
}
.next-card::after{
  content:"";
  position:absolute;
  right:-60px;
  top:-40px;
  width:220px;
  height:220px;
  border-radius:50%;
  background:rgba(255,255,255,.12);
}
.next-label{
  font-size:14px;
  opacity:.9;
  letter-spacing:.04em;
}
.next-prayer{
  font-size:34px;
  font-weight:800;
  margin:6px 0 6px;
}
.next-text{
margin-bottom:24px; padding-left:10px;
    font-size: 14px;
    color: #a0a0a0;
}

/* ===== Today list ===== */
.card{
  background:var(--card);
  border-radius:16px;
  box-shadow:0 6px 16px rgba(0,0,0,.06);
  padding:10px;
  margin-bottom:24px;
}
.prayer-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-radius:12px;
  margin:6px 0;
}
.prayer-row .left{
  display:flex;
  align-items:center;
  gap:12px;
}
.dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#d1d5db;
}
.prayer-name{
  font-weight:500;
}
.prayer-time{
  color:#6b7280;
  font-weight:500;
}
.prayer-row.active{
  background:#ecfdf5;
  border:1px solid #a7f3d0;
}
.prayer-row.active .dot{
  background:#34d399;
}
.prayer-row.active .prayer-name,
.prayer-row.active .prayer-time{
  color:#047857;
  font-weight:700;
}

/* ===== Timetable ===== */
/* 默认：PC 不滚动 */
.table-scroll{
  overflow-x:visible;
}

/* 移动端：允许左右滑动 */
@media (max-width: 768px){
  .table-scroll{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  table{
    min-width:720px; /* 保证列不被压扁 */
  }
}



table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}
thead{
  background:#f9fafb;
  color:#6b7280;
}
th,td{
  padding:14px;
  text-align:left;
  border-top:1px solid var(--border);
}

/* ===== FAQ ===== */
.faq{
  background:var(--card);
  border-radius:16px;
  padding:18px 22px;
  box-shadow:0 6px 16px rgba(0,0,0,.06);
  margin-bottom:24px;
}
.faq h3{
  margin:0 0 14px;
}
.faq-item{
  padding:14px 0;
  border-top:1px solid var(--border);
  font-weight:600;
}
.faq-item p{
  margin:8px 0 0;
  color:#374151;
  font-size:14px;
  line-height:1.6;
}


/* ===== Nearby Cities ===== */
.cities{
  background:var(--card);
  border-radius:16px;
  padding:18px 22px;
  box-shadow:0 6px 16px rgba(0,0,0,.06);
}
.city-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:14px;
  margin-top:12px;
}
/* ===== Nearby Cities：移动端一行两列 ===== */
@media (max-width: 768px){
  .city-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}
.city{
  border-radius:12px;
  padding:2px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:#374151;
}

.city{
  text-decoration:none;
  transition:all .15s ease;
}
.city:hover{
  text-decoration:underline;
}

/* ===== Footer ===== */
.footer{
  background:#1f2937;
  color:#9ca3af;
  text-align:center;
  padding:24px;
  font-size:13px;
}
.footer{
  background:#1f2937;
  color:#9ca3af;
  text-align:center;
  padding:20px 16px;
  font-size:13px;
}

.footer-lang{
  margin-bottom:8px;
  font-weight:600;
}

.footer-lang a{
  color:#e5e7eb;
  text-decoration:none;
  padding:0 4px;
}

.footer-lang a:hover{
  text-decoration:underline;
}

.footer-text{
  color:#9ca3af;
  font-size:13px;
}








/* ===== RTL Support ===== */
[dir="rtl"]{
  direction:rtl;
}

[dir="rtl"] .page-title{
  text-align:right;
}

[dir="rtl"] .prayer-row{
  flex-direction:row-reverse;
}

[dir="rtl"] .prayer-row .left{
  flex-direction:row-reverse;
}

[dir="rtl"] table th,
[dir="rtl"] table td{
  text-align:right;
}



[dir="rtl"] .city{
  flex-direction:row-reverse;
}

[dir="rtl"] .time-now{
  direction:ltr; /* 数字仍 LTR，符合阿语习惯 */
}






/* ================================
   FORCE RTL for Today Prayer rows
   ================================ */

/* 1) 只要是阿语页：让 card 内整体按 RTL 习惯排版 */
html[dir="rtl"] .card,
body.lang-ar .card{
  direction: rtl !important;
  text-align: right !important;
}

/* 2) 每一行：让“名称块”在右，“时间”在左 */
html[dir="rtl"] .card .prayer-row,
body.lang-ar .card .prayer-row{
  display: flex !important;
  flex-direction: row !important;          /* 不用 row-reverse，避免某些布局看似没变 */
  align-items: center !important;
  justify-content: flex-start !important;  /* 我们自己控制左右位置 */
}

/* 3) 左侧块（dot + name）放到最右边 */
html[dir="rtl"] .card .prayer-row .left,
body.lang-ar .card .prayer-row .left{
  display: flex !important;
  flex-direction: row-reverse !important;  /* dot 在更右边，符合阿语视觉 */
  align-items: center !important;
  gap: 12px !important;
  margin-left: auto !important;            /* 推到最右侧（关键） */
  text-align: right !important;
}

/* 4) 时间推到最左边 */
html[dir="rtl"] .card .prayer-row .prayer-time,
body.lang-ar .card .prayer-row .prayer-time{
  margin-right: auto !important;           /* 推到最左侧（关键） */
  text-align: left !important;
}

/* 5) 防止被其它地方的 text-align 覆盖 */
html[dir="rtl"] .card .prayer-name,
body.lang-ar .card .prayer-name{
  text-align: right !important;
}

/*2020*******************/

/* ===== Calc options: select layout ===== */
.calc-options{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:16px;
  padding:14px;
}

/* Each field */
.calc-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.calc-field label{
  font-size:13px;
  font-weight:600;
  color:#047857;
}

/* Select style */
.calc-field select{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #a7f3d0;
  background:#ecfdf5;
  font-size:14px;
  color:#065f46;
  cursor:pointer;
}

/* Focus */
.calc-field select:focus{
  outline:none;
  border-color:#059669;
  background:#ffffff;
}

/* ===== Mobile: stack ===== */
@media (max-width: 768px){
  .calc-options{
    grid-template-columns:1fr;
  }
}

/* ===== RTL: Arabic habit only (text still English) ===== */
[dir="rtl"] .calc-options{
  direction:rtl;
}

[dir="rtl"] .calc-field{
  text-align:right;
}

[dir="rtl"] .calc-field select{
  direction:rtl;
}


/**/
/* ===== Text-link style toggle (no button look) ===== */

.calc-settings{
  padding:0 0px 14px 0px;
}

/* summary 看起来像普通文字链接 */
.calc-summary{
  list-style:none;
  cursor:pointer;
  user-select:none;
  color:#059669;           /* 绿色链接 */
  display:inline-flex;
  gap:6px;
  justify-content: flex-end;
  text-align: right;
  width:100%;   /* 关键：必须让它占满一行，才能真正靠右 */
}



/* 去掉浏览器默认三角 */
.calc-summary::-webkit-details-marker{
  display:none;
}

/* hover 更像链接 */
.calc-summary:hover{
  color:#047857;
}

/* 小箭头（可选，不要可以删除这三段） */
.calc-summary::after{
  content:"▾";
  font-size:12px;
  transition:transform .2s ease;
}

details[open] > .calc-summary::after{
  transform:rotate(180deg);
}

/* 内容间距 */
.calc-content{
  margin-top:12px;
}

/* RTL 适配 */
html[dir="rtl"] .calc-summary,
body.lang-ar .calc-summary{
  flex-direction:row-reverse;
  text-align:right;
}
/*2020*/


/*2021**************/

/* ===== Country List ===== */

/* Flag */
.flag{
  width:20px;
  height:14px;
  flex:0 0 auto;
  border-radius:2px;
  overflow:hidden;
  box-shadow:0 0 0 1px rgba(0,0,0,.08);
}

.flag img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
/* ===== Nearby Countries module (same style as Nearby Cities container) ===== */
.nearby-countries{
  margin-top:16px;
  background:var(--card);
  border-radius:16px;
  padding:18px 22px;
  box-shadow:0 6px 16px rgba(0,0,0,.06);
}

.nearby-countries h3{
  margin:0 0 12px;
}

/* Grid: keep same responsive rules as city-grid */
.country-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:14px;
}

/* Mobile: 2 columns (same as your cities requirement) */
@media (max-width: 768px){
  .country-grid{
    grid-template-columns:repeat(2, 1fr);
  }
}

/* Item style: lightweight like your screenshot (no heavy card look) */
.country{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 0;
  text-decoration:none;
  color:#374151;
}

.country:hover{
  text-decoration:underline;
}

/* Make sure name doesn't overflow */
.country-name{
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* ===== FORCE RTL using language class (do not rely on dir attr) ===== */
body.lang-ar{
  direction: rtl;
}

/* Nearby Countries: whole block align right */
body.lang-ar .nearby-countries{
  text-align:right !important;
}
body.lang-ar .nearby-countries h3{
  text-align:right !important;
}

/* Grid: make each cell content stick to the right edge */
body.lang-ar .nearby-countries .country-grid{
  justify-items:end !important;
}

/* Each row: flag on the RIGHT, name on the LEFT (Arabic habit) */
body.lang-ar .nearby-countries .country{
  flex-direction:row-reverse !important;
  justify-content:flex-start !important;
  text-align:right !important;
}

/* Optional: make 2-column fill start from the right side */
body.lang-ar .nearby-countries .country-grid{
  direction: rtl; /* makes the grid columns start from the right */
}
body.lang-ar .nearby-countries .country{
  direction: rtl; /* keep item itself consistent */
}


/**2021****************/
