/* Jadwal Sholat GPS Alarm - Main Stylesheet */

:root {
    --jsga-bg-color: #1e5f74;
    --jsga-text-color: #ffffff;
    --jsga-accent-color: #f7b42c;
}

/* Container utama */
#jsga-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: var(--jsga-bg-color);
    color: var(--jsga-text-color);
    padding: 1.5em 1em;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

#jsga-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.3));
    z-index: 1;
    pointer-events: none;
}

/* Lokasi */
#jsga-location {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5em 1em;
    border-radius: 50px;
    margin-bottom: 1em;
    font-size: 0.9em;
}

#jsga-location i {
    margin-right: 0.5em;
}

/* Tanggal Hijriyah */
#jsga-hijri-date {
    margin-bottom: 0.5em;
    font-size: 1em;
    opacity: 0.9;
}

/* Jam saat ini */
#jsga-current-time {
    font-size: 3em;
    font-weight: bold;
    margin: 0.2em 0;
}

/* Waktu sholat berikutnya */
#jsga-next-prayer {
    margin-bottom: 1.5em;
    font-size: 1em;
}

#jsga-next-prayer span {
    color: var(--jsga-accent-color);
    font-weight: bold;
}

/* Jadwal waktu sholat */
#jsga-timings {
    display: flex;
    justify-content: space-between;
    padding: 1em 0.5em;
    position: relative;
    z-index: 2;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#jsga-timings::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.jsga-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5em;
    min-width: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.jsga-time-name {
    font-size: 0.8em;
    margin-bottom: 0.5em;
}

.jsga-time-icon {
    font-size: 1.5em;
    margin-bottom: 0.5em;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.jsga-time.current .jsga-time-icon {
    background: var(--jsga-accent-color);
    color: #fff;
}

.jsga-time-value {
    font-size: 0.9em;
    font-weight: bold;
}

.jsga-time.current .jsga-time-value {
    color: var(--jsga-accent-color);
}

.jsga-time.alarm-set::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--jsga-accent-color);
    border-radius: 50%;
}

/* Popup */
#jsga-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2em;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    border-radius: 15px;
    z-index: 9999;
    max-width: 90%;
    width: 350px;
    text-align: center;
    color: #333;
}

#jsga-popup-title {
    font-size: 1.5em;
    margin-bottom: 5px;
}

#jsga-popup-time {
    font-size: 1.2em;
    margin-bottom: 20px;
}

#jsga-popup button {
    margin: 10px 5px;
    padding: 0.8em 1.5em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

#jsga-alarm-set {
    background: var(--jsga-accent-color);
    color: white;
}

#jsga-alarm-set:hover {
    background: var(--jsga-accent-color-hover, #e6a41b);
}

#jsga-alarm-remove {
    background: #f44336;
    color: white;
}

#jsga-alarm-remove:hover {
    background: #d32f2f;
}

#jsga-popup-close {
    background: #e0e0e0;
    color: #333;
}

#jsga-popup-close:hover {
    background: #c0c0c0;
}

#jsga-overlay {
    display: none;
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.7);
    z-index: 9998;
    backdrop-filter: blur(3px);
}

/* Loading animation */
.jsga-loading {
    position: relative;
    padding-left: 24px;
}

.jsga-loading:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--jsga-accent-color);
    border-radius: 50%;
    animation: jsga-spin 1s linear infinite;
}

@keyframes jsga-spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Toast notification */
#jsga-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    transition: opacity 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    font-size: 14px;
    max-width: 90%;
    text-align: center;
}

/* Responsive styles */
@media (min-width: 576px) {
    #jsga-container {
        max-width: 540px;
        padding: 2em;
    }
    
    #jsga-current-time {
        font-size: 4em;
    }
    
    .jsga-time {
        min-width: 80px;
    }
    
    .jsga-time-icon {
        width: 50px;
        height: 50px;
        font-size: 1.8em;
    }
}

@media (min-width: 768px) {
    #jsga-container {
        max-width: 720px;
    }
}

@media (max-width: 575px) {
    #jsga-popup {
        width: 90%;
        padding: 1.5em;
    }
    
    #jsga-popup button {
        width: 100%;
        margin: 5px 0;
    }
}

/* Accessibility improvements */
.jsga-time:focus {
    outline: 2px solid var(--jsga-accent-color);
}

#jsga-popup button:focus {
    outline: 2px solid #000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #jsga-popup {
        background-color: #333;
        color: #fff;
    }
    
    #jsga-popup-close {
        background: #555;
        color: #fff;
    }
}

/* Print styles */
@media print {
    #jsga-container {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
    
    #jsga-popup, #jsga-overlay {
        display: none !important;
    }
}
