/* Ensure full-height layout */
html, body {
    height: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Import additional Arabic fonts */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700&family=Amiri:ital,wght@0,400;0,700;1,400&family=Scheherazade+New:wght@400;700&display=swap');

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Tajawal', sans-serif;
    color: #222;
    line-height: 1.5;
}

/* Background image */
body {
  position: relative;
  background: url('img/mosaic-bg.jpg') no-repeat center center fixed;
  background-size: cover;
  color: #222;
}

/* Keep the overlay behind everything */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85); /* white overlay */
  z-index: 1; /* increase slightly */
  pointer-events: none; /* important so overlay doesn't block clicks */
}

#prayerScreen,
.screen {
  position: relative;
  z-index: 2; /* above the overlay */
}

/* Optional: give some padding to avoid touching screen edges */
.screen {
  display: none;
  text-align: center;
  padding: 2rem;
  font-size: 2rem;
}

/* Date row */
.dateRow {
    text-align: center;
    font-size: 3vh;
    color: #333;
}

#lblArabiCDate {
    font-size: 3.5vh;
    font-weight: bold;
    color: #004d40; /* deep green */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

#lblEnglishDate {
    font-size: 2.5vh;
    color: #333;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
}

/* Actual time */
#lblActualTime {
    font-family: 'Orbitron', sans-serif;
    font-size: 8vh;
    font-weight: bold;
    margin-top: 1vh;
    color: #111;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Countdown */
#timerValue {
  display: inline-block;
  font-size: 3rem;
  font-weight: 700;
  color: #d32f2f;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Prayer row */
#SalatScreen {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    margin-top: 4vh;
    gap: 1vw;
}

/* Prayer box */
.prayerBox {
    flex: 1;
    background: rgba(255,255,255,0.95); /* stronger visibility */
    border-radius: 15px;
    padding: 2vh 1vw;
    text-align: center;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.prayerBox:hover {
  transform: scale(1.05);
  background: rgba(255,255,255,1);
}

/* Prayer names */
.prayerBox .prayerName {
    font-size: 3.5vh;
    font-weight: bold;
    margin-bottom: 1vh;
    color: #222;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
}

.prayerName .fr {
    font-size: 1.3rem;
    color: #444;
    font-weight: 400;
}

.iqama-separator {
  border: 0;
  border-top: 1px solid rgba(0,0,0,0.2);
  margin: 0.5vh auto;
  width: 60%;
}

.prayerBox.current .iqama-separator {
  border-top: 1px solid rgba(255,255,255,0.7); /* white separator for highlighted box */
}


/* Adhan */
.prayerBox .prayerTime {
    font-size: 5vh;
    color: #d32f2f;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
}

/* Iqama */
.prayerBox .iqamaTime {
    font-size: 5vh;
    color: #2e7d32;
    font-weight: bold;
    margin-top: 0.5vh;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
}

#adhanCountdown {
  text-align: center;
  margin-top: 2vh;
  margin-bottom: 2vh;
}


.bottomTile {
    flex: 1;
    background: rgba(255,255,255,0.85);
    border-radius: 15px;
    padding: 2vh 1vw;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.bottomTile .tileTitle {
    font-size: 3vh;
    font-weight: bold;
    margin-bottom: 1vh;
    color: #00695c;
}

.bottomTile .tileContent {
    font-size: 2.5vh;
    color: #222;
}

/* Highlight Current Prayer */
.prayerBox.current {
    background: rgba(0, 150, 136, 0.9);
    border: 3px solid #009688;
    box-shadow: 0 0 20px #009688;
    color: #fff;
    transform: scale(1.05);
}

.prayerBox.current .prayerName,
.prayerBox.current .prayerTime,
.prayerBox.current .iqamaTime {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
/* Aya Screen Styling */
#ayaScreen {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 5vh 5vw;
    position: relative;
    font-family: 'Tajawal', serif;
    color: #004d40;
}

#ayaText {
    max-width: 90%;
    padding: 2rem 3rem;
    background: rgba(255, 255, 255, 0.85);
    border: 8px double #004d40; /* Quran-style double border */
    border-radius: 25px;
    box-shadow: 0 0 40px rgba(0,0,0,0.3);
}



/* Optional Quran pattern corners */
#ayaScreen::before,
#ayaScreen::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 100px;
    /* quran-corner.png missing; hide decorative corners by using transparent fallback */
    background: none;
    background-size: 0 0;
    z-index: 1;
}

#ayaScreen::before { top: 0; left: 0; }
#ayaScreen::after { bottom: 0; right: 0; }

/* Hadith Screen Styling (similar to Aya Screen) */
#hadithScreen {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 5vh 5vw;
    position: relative;
    background: url('img/quran-pattern.png') center center no-repeat;
    background-size: contain;
    font-family: 'Tajawal', serif;
    color: #004d40;
}

/* Stack title and content vertically on Aya/Hadith screens */
#ayaScreen,
#hadithScreen {
    flex-direction: column;
}

#hadithText {
    max-width: 90%;
    padding: 2rem 3rem;
    background: rgba(255, 255, 255, 0.85);
    border: 8px double #004d40;
    border-radius: 25px;
    box-shadow: 0 0 40px rgba(0,0,0,0.3);
}



/* Main Arabic text for Aya and Hadith */
#ayaText div:first-child,
.hadithContent div:first-child {
    font-family: 'Scheherazade New', 'Amiri', serif;
    font-size: 6vh; /* default size for readability */
    font-weight: bold;
    line-height: 2; /* more breathing space */
    direction: rtl;
    text-align: center;
    color: #002d1f; /* darker green for better contrast */
    text-shadow: 2px 2px 5px rgba(0,0,0,0.25); /* improves clarity on bright TV screens */
    padding: 1rem;
}

/* Adjust size dynamically if text is long */
#ayaText.longText div:first-child,
.hadithContent.longText div:first-child {
    font-size: 4.5vh; /* shrink if too many characters */
    line-height: 1.8;
}

/* Metadata (surah, book name, number, chapter) */
#ayaText div:last-child,
#hadithText .hadithContent div:last-child {
    font-family: 'Tajawal', sans-serif;
    font-size: 3vh;
    font-weight: 600;
    margin-top: 2vh;
    color: #00695c;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    direction: rtl;
}

#programScreen h2 {
  margin-top: 0.5rem;
  margin-bottom: 2rem; /* increased space below title */
}

.programTable {
    width: 95%;
    margin: 1rem auto;
    border-collapse: collapse;
    font-size: 3.2vh; /* base size; JS may shrink to fit */
    text-align: center;
    direction: rtl;
}
.programTable th {
    background: #2c3e50;
    color: #fff;
    padding: 1rem;
    font-size: 3.8vh; /* will scale down in JS */
    font-weight: bold;
}
.programTable td {
    border: 1px solid #ccc;
    padding: 1rem;
    vertical-align: middle; /* better vertical balance for rowspans */
    line-height: 1.4;
}
#programScreen {
    max-height: 100vh; /* prevent overflow beyond viewport */
    overflow: hidden;  /* hide overflow; JS will shrink table */
    padding: 2vh 2vw;
}
.programTable tr:nth-child(even) {
  background: #f9f9f9;
}
.programTable tr:nth-child(odd) {
  background: #ffffff;
}

/* ================= ALERT SCREEN ================= */
#alertScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: none; /* hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: 'Tajawal', sans-serif;
    text-align: center;
    padding: 2rem;
}

/* Centered alert content */
#alertContent {
    text-align: center;
    color: #fff;
    animation: fadeIn 1s ease;
}

/* Prayer message */
#alertMessage {
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
    animation: blink 1.5s infinite;
}

/* Silent phone icon (for Iqama only) */
#silentIcon {
    display: none;       /* hidden by default */
    font-size: 6rem;     /* make it big */
    margin-top: 20px;    /* space below text */
    text-align: center;
}

#alertMessage .arabic {
    font-size: 4rem;
    font-weight: bold;
    direction: rtl;
    margin-bottom: 1rem;
    animation: blink 1.5s infinite;
}

#alertMessage .french {
    font-size: 2.5rem;
    font-weight: normal;
    color: #ddd;
}



/* Slow fade blink animation */
@keyframes fadeBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.blinkText {
    animation: fadeBlink 3s infinite; /* slower fade cycle */
    text-align: center;
    font-size: 3rem; /* adjust as needed */
    color: #fff;
    font-weight: bold;
}

/* ================= MOBILE RESPONSIVE ================= */
@media (max-width: 768px) {
    body::before {
        background: rgba(255,255,255,0.9); /* slightly more transparent overlay for readability */
    }

    /* Reduce padding and font-size for mobile */
    .screen {
        padding: 1rem;
        font-size: 1.5rem;
    }

    /* Date & clock */
    .dateRow {
        font-size: 4vw;
    }

    #lblArabiCDate {
        font-size: 5vw;
    }

    #lblEnglishDate {
        font-size: 4vw;
    }

    #lblActualTime {
        font-size: 10vw;
    }

    #timerValue {
        font-size: 5vw;
    }

    /* Prayer boxes stacked vertically on small screens */
    #SalatScreen {
        flex-direction: column;
        gap: 2vh;
        margin-top: 2vh;
    }

    .prayerBox {
        padding: 2vh 1.5vw;
        font-size: 4vw;
    }

    .prayerBox .prayerName {
        font-size: 5vw;
    }

    .prayerBox .prayerTime,
    .prayerBox .iqamaTime {
        font-size: 6vw;
    }

    /* Bottom row stacked for mobile */
    #bottomRow {
        flex-direction: column;
        gap: 2vh;
    }

    .bottomTile {
        padding: 2vh 1.5vw;
        font-size: 4vw;
    }

    .bottomTile .tileTitle {
        font-size: 5vw;
    }

    .bottomTile .tileContent {
        font-size: 4vw;
    }

    /* Aya/Hadith screens */
    #ayaText div:first-child,
    .hadithContent div:first-child {
        font-size: 5vw;
        padding: 1rem;
    }

    #ayaText div:last-child,
    #hadithText .hadithContent div:last-child {
        font-size: 3.5vw;
    }

    /* Alert screen */
    #alertMessage {
        font-size: 8vw;
    }
    #silentIcon {
        font-size: 12vw;
    }

    /* Ads screen: grid stacked vertically */
    #adsScreen > div > div {
        grid-template-columns: 1fr !important;
    }

    #adsScreen h2 {
        font-size: 6vw;
    }
    #adsScreen div > div div {
        font-size: 4vw;
    }
}






