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

body {
  font-family: "Roboto", sans-serif;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.container {
    position: relative;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 2vw;
    padding: 1.5vh 1.5vw;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    transition: background-image 1s ease-in-out;

}

.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: clamp(1rem, 2vh, 1.5rem);
  text-align: center;
}

/* Timing Table */
.salah-timing {
  display: flex;
  flex-direction: column;
}

.salah-timing h2 {
  color: white;
  text-align: center;
  margin-bottom: 2vh;
  font-size: clamp(1.2rem, 2.5vh, 2rem);
  font-weight: bold;
  letter-spacing: 0.2vw;
}

.timing-table {
  width: 100%;
  border-collapse: collapse;
  border: none;
  font-size: clamp(0.7rem, 1.2vh, 1rem);
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
  height: calc(100vh - 8vh);
}

.timing-table th {
  font-size: clamp(0.6rem, 1vh, 0.9rem);
  color: #fff;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  background-color: #152536;
  padding: 8px;
}

.timing-table td {
  padding: 4px;
  text-align: center;
  color: #152536;
  font-size: clamp(0.6rem, 1vh, 0.85rem);
  font-weight: bold;
  text-transform: capitalize;
}

.timing-table tr {
  background-color: #fff;
}

.timing-table tr.today {
  background-color: #f9e9c7;
}

.timing-table tr.friday {
  background-color: #e9ecef;
}

/* Center Section */
.center-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  color: white;
  height: 100%;
  padding: 2vh 1vw;
}

.mosque-logo {
  margin-bottom: 2vh;
}

.next-salah {
  background: rgba(0, 0, 0, 0.3);
  padding: 4vh 3vw;
  border-radius: 2vh;
  margin: 3vh 0;
  backdrop-filter: blur(10px);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 90%;
  width: 100%;
}

.next-salah h3 {
  font-size: clamp(2.5rem, 2vh, 1.5rem);
  margin-bottom: 1vh;
  letter-spacing: 0.1vw;
  color: #FFF;
  text-align: center;
  font-weight: 400;
}

.time-display {
  font-size: clamp(3rem, 8vh, 5rem);
  font-weight: bold;
  margin: 2vh 0;
  color: #FFF;
  font-weight: 800;
}

.countdown {
  font-size: clamp(2.4rem, 2.2vh, 3rem);
  margin-top: 1vh;
  font-weight: 400;
  color: #FFF;
  text-align: center;
}

.sun-times {
  display: flex;
  justify-content: space-around;
  margin: 2vh 0;
  gap: 2vw;
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  padding: 2vh 1.5vw;
  border-radius: 1.5vh;
  backdrop-filter: blur(5px);
  font-size: clamp(0.8rem, 1.5vh, 1.2rem);
  max-width: 90%;
}

.sun-time {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  width: 100%;
}

.time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  justify-content: space-between;
  color: #FFF;
  font-size: 16px;
  letter-spacing: 0.968px;

}

.time #sunrise-time,
.time #sunset-time {
  color: #FFF;

  text-align: center;
  font-family: Roboto;
  font-size: 32px;
  font-style: normal;
  font-weight: 600;
  line-height: 150%;
  letter-spacing: 0.968px;
}

.seperator {
  height: 100%;
  width: 1px;
  background-color: white;
}

.qr-section {
  text-align: center;
  margin-top: 2vh;
}

.qr-section>div:first-child {
  font-size: clamp(0.8rem, 1.5vh, 1.1rem);
  margin-bottom: 1vh;
}

.qr-code {
  width: clamp(60px, 8vh, 100px);
  height: clamp(60px, 8vh, 100px);
  background: white;
  margin: 1vh auto;
  border-radius: 1vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.6rem, 1vh, 0.8rem);
  color: black;
  font-weight: bold;
}

/* I Q A M A   T A B L E*/
.iqama-table {
  background-color: #fff;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0;
  border-radius: 8px;
  overflow: hidden;
}

.iqama-events-section {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.iqama-timing {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.iqama-timing h2 {
  color: white;
  text-align: center;
  font-size: clamp(1.2rem, 2.5vh, 2rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2vw;
}

.week-headers th {
  padding: 1vh 0.5vw;
  color: #152536;
  text-align: center;
  font-size: clamp(1rem, 1.2vh, 1rem);
  font-weight: 700;
  text-transform: capitalize;
}

.iqama-cell {
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 1vh 0.5vw;
  text-align: center;
  font-size: clamp(1rem, 1.2vh, 1rem);
}

.highlight-week {
  background-color: #16253b !important;
  color: white !important;
  font-weight: bold;
}

.prayer-name {
  color: #fff !important;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  background: #c59c47;
}

.event-container {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 2vh 1.5vw;
  border-radius: 1.5vh;
  margin: 2vh 0;
  font-size: clamp(0.8rem, 1.4vh, 1.1rem);
  line-height: 1.4;
  flex: 1;

}

.event-title {
  font-weight: bold;
  margin-bottom: 1.5vh;
  color: #8b4513;
  font-size: clamp(0.9rem, 1.6vh, 1.2rem);
  text-transform: uppercase;
}

.jumaa-section {
  background: rgba(0, 0, 0, 0.4);
  padding: 2vh 1.5vw;
  border-radius: 1.5vh;
  margin-top: 2vh;
}

.jumaa-title {
  font-size: clamp(2rem, 2vh, 1.6rem);
  font-weight: bold;
  color: white;
  margin-bottom: 1.5vh;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
}

.jumaa-times {
  font-size: clamp(2rem, 1.8vh, 1.4rem);
  text-align: center;
  margin-bottom: 2vh;
  color: #F2C202;
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
}

.events-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  align-self: stretch;
  border-radius: 10px;
  background: #fff;
}

.events-container .heading-slide {
  display: flex;
  padding: 16px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  align-self: stretch;
  border-radius: 10px 10px 0px 0px;
  background-color: #c59c47;
  text-transform: uppercase;
}

.events-container .event {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px;

}

.events-container .event .event-slide {
  list-style: none;
  color: #152536;
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
}

.events-swiper {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.event-slide {
  display: none;

}
.slide-content {
  white-space: normal;       
  overflow: visible;           
  text-overflow: unset;       
  word-break: break-word;     
  display: block;             
  line-height: 1.5;            
}

.event-slide.active {
  flex-direction: column;
  display: flex;
  gap: 10px;
}

/* Large screens (1400px and above) */
@media (min-width: 1400px) {
  .container {
    max-width: none;
    gap: 2.5vw;
    padding: 2vh 2vw;
  }
}

/* Medium screens (768px to 1399px) */
@media (max-width: 1399px) and (min-width: 768px) {
  .container {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2vh;
  }

  .center-section {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .salah-timing {
    grid-row: 2;
  }

  .iqama-timing {
    grid-row: 2;
  }
}

/* Small screens (481px to 767px) */
@media (max-width: 767px) and (min-width: 481px) {
  body {
    overflow-y: auto;
  }

  .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 2vh;
    height: auto;
    min-height: 100vh;
    padding: 2vh 3vw;
  }

  .sun-times {
    flex-direction: column;
    gap: 1.5vh;
  }
}

/* Mobile screens (up to 480px) */
@media (max-width: 480px) {
  body {
    overflow-y: auto;
  }

  .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 2vh;
    height: auto;
    min-height: 100vh;
    padding: 2vh 4vw;
  }

  .salah-timing h2,
  .iqama-timing h2 {
    font-size: 1.3rem;
  }

  .mosque-name {
    font-size: 1.1rem;
  }

  .next-salah {
    padding: 3vh 4vw;
  }

  .time-display {
    font-size: 2.5rem;
  }

  .event-container {
    font-size: 0.85rem;
  }

  .sun-times {
    flex-direction: column;
    gap: 1.5vh;
  }
}

/* Ultra-wide screens */
@media (min-width: 2560px) {
  .container {
    max-width: 2400px;
    margin: 0 auto;
  }
}

/* Portrait orientation adjustments */
@media (orientation: portrait) {
  .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: 100vh;
  }

  body {
    overflow-y: auto;
  }
}
