/**
 * Sky Prayer Timetable - Split Design Styles
 *
 * Modern split-layout design with blue header/footer and white content.
 * Features a 2x3 grid of prayer boxes with full Elementor styling support.
 *
 * @package Sky_Prayer_Timetable
 */

/* Import Share Tech Mono font for numbers */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* ========================================
   CSS Variables for Split Design
   ======================================== */
:root {
    --sky-split-primary-color: #204c93;
    --sky-split-header-bg: #204c93;
    --sky-split-content-bg: #ffffff;
    --sky-split-content-header-bg: #f8f9fa;
    --sky-split-footer-bg: #204c93;
    --sky-split-text-light: #ffffff;
    --sky-split-text-dark: #204c93;
    --sky-split-text-muted: #666666;
    --sky-split-border-color: #e0e0e0;
    --sky-split-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --sky-split-font-family: 'Roboto Condensed', sans-serif;
    --sky-split-active-bg: #204c93;
}

/* ========================================
   Main Widget Container
   ======================================== */
.sky-split-timetable-widget {
    font-family: var(--sky-split-font-family);
    position: relative;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.sky-split-timetable-widget *,
.sky-split-timetable-widget *::before,
.sky-split-timetable-widget *::after {
    box-sizing: border-box;
}

/* ========================================
   Header Section
   ======================================== */
.sky-split-header {
    background-color: #204c93;
    background-image: url('../img/arabesque-bg.svg');
    background-repeat: repeat;
    background-size: auto;
    color: #ffffff;
    padding: 20px 30px 30px;
    text-align: center;
    position: relative;
}

.sky-split-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.sky-split-english-date {
    font-weight: 500;
}

.sky-split-current-time {
    font-size: 18px;
    font-weight: 600;
}

.sky-split-arabic-date {
    direction: rtl;
    font-size: 14px;
}

/* ========================================
   Countdown Section - Labels Under Numbers
   ======================================== */
.sky-split-countdown-section {
    margin-top: 15px;
}

.sky-split-countdown-text {
    font-size: 20px;
    margin-bottom: 15px;
}

.sky-split-next-prayer-name {
    font-weight: 700;
    text-transform: uppercase;
}

.sky-split-countdown-timer {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
}

.sky-split-countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sky-split-countdown-number {
    font-family: "Share Tech Mono", monospace;
    font-size: 72px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
}

.sky-split-countdown-separator {
    font-size: 60px;
    font-weight: 300;
    line-height: 1;
    margin: 0 5px;
    opacity: 0.8;
}

.sky-split-countdown-label {
    display: inline-block;
    background-color: #204c938a;
    color: #fff;
    border-radius: 7px;
    padding: 3px 10px 3px 10px;
    font-size: 13px;
    font-weight: 500;
    text-transform: capitalize;
    margin-top: 10px;
}

/* ========================================
   Content Section
   ======================================== */
.sky-split-content {
    background-color: var(--sky-split-content-bg);
    color: var(--sky-split-text-dark);
    padding: 0px 0px 0px 0px;
}

.sky-split-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    background-color: var(--sky-split-content-header-bg);
    border-bottom: 1px solid var(--sky-split-border-color);
}

.sky-split-content-date {
    flex: 1;
    text-align: center;
}

.sky-split-content-english-date {
    font-size: 18px;
    font-weight: 600;
    color: var(--sky-split-primary-color);
    margin-bottom: 5px;
}

.sky-split-content-hijri-date {
    font-size: 14px;
    color: var(--sky-split-primary-color);
    opacity: 0.8;
}

/* Navigation Buttons */
.sky-split-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(32, 76, 147, 0.1);
    border: 2px solid #204c93;
    color: #204c93;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
}

.sky-split-nav-btn:hover {
    background-color: #204c93;
    color: #ffffff;
}

.sky-split-nav-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(32, 76, 147, 0.3);
}

.sky-split-nav-btn svg {
    width: 28px;
    height: 28px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sky-split-nav-btn svg path {
    fill: none;
    stroke: currentColor;
}

/* ========================================
   Prayer Grid
   ======================================== */
.sky-split-prayer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px 0px 20px 0px;
}

.sky-split-prayer-box {
    background-color: #f8f9fa;
    border: 1px solid var(--sky-split-border-color);
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: var(--sky-split-box-shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
}

.sky-split-prayer-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.sky-split-prayer-box.active {
    background-color: #204c93;
    border-color: #204c93;
}

.sky-split-prayer-box.active .sky-split-prayer-name,
.sky-split-prayer-box.active .sky-split-prayer-time {
    color: #ffffff;
}

/* Iqamah in active state - all text white */
.sky-split-prayer-box.active .sky-split-iqamah,
.sky-split-prayer-box.active .sky-split-iqamah-time {
    color: #ffffff !important;
}

/* Name row - icon beside prayer name */
.sky-split-name-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 6px;
}

/* Icon styles */
.sky-split-prayer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sky-split-prayer-icon img,
.sky-split-prayer-icon svg,
.sky-split-prayer-icon lottie-player {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.sky-split-prayer-name {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
    color: #204c93;
}

.sky-split-prayer-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Icon color in active state - controlled by Elementor settings */
/* Default fallback: invert to white for visibility on blue background */
.sky-split-prayer-box.active .sky-split-prayer-icon img,
.sky-split-prayer-box.active .sky-split-prayer-icon svg {
    filter: brightness(0) invert(1);
}

.sky-split-prayer-time {
    font-family: "Share Tech Mono", monospace;
    font-size: 32px;
    font-weight: 400;
    color: #204c93;
    line-height: 1.2;
    margin-bottom: 8px;
}

.sky-split-iqamah {
    font-size: 11px;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    /* Visibility controlled by PHP inline style or JS */
}

.sky-split-iqamah-time {
    font-family: "Share Tech Mono", monospace;
    font-weight: 500;
    font-size: 13px;
    color: #555555;
    margin-left: 6px;
}

/* ========================================
   Footer Section (Location)
   ======================================== */
.sky-split-footer {
    background-color: #204c93;
    color: #ffffff;
    padding: 12px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sky-split-location-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sky-split-location-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sky-split-location-icon path,
.sky-split-location-icon circle {
    stroke: currentColor;
}

.sky-split-location-name {
    font-size: 14px;
    font-weight: 500;
}

/* ========================================
   Loading Overlay
   ======================================== */
.sky-split-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.sky-split-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(32, 76, 147, 0.2);
    border-top-color: var(--sky-split-primary-color);
    border-radius: 50%;
    animation: sky-split-spin 0.8s linear infinite;
}

@keyframes sky-split-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Responsive Styles
   ======================================== */
@media (max-width: 768px) {
    .sky-split-header {
        padding: 15px 20px 25px;
    }

    .sky-split-header-top {
        flex-direction: column;
        gap: 8px;
    }

    .sky-split-countdown-number {
        font-size: 48px;
    }

    .sky-split-countdown-separator {
        font-size: 40px;
    }

    .sky-split-countdown-label {
        padding: 3px 8px;
        font-size: 11px;
        margin-top: 8px;
    }

    .sky-split-prayer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 20px 15px;
    }

    .sky-split-prayer-box {
        padding: 15px 10px;
    }

    .sky-split-prayer-name {
        font-size: 12px;
        gap: 4px;
    }

    .sky-split-prayer-icon {
        width: 16px;
        height: 16px;
    }

    .sky-split-prayer-time {
        font-size: 24px;
    }

    .sky-split-iqamah {
        font-size: 10px;
    }

    .sky-split-footer {
        padding: 12px 20px;
    }

    .sky-split-jumuah-label {
        font-size: 12px;
    }

    .sky-split-jumuah-time {
        font-size: 18px;
    }

    .sky-split-content-header {
        padding: 15px 10px;
    }

    .sky-split-nav-btn {
        width: 36px;
        height: 36px;
    }

    .sky-split-nav-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .sky-split-countdown-number {
        font-size: 36px;
    }

    .sky-split-countdown-separator {
        font-size: 30px;
    }

    .sky-split-countdown-text {
        font-size: 16px;
    }

    .sky-split-countdown-label {
        padding: 2px 8px;
        font-size: 10px;
    }

    .sky-split-prayer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sky-split-prayer-time {
        font-size: 28px;
    }

    .sky-split-content-english-date {
        font-size: 16px;
    }

    .sky-split-content-hijri-date {
        font-size: 12px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .sky-split-loading-overlay,
    .sky-split-nav-btn {
        display: none !important;
    }

    .sky-split-timetable-widget {
        box-shadow: none;
    }

    .sky-split-prayer-box {
        break-inside: avoid;
    }
}

/* ========================================
   RTL Support
   ======================================== */
[dir="rtl"] .sky-split-header-top {
    flex-direction: row-reverse;
}

[dir="rtl"] .sky-split-content-header {
    flex-direction: row-reverse;
}

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

[dir="rtl"] .sky-split-jumuah-left,
[dir="rtl"] .sky-split-jumuah-right {
    flex-direction: row-reverse;
}

[dir="rtl"] .sky-split-iqamah-time {
    margin-left: 0;
    margin-right: 5px;
}

/* ========================================
   Elementor Editor Styles
   ======================================== */
.elementor-editor-active .sky-split-timetable-widget {
    min-height: 400px;
}

/* Ensure proper styling in Elementor preview */
.elementor-widget-sky-prayer-timetable-split .elementor-widget-container {
    width: 100%;
}
