:root {
    --primary-color: #1e5631;
    --secondary-color: #4c9564;
    --accent-color: #d4af37;
    --light-color: #f5f5dc;
    --text-dark: #333;
    --text-light: #fff;
    --highlight: #e74c3c;
    --prayer-time-bg: rgba(255, 255, 255, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    width: 100vw;
}

.container {
    display: grid;
    grid-template-areas:
        "left right"
        "full full"
        "running running";
    grid-template-columns: minmax(300px, 1fr) minmax(400px, 2fr);
    grid-template-rows: auto auto auto;
    min-height: 100vh;
    gap: 15px;
    padding: 15px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.left-side {
    grid-area: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.right-side {
    grid-area: right;
}

.prayer-schedule-container {
    grid-area: full;
    margin-bottom: 70px;
}

.running-text-container {
    grid-area: running;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Header Card */
.header-card {
    background: linear-gradient(135deg, var(--primary-color), #2c7744);
    color: var(--text-light);
    text-align: center;
    padding: 20px 15px;
}

.masjid-name {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.masjid-location {
    font-size: clamp(12px, 2vw, 16px);
    opacity: 0.9;
}

/* Date Card */
.date-card {
    background: linear-gradient(135deg, var(--secondary-color), #5cb85c);
    color: var(--text-light);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
}

#gregorian-date {
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 600;
}

#hijri-date {
    font-size: clamp(12px, 2.5vw, 16px);
    opacity: 0.9;
}

/* Time Card */
.time-card {
    background: linear-gradient(135deg, var(--accent-color), #f1c40f);
    color: var(--text-dark);
    text-align: center;
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 700;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Countdown Card */
.countdown-card {
    background: linear-gradient(135deg, var(--primary-color), #2c7744);
    color: var(--text-light);
    text-align: center;
    padding: 20px 15px;
}

.iqamah-card {
    background: linear-gradient(135deg, var(--highlight), #f0e006);
    color: var(--text-light);
    text-align: center;
    padding: 20px 15px;
}

.next-prayer {
    font-size: clamp(16px, 3vw, 20px);
    margin-bottom: 8px;
    font-weight: 600;
}

.countdown {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 700;
    letter-spacing: 1px;
}

.iqamah-countdown {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 700;
    letter-spacing: 1px;
}

/* Slideshow Styles */
.media-slideshow {
    padding: 0;
    overflow: hidden;
    height: 100%;
    min-height: 300px;
}

.slideshow-container {
    position: relative;
    height: 100%;
}

.slide {
    display: none;
    height: 100%;
    animation: fade 1.5s ease;
}

@keyframes fade {
    from { opacity: .4 }
    to { opacity: 1 }
}

.slide-content {
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slide-title {
    font-size: clamp(18px, 3vw, 22px);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 8px;
}

/* Slide Ayat */
.verse-slide {
    justify-content: center;
    align-items: center;
}

.quran-verse {
    text-align: center;
    font-size: clamp(16px, 3vw, 20px);
    line-height: 1.6;
    color: var(--primary-color);
    position: relative;
    padding: 0 15px;
}

.quran-verse i {
    color: var(--accent-color);
    font-size: clamp(18px, 3vw, 24px);
    opacity: 0.7;
}

.quran-verse i:first-child {
    position: absolute;
    left: 0;
    top: -8px;
}

.quran-verse i:last-child {
    position: absolute;
    right: 0;
    bottom: -8px;
}

#verse-source {
    margin-top: 12px;
    font-style: italic;
    font-size: clamp(14px, 2.5vw, 18px);
    color: var(--secondary-color);
    font-weight: 600;
}

/* Slide Video */
.video-slide {
    padding: 10px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Slide Gambar */
.image-slide {
    justify-content: center;
    align-items: center;
}

.image-slide img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Slide Pengumuman */
.announcement-slide {
    justify-content: center;
}

.announcement-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: clamp(14px, 2.5vw, 18px);
}

.announcement-item i {
    margin-right: 12px;
    color: var(--accent-color);
    font-size: clamp(16px, 2.5vw, 20px);
    width: 20px;
    text-align: center;
}

.announcement-label {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 70px;
}

.announcement-value {
    margin-left: 8px;
    font-weight: 500;
}

.announcement-note {
    margin-top: 20px;
    padding: 8px;
    background-color: rgba(30, 86, 49, 0.1);
    border-radius: 8px;
    font-size: clamp(14px, 2vw, 16px);
    text-align: center;
    color: var(--primary-color);
}

.announcement-note i {
    margin-right: 6px;
    color: var(--accent-color);
}

/* Slide Iqamah */
.iqamah-slide {
    justify-content: center;
    align-items: center;
}

.iqamah-info {
    text-align: center;
    width: 100%;
}

.iqamah-prayer {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.iqamah-countdown {
    font-size: clamp(36px, 10vw, 72px);
    font-weight: 700;
    color: var(--highlight);
    margin: 15px 0;
    letter-spacing: 2px;
}

.iqamah-note {
    margin-top: 20px;
    padding: 8px;
    background-color: rgba(30, 86, 49, 0.1);
    border-radius: 8px;
    font-size: clamp(14px, 2vw, 16px);
    text-align: center;
    color: var(--primary-color);
}

.iqamah-note i {
    margin-right: 6px;
    color: var(--accent-color);
}

/* Navigasi Slideshow */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -22px;
    padding: 12px;
    color: white;
    background-color: rgba(0,0,0,0.3);
    font-weight: bold;
    font-size: 16px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    z-index: 10;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}

.dots-container {
    text-align: center;
    padding: 12px;
}

.dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    margin: 0 4px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

.active, .dot:hover {
    background-color: var(--primary-color);
}

/* Prayer Schedule */
.prayer-card {
    background: var(--primary-color);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    overflow-x: auto;
}

.prayer-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 5px;
    margin: 0 auto;
    table-layout: fixed;
}

.prayer-table th {
    background: linear-gradient(135deg, var(--accent-color), #f1c40f);
    color: var(--text-dark);
    padding: 12px 8px;
    font-size: clamp(14px, 2vw, 20px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.prayer-table th i {
    margin-right: 6px;
    font-size: clamp(14px, 2vw, 18px);
}

.prayer-table td {
    background-color: var(--prayer-time-bg);
    padding: 15px 8px;
    font-size: clamp(16px, 3vw, 26px);
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.prayer-table td:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.current-prayer {
    background: linear-gradient(135deg, var(--highlight), #c0392b);
    color: white;
    font-size: clamp(18px, 3.5vw, 28px);
    animation: pulse 2s infinite;
    z-index: 1;
}

.current-prayer::after {
    content: "⏳";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.8;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }
    50% { transform: scale(1.03); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); }
    100% { transform: scale(1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }
}

/* Running Text */
.running-text {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    padding: 12px 0;
    width: 100%;
}

.running-text marquee {
    font-size: clamp(12px, 2.5vw, 18px);
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.running-text i {
    margin-right: 8px;
    color: var(--accent-color);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-dark);
    font-size: clamp(14px, 2.5vw, 18px);
    font-style: italic;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 992px) {
    .container {
        grid-template-areas:
            "left"
            "right"
            "full"
            "running";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
    }
    
    .left-side, .right-side {
        width: 100%;
    }
    
    .prayer-table th {
        padding: 10px 6px;
    }
    
    .prayer-table td {
        padding: 12px 6px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
        gap: 10px;
    }
    
    .card {
        padding: 12px;
    }
    
    .prayer-table th {
        font-size: clamp(12px, 1.8vw, 16px);
        padding: 8px 4px;
    }
    
    .prayer-table td {
        font-size: clamp(14px, 2.5vw, 20px);
        padding: 10px 4px;
    }
    
    .iqamah-countdown {
        font-size: clamp(28px, 8vw, 48px);
    }
}

@media (max-width: 576px) {
    .container {
        padding: 8px;
        gap: 8px;
    }
    
    .prayer-table th {
        font-size: clamp(10px, 1.6vw, 14px);
    }
    
    .prayer-table td {
        font-size: clamp(12px, 2vw, 18px);
    }
    
    .iqamah-countdown {
        font-size: clamp(24px, 7vw, 36px);
    }
    
    .iqamah-prayer {
        font-size: clamp(18px, 4vw, 24px);
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .container {
        grid-template-rows: auto auto;
    }
    
    .prayer-schedule-container {
        margin-bottom: 60px;
    }
    
    .media-slideshow {
        min-height: 200px;
    }
}