:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(20, 26, 40, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --accent-color: #00f0ff;
    --accent-glow: rgba(0, 240, 255, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --font-main: 'Outfit', sans-serif;
    
    
    --active-bg: rgba(0, 240, 255, 0.1);
    --active-border: rgba(0, 240, 255, 0.4);
    --bg-gradient-1: rgba(0, 240, 255, 0.05);
    --bg-gradient-2: rgba(147, 51, 234, 0.05);
    
    --header-text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.5);
    --header-badge-bg: rgba(0, 0, 0, 0.3);
}

body.light-mode {
    --bg-color: #f0f4f8;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.05);
    --accent-color: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.4);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    
    --active-bg: rgba(14, 165, 233, 0.1);
    --active-border: rgba(14, 165, 233, 0.4);
    --bg-gradient-1: rgba(14, 165, 233, 0.05);
    --bg-gradient-2: rgba(14, 165, 233, 0.05);
    
    --header-text-shadow: 0 1px 4px rgba(255, 255, 255, 0.9), 0 0 15px rgba(255, 255, 255, 0.7);
    --header-badge-bg: rgba(255, 255, 255, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: 
        radial-gradient(circle at 15% 50%, var(--bg-gradient-1), transparent 25%),
        radial-gradient(circle at 85% 30%, var(--bg-gradient-2), transparent 25%);
    background-attachment: fixed;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    padding: 30px 25px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
    overflow: hidden;
}

/* Add a subtle top border shine */
.app-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    z-index: 2;
}

/* Header Banner Art */
.header-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 160px;
    background-image: url('assets/gambar/header_bg.png');
    background-size: cover;
    background-position: center;
    border-radius: 30px 30px 0 0;
    /* Softly blend the bottom edge into the dark card */
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
}

/* Base state for icons so they stand out */
.header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: var(--header-text-shadow);
}

.location-badge i {
    color: var(--accent-color);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.date-info-block {
    text-align: left;
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-shadow: var(--header-text-shadow);
}

.date-info-block #gregorian-date {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.9;
}

.date-info-block #hijri-date {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-color);
    letter-spacing: 0.2px;
}

.theme-toggle-btn {
    background: var(--header-badge-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    text-shadow: var(--header-text-shadow);
}

.theme-toggle-btn:hover {
    background: rgba(128, 128, 128, 0.2);
    color: var(--accent-color);
}

/* Countdown Section */
.countdown-section {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-circle {
    position: relative;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.countdown-circle svg {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.countdown-circle svg circle {
    fill: none;
    stroke-width: 8;
    stroke: var(--card-border);
    stroke-linecap: round;
}

.countdown-circle svg circle#progress-circle {
    stroke: var(--accent-color);
    stroke-dasharray: 880; /* 2 * pi * r (r=140 approx 879.6) */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.countdown-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

#next-prayer-name {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    text-shadow: var(--header-text-shadow);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.timer-display {
    font-size: clamp(2.5rem, 10vw, 3.5rem);
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-bottom: 10px;
}

@keyframes popAndGlowWhole {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes glowText {
    0%, 100% { text-shadow: 0 0 15px var(--accent-glow); color: var(--accent-color); }
    50% { text-shadow: 0 0 25px var(--accent-color), 0 0 20px var(--accent-color); color: var(--text-primary); }
}

.countdown-content.is-adzan {
    animation: popAndGlowWhole 1.5s infinite ease-in-out;
    gap: 0px;
}

.countdown-content.is-adzan #next-prayer-name {
    font-size: 1.3rem;
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
    margin-bottom: -5px;
}

.countdown-content.is-adzan .timer-display {
    font-size: 2.1rem !important;
    text-align: center;
    line-height: 1.1 !important;
    animation: glowText 1.5s infinite ease-in-out;
    margin: 5px 0;
    width: 100%;
}

.dismiss-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(0,0,0,0.3);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.8;
}

.next-prayer-time {
    font-size: 1rem;
    color: var(--text-secondary);
}

.next-prayer-time span {
    color: var(--text-primary);
    font-weight: 600;
}

.status-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.7;
}

.status-verified-icon {
    color: #10b981;
    margin-left: 6px;
    font-size: 1rem;
    filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.4));
}

/* Schedule Section */
.schedule-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.prayer-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prayer-card {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.prayer-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.prayer-card.active {
    background: var(--active-bg);
    border-color: var(--active-border);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.prayer-card.active .prayer-icon i,
.prayer-card.active h4,
.prayer-card.active .time {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

.prayer-icon {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(128, 128, 128, 0.05);
    border-radius: 12px;
    margin-right: 15px;
}

.prayer-icon i {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.prayer-info {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.prayer-info h4 {
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.prayer-info .time {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .app-container {
        padding: 25px 20px;
    }

    .header {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: space-between;
    }

    .countdown-circle {
        max-width: 260px;
    }
}

/* Premium Features Styling */
.extra-info-container {
    display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.05);
}
.extra-card {
    flex: 1; background: rgba(128,128,128,0.05); border: 1px solid var(--card-border); border-radius: 14px; padding: 12px 5px; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: 0.3s;
}
.extra-card:hover { background: var(--active-bg); border-color: var(--active-border); transform: translateY(-2px); }
.extra-card i { font-size: 1.2rem; }
.extra-details { display: flex; flex-direction: column; align-items: center; }
.extra-details span { font-size: 0.75rem; color: var(--text-secondary); }
.extra-details strong { font-size: 0.95rem; color: var(--text-primary); font-weight: 700; margin-top: 2px;}

/* Qibla Compass Styling */
.compass-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 4px solid var(--card-border);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.compass-circle {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 0.1s linear; /* Smooth real-time rotation */
}

.compass-mark {
    position: absolute;
    font-weight: bold;
    font-size: 1.4rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.compass-mark.north { top: 15px; left: 50%; transform: translateX(-50%); color: #ef4444; opacity: 1; }
.compass-mark.south { bottom: 15px; left: 50%; transform: translateX(-50%); }
.compass-mark.east { right: 20px; top: 50%; transform: translateY(-50%); }
.compass-mark.west { left: 20px; top: 50%; transform: translateY(-50%); }

.qibla-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 100%; /* Spans full height to easily rotate from exact center */
    transform: translate(-50%, -50%) rotate(0deg); 
    pointer-events: none;
    z-index: 5;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy initial rotation */
}

/* The actual kaaba icon at the tip of the arrow */
.qibla-arrow i {
    position: absolute;
    top: 25px; /* Offset from exact edge */
    left: 50%;
    transform: translateX(-50%);
    filter: drop-shadow(0 0 15px #10b981);
}

/* A center pin for the compass needle */
.compass-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: var(--text-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0,0,0,0.8);
    z-index: 10;
}

/* Smooth Click Animations */
button, .theme-toggle-btn, .prayer-card, .extra-card {
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, box-shadow 0.3s ease !important;
}

button:active, .theme-toggle-btn:active, .prayer-card:active, .extra-card:active {
    transform: scale(0.92) !important;
}

/* View Transition Fade */
.fade-in {
    animation: smoothFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes smoothFadeIn {
    0% { opacity: 0; transform: scale(0.96) translateY(15px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
