/* ===== STYLING KHUSUS UNTUK HALAMAN JADWAL SHOLAT ===== */

/* ===== RESET DAN ISOLASI CSS ===== */
.jadwal-sholat-page-isolated * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.jadwal-sholat-page-isolated {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f7fa;
    isolation: isolate;
}

/* ===== CUSTOM ALERT ===== */
.custom-alert {
    display: none;
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff4444;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 90%;
    width: 300px;
    text-align: center;
}

.custom-alert .close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.custom-alert .close-btn:hover {
    color: #ffcccc;
}

/* ===== LOCATION INFO ===== */
.location {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2c5e2e;
}

/* ===== COUNTDOWN TIMER ===== */
.countdown {
    position: relative;
    display: inline-block;
    font-weight: bold;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    background-image: linear-gradient(135deg, #4b6cb7, #182848, #ff416c);
    background-size: 300% 300%;
    animation: animateBackground 6s ease-in-out infinite alternate;
}

/* Background pingpong gradasi */
@keyframes animateBackground {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* Efek cahaya sweeping */
.countdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 45%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.3) 55%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-20deg);
    animation: lightSweep 3s linear infinite;
}

/* Cahaya bergerak menyapu seluruh area tanpa putus */
@keyframes lightSweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

#countdown {
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
    color: #ffffff;
    background: #34495e;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 20px auto;
}

/* ===== SCHEDULE TABLE ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

th, td {
    padding: 15px;
    border: 1px solid #e0e0e0;
    text-align: center;
    text-transform: uppercase;
}

th {
    background: linear-gradient(135deg, #2c5e2e 0%, #1e3e20 100%);
    color: white;
    font-weight: bold;
    font-size: 1.1em;
}

td {
    color: #2c3e50;
    font-size: 1em;
}

tr:hover {
    background-color: rgba(245, 247, 250, 0.8);
    transition: background-color 0.3s ease;
}

/* ===== BUTTON CONTAINER ===== */
.button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 15px 0;
    margin: 0 auto;
    max-width: 100%;
}

.button-container button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
    height: 52px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
    color: #FFFFFF;
    text-transform: uppercase;
    flex: 1 1 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.refresh-btn { background: linear-gradient(135deg, #2c5e2e, #3a7d3c); }
.location-btn { background: linear-gradient(135deg, #3498db, #2980b9); }
.share-btn { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.notify-btn { background: linear-gradient(135deg, #e74c3c, #c0392b); }

.button-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.18);
}

.button-container button:active {
    transform: translateY(0);
}

.button-container svg {
    width: 18px;
    height: 18px;
    fill: white;
    flex-shrink: 0;
}

/* ===== LOADING & PROGRESS INDICATORS ===== */
#loading-indicator {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 25px 35px;
    border-radius: 12px;
    z-index: 10000;
    font-size: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    min-width: 200px;
}

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 768px) {
    .jadwal-sholat-page-isolated {
        padding: 15px;
    }
    
    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 12px 10px;
    }

    #countdown {
        font-size: 1.2em;
        padding: 12px 20px;
    }
    
    .countdown {
        padding: 6px 12px;
    }
    
    .button-container {
        gap: 10px;
    }
    
    .button-container button {
        min-width: calc(50% - 10px);
        height: 48px;
        font-size: 13px;
    }
    
    .custom-alert {
        width: 280px;
        padding: 12px 18px;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .jadwal-sholat-page-isolated {
        padding: 10px;
    }
    
    table {
        font-size: 0.85em;
    }

    th, td {
        padding: 10px 8px;
    }
    
    #countdown {
        font-size: 1.1em;
        padding: 10px 15px;
    }
    
    .button-container button {
        min-width: calc(33.333% - 10px);
        height: 44px;
        font-size: 12px;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .jadwal-sholat-page-isolated {
        padding: 10px;
    }
    
    table {
        font-size: 0.8em;
        border-radius: 6px;
    }

    th, td {
        padding: 10px 5px;
    }
    
    th {
        font-size: 0.9em;
    }

    #countdown {
        font-size: 1em;
        padding: 10px 15px;
        margin: 15px auto;
    }
    
    .countdown {
        padding: 5px 10px;
        font-size: 16px;
    }
    
    .location {
        padding: 12px;
        margin: 15px 0;
    }
    
    .button-container {
        flex-direction: row;
        gap: 8px;
        padding: 10px 0;
    }
    
    .button-container button {
        min-width: calc(50% - 8px);
        max-width: calc(50% - 8px);
        height: 46px;
        font-size: 12px;
    }
    
    .button-container svg {
        width: 16px;
        height: 16px;
    }
    
    .custom-alert {
        width: 260px;
        padding: 10px 15px;
        top: 80px;
    }
}

/* Mobile Very Small */
@media (max-width: 320px) {
    .jadwal-sholat-page-isolated {
        padding: 8px;
    }
    
    table {
        font-size: 0.75em;
    }
    
    th, td {
        padding: 8px 3px;
    }
    
    #countdown {
        font-size: 0.9em;
        padding: 8px 12px;
    }
    
    .countdown {
        font-size: 14px;
        padding: 4px 8px;
    }
    
    .button-container {
        flex-direction: column;
    }
    
    .button-container button {
        min-width: 100%;
        max-width: 100%;
        font-size: 11px;
    }
    
    .custom-alert {
        width: 240px;
        padding: 8px 12px;
    }
}

/* High DPI/Retina Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    table {
        border-width: 0.5px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    tr:hover {
        background-color: inherit;
    }
    
    .button-container button:hover {
        transform: none;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
    }
}

/* Print Styles */
@media print {
    .jadwal-sholat-page-isolated {
        background: white;
        padding: 0;
    }
    
    table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    th {
        background: #f8f9fa !important;
        color: #000 !important;
    }
    
    .button-container,
    .countdown,
    #countdown,
    .custom-alert {
        display: none !important;
    }
    
    .location {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .jadwal-sholat-page-isolated {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .location {
        background: #2d3748;
        color: #e0e0e0;
        border-left-color: #48bb78;
    }
    
    table {
        background: #2d3748;
    }
    
    th {
        background: linear-gradient(135deg, #2d3748, #4a5568);
        color: #e0e0e0;
    }
    
    td {
        color: #e0e0e0;
        border-color: #4a5568;
    }
    
    tr:hover {
        background-color: rgba(74, 85, 104, 0.8);
    }
    
    #countdown {
        background: #4a5568;
        color: #e0e0e0;
    }
}