@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@500;700&display=swap");

/* the style of the page */
:root {
  --main-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --main-color: #3182ce;
  --accent-color: #764ba2;
  --bg-light: #f8fafc;
  --bg-white: #fff;
  --border-radius: 20px;
  --shadow: 0 8px 32px rgba(49, 130, 206, 0.12);
  --input-radius: 12px;
  --input-border: 2px solid #cbd5e0;
}

header {
  width: 100%;
  background: linear-gradient(90deg, var(--main-color) 0%, var(--accent-color) 100%);
  color: #fff;
  text-align: center;
  padding: 36px 20px 24px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(49, 130, 206, 0.08);
}

h1 {
  font-size: 2.3rem;
  font-weight: bold;
  margin-bottom: 12px;
  letter-spacing: 1px;

  display: flex;
  align-items: center;
  gap: 15px;
  justify-content: center;
}

.logo-img {
  height: 44px;
  width: auto;
  vertical-align: middle;
  border-radius: 8px;
  box-shadow: 0 2px 8px #764ba233;
  margin-top: 4px;
}

header p {
  font-size: 1.18rem;
  opacity: 0.95;
}

body {
  font-family: "Cairo", Arial, sans-serif;
  background: var(--main-gradient);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px;
  direction: rtl;
}

.container {
  max-width: 900px;
  width: 92%;
  background: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 36px 0 28px 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.plan-form {
  width: 90%;
  max-width: 550px;
  background: var(--bg-light);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(49, 130, 206, 0.08);
  padding: 32px 24px;
  margin: 32px auto 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0;
  width: 100%;
  /* background-color: red; */
}

.form-group label {
  font-size: 1.13rem;
  color: #2d3748;
  margin-bottom: 15px;
  font-weight: 700;
}

.form-separator {
  border: none;
  border-top: 1.5px solid #d1c4e9;
  width: 60%;
  margin: 15px auto 10px auto;
  opacity: 0.7;
  border-radius: 2px;
}

/* ----------------------------------------------------------------------------------/

/* اختر نوع الجدول */
.styled-select {
  font-family: "Amiri", serif;
  appearance: none;
  background: linear-gradient(90deg, #f8fafc 0%, #e3eeff 100%);
  padding: 6px 12px;
  font-size: 1.2em;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 2px solid #764ba2;
  color: #764ba2;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(118, 75, 162, 0.09);
  outline: none;
  text-align: center;
  width: 70%;
}

/* ----------------------------------------------------------------------------------/

/* choose surahs box */
.dropdown-btn {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 1.1em;
  background: linear-gradient(90deg, #f8fafc 0%, #e3eeff 100%);
  border: 2px solid #764ba2;
  color: #764ba2;
  font-family: "Amiri", serif;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(49, 130, 206, 0.07);
  margin-bottom: 12px;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-align: center;
  width: 65%;
}
.dropdown-btn:focus {
  border-color: #764ba2;
  box-shadow: 0 0 0 2px #e3eeff;
}

/* choose surahs dropdown */
.dropdown-content {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 105%;
  width: 60%;
  background: linear-gradient(180deg, #f8fafc 0%, #e3eeff 100%);
  border: 2px solid var(--accent-color);
  border-radius: var(--input-radius);
  box-shadow: 0 8px 24px rgba(49, 130, 206, 0.12);
  max-height: 225px;
  overflow-y: auto;
  z-index: 9999;
  padding: 10px 15px;
}
.dropdown-content.show {
  display: block;
}
.dropdown-surah {
  position: relative;
  width: 100%;
  margin-bottom: 15px;
}
/* rows in dropdown of surahs */
.surah-checkbox-label {
  font-size: 1.08rem;
  color: #2d3748;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: "Cairo", Arial, sans-serif;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.surah-checkbox {
  margin-left: 8px;
}

/* choose juz container*/
.dropdown-multicheck {
  position: relative;
  width: 100%;
}
/* juz btn */
.juz-dropdown-btn {
  padding: 6px 12px;
  font-size: 1.1em;
  border-radius: 12px;
  background: #f8fafc;
  border: 2px solid #764ba2;
  color: #764ba2;
  font-family: "Amiri", serif;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(118, 75, 162, 0.09);
  outline: none;
  cursor: pointer;
  background: linear-gradient(90deg, #f8fafc 0%, #e3eeff 100%);
  text-align: center;
  width: 65%;
}
/* juz dropdown */
.juz-dropdown-menu {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 65%;
  width: 50%;
  background: linear-gradient(180deg, #f8fafc 0%, #e3eeff 100%);
  border: 2px solid var(--accent-color);
  border-radius: var(--input-radius);
  box-shadow: 0 8px 24px rgba(49, 130, 206, 0.12);
  overflow-y: auto;
  z-index: 9999;
  padding: 10px 15px;
}
/* juz rows */
.dropdown-checkbox-label {
  display: block;
  font-size: 1.08rem;
  color: #2d3748;
  cursor: pointer;
  font-family: "Cairo", Arial, sans-serif;
  font-weight: 500;
  letter-spacing: 0.2px;
  margin-bottom: 5px !important;
}
.note-under-dropdown {
  font-size: 14px;
  color: #764ba2;
  margin-top: 9px;
}
/* ----------------------------------------------------------------------------------/

/* choose n days to finish */
#days-number {
  background: linear-gradient(90deg, #f8fafc 0%, #e3eeff 100%);
  border: 2px solid #764ba2;
  border-radius: 12px;
  font-size: 1.2rem;
  color: #764ba2;
  font-family: "Amiri", serif;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(118, 75, 162, 0.09);
  padding: 5px 12px;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  text-align: center;
}
#days-number:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 2px #e3eeff;
}
input[type="number"] {
  width: 15%;
  font-size: 1.08rem;
  padding: 8px 14px;
  border-radius: var(--input-radius);
  border: var(--input-border);
  background: var(--bg-light);
  color: #2d3748;
  font-weight: 500;
  margin-bottom: 5px;
  transition: border 0.2s;
  height: 20px;
}
input[type="number"]:focus {
  border-color: var(--main-color);
  outline: none;
}

/* choose the holiday */
#holidayDay {
  appearance: none;
  background: linear-gradient(90deg, #f8fafc 0%, #e3eeff 100%);
  border: 2px solid #764ba2;
  border-radius: 12px;
  font-size: 1.2rem;
  color: #764ba2;
  font-family: "Amiri", serif;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(118, 75, 162, 0.09);
  padding: 6px 12px;
  outline: none;
  display: inline-block;
  transition: border 0.2s, box-shadow 0.2s;
  text-align: center;
  width: 45%;
}
#holidayDay:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 2px #e3eeff;
}
/* ----------------------------------------------------------------------------------*/

/* choose the start date  */
.styled-date {
  background: linear-gradient(90deg, #f8fafc 0%, #e3eeff 100%);
  padding: 6px 12px;
  font-size: 1em;
  border-radius: 6px;
  margin-bottom: 10px;
  text-align: center;
  width: 45%;
}

/* ----------------------------------------------------------------------------------*/

/* بوكس اختر تنسيق الجدول */
.table-layout-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
}
/* جملة اختر تنسيق الجدول */
.table-layout-label {
  font-size: 20px;
  font-weight: bold;
  color: #444;
  margin: 0;
}

/* choose virticle or horizontal */
.toggle-radio {
  cursor: pointer;
  margin-top: 18px;
}
.toggle-radio input[type="radio"] {
  display: none;
}
.toggle-radio-btn {
  padding: 0px 12px;
  border-radius: 20px;
  background: #f3f3fa;
  color: #7a4aa9;
  font-weight: 600;
  border: 2px solid #e0e0f0;
  transition: background 0.2s, color 0.2s, border 0.2s;
  font-size: 15px;
  margin: 0;
}
.toggle-radio input[type="radio"]:checked + .toggle-radio-btn {
  background: linear-gradient(90deg, #4a90e2 0%, #7a4aa9 100%);
  color: #fff;
  border: 2px solid #7a4aa9;
}
.toggle-radio-btn:hover {
  border: 2px solid #4a90e2;
}
/* ----------------------------------------------------------------------------------*/

/* get the table button */
.calc-btn {
  width: 100%;
  font-size: 1.8rem;
  padding: 12px 0;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--main-color) 0%, var(--accent-color) 100%);
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(49, 130, 206, 0.13);
  transition: background 0.2s, box-shadow 0.2s;
  font-family: monospace;
}
.calc-btn:hover {
  background: linear-gradient(90deg, var(--accent-color) 0%, var(--main-color) 100%);
  box-shadow: 0 8px 24px rgba(49, 130, 206, 0.18);
}

/* ----------------------------------------------------------------------------------*/

/* result container */
.plan-result {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.plan-result div {
  font-size: 1.15rem;
  margin: 10px 0;
}

/* tables container */
.plan-results {
  margin-top: 32px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* tables container */
.plan-result {
  width: 100%;
  max-width: 100%;
  background: var(--bg-white);
  border-radius: 15px;
  box-shadow: 0 4px 16px rgba(49, 130, 206, 0.1);
  padding: 18px 6px;
  margin: 18px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* horizontal  container*/
.modern-table-container {
  margin-bottom: 24px;
  width: 90%;
  max-width: 700px;
  overflow-x: auto;
  box-sizing: border-box;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
/* horizontal style*/
.modern-plan-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  background: #fff;
  box-shadow: 0 2px 8px #764ba233;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #d1c4e9;
}

/* days in horizontal table (first row) */
.modern-plan-table.horizontal thead th {
  background: #d1c4e9;
  color: #3a1857;
  font-weight: bold;
  font-size: 1.13em;
}
/* rows under days in horizontal (after first row) */
.modern-plan-table.horizontal th,
.modern-plan-table.horizontal td {
  padding: 3px 4px;
  text-align: center;
  font-size: 1.1em;
  border: 1px solid #d1c4e9;
  background: #f3e8ff;
  color: #764ba2;
  font-family: "Cairo", Arial, sans-serif;
}

/* vertical container */
.vertical-table-container {
  width: 100%;
  margin: 0 auto;
  overflow-x: unset;
}
/* virtical style */
.modern-plan-table.vertical {
  width: 100%;
  min-width: unset;
  max-width: 420px;
  margin: 0 auto;
  border-collapse: collapse;
  box-shadow: 0 2px 8px #764ba233;
  border-radius: 20px;
}
/* days in virticle table (first row) */
.modern-plan-table.vertical thead th {
  background: #d1c4e9;
  color: #3a1857;
  font-weight: bold;
  font-size: 1.13em;
  letter-spacing: 0.5px;
}
/*  rows under days in virticle (after first row) */
.modern-plan-table.vertical th,
.modern-plan-table.vertical td {
  padding: 0px 5px;
  font-size: 1.08em;
  border: 1px solid #d1c4e9;
  text-align: center;
  background: #f8f6ff;
  color: #5e35b1;
}
/* ----------------------------------------------------------------------------------*/

footer {
  width: 90%;
  text-align: center;
  padding: 4px 4px;
  background: #2d3748;
  color: #e2e8f0;
  font-size: 0.85rem;
  border-radius: 0 0 16px 16px;
  margin: 0 auto;
}
/* ----------------------------------------------------------------------------------*/

/* info button and popup styles */
.info-btn {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 1001;
  background: #fff;
  color: var(--accent-color);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  box-shadow: 0 2px 8px #764ba233;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: background 0.2s;
}
.info-btn:hover {
  background: #f3e8ff;
}
.info-icon {
  font-weight: bold;
  font-size: 1.3em;
}
.info-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(49, 49, 80, 0.18);
  backdrop-filter: blur(6px);
  z-index: 1002;
  display: none;
  align-items: center;
  justify-content: center;
}
.info-popup.show {
  display: flex;
}
.info-popup-content {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px #764ba244;
  padding: 32px 24px 24px 24px;
  max-width: 750px;
  text-align: right;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.info-popup-content::-webkit-scrollbar {
  width: 6px;
  background: #eee;
}
.info-popup-content::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 8px;
}
.close-info-popup {
  position: absolute;
  top: 12px;
  left: 12px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #764ba2;
  cursor: pointer;
  font-weight: bold;
}
.info-popup-content h2 {
  color: var(--accent-color);
  margin-bottom: 12px;
  font-size: 1.3em;
}
.info-popup-content ul {
  margin: 12px 0 16px 0;
  padding-right: 18px;
}
.info-popup-content li {
  margin-bottom: 8px;
  font-size: 1em;
}

/* ----------------------------------------------------------------------------------*/
/* the mobile view */
@media (max-width: 500px) {
  /* horizontal style*/
  .styled-select {
    width: 85%;
  }
  .modern-plan-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: #fff;
    box-shadow: 0 2px 8px #764ba233;
    border-radius: 50px;
    overflow: hidden;
    border: 1px solid #d1c4e9;
  }
  body {
    padding: 1vw;
  }
  .container {
    padding: 1vw 0 1vw 0;
    border-radius: 25px;
    box-shadow: none;
    max-width: 100vw;
  }
  header {
    padding: 4vw 1vw 3vw 1vw;
    border-radius: 10px;
  }
  header h1 {
    font-size: 1.1rem;
  }
  header p {
    font-size: 0.8rem;
  }
  .plan-form {
    max-width: 100vw;
    padding: 2vw 1vw;
    gap: 8px;
  }
  .form-group {
    width: 100%;
    margin-bottom: 8px;
  }
  .calc-btn {
    font-size: 1.2rem;
    padding: 10px 0;
    margin-top: 6px;
    min-height: 36px;
  }
  .plan-result {
    padding: 4vw 1vw;
  }
  footer {
    font-size: 10px;
  }
  .plan-result {
    padding: 8px 2px;
    margin: 8px auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.08);
    font-size: 0.95em;
    max-width: 100vw;
    overflow-x: auto;
  }
  .modern-plan-table {
    font-size: 0.85em;
    min-width: 480px;
    max-width: 98vw;
    overflow-x: auto;
    border-radius: 8px;
  }
  .modern-plan-table th,
  .modern-plan-table td {
    padding: 0px 0px;
    font-size: 0.95em;
    min-width: 40px;
    word-break: break-word;
  }
  .vertical-table-container {
    width: 90%;
  }
  .modern-plan-table.vertical {
    border-radius: 10px;
  }
  .dropdown-content {
    width: 85%;
  }
  .info-popup-content {
    max-height: 85vh;
    font-size: 1.08em;
    padding-bottom: 24px;
    width: 80%;
  }
  .info-btn {
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
  }
  .info-icon {
    font-size: 1em;
  }
}
