/* --- GLOBAL VARIABLES --- */
:root {
    --bg-color: #0f172a;       /* Dark Blue/Slate Background */
    --surface-color: #1e293b;  /* Lighter Cards */
    --accent-color: #10b981;   /* Emerald Green */
    --accent-glow: rgba(16, 185, 129, 0.4);
    --text-color: #f1f5f9;     /* White Text */
    --muted-color: #94a3b8;    /* Grey Text */
    --gold-color: #fbbf24;     /* Donation Gold */
    --danger-color: #ef4444;   /* Red for errors/stops */
}

/* --- BASE STYLES --- */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden; /* Prevent scrolling on main screens */
    display: flex;
    flex-direction: column;
    /* Improves touch response on mobile */
    touch-action: manipulation; 
    -webkit-tap-highlight-color: transparent;
}

/* --- LAYOUT CONTAINERS --- */
.page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 20px;
    overflow-y: auto; /* Allow scroll if content is tall */
}
section {
    display: none; /* Hidden by default */
    position: absolute; /* Fixes position to cover screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Forces full screen height */
    flex-direction: column;
    align-items: center; /* Horizontal Center */
    justify-content: center; /* Vertical Center */
    padding: 20px;
    box-sizing: border-box;
}

section.active-view {
    display: flex; /* Turns on the Flexbox layout */
}

/* Common Wrapper to hold content together */
.content-wrapper {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers items inside the wrapper */
    text-align: center;
}

/* FORM ELEMENTS - Centers the dropdown specifically */
.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}
/* --- TYPOGRAPHY --- */
h2 {
    font-weight: 300;
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

/* --- BUTTONS & CARDS --- */
.button-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.card-btn {
    background: var(--surface-color);
    border: 1px solid #334155;
    color: white;
    padding: 20px;
    border-radius: 16px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: transform 0.2s, border-color 0.2s;
    width: 100%;
}

.card-btn:active {
    transform: scale(0.98);
    border-color: var(--accent-color);
    background: rgba(16, 185, 129, 0.1);
}

.icon { font-size: 1.5rem; }

/* Primary Action Button */
.primary-btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
}
.primary-btn:active { transform: scale(0.96); }

/* Inputs */
input {
    background: var(--surface-color);
    border: 1px solid #334155;
    color: white;
    padding: 15px;
    font-size: 1.2rem;
    border-radius: 10px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    outline: none;
}
input:focus { border-color: var(--accent-color); }

/* --- TOP NAVIGATION BAR --- */
.top-bar {
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
    background: var(--bg-color);
    border-bottom: 1px solid #334155;
    z-index: 10;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--muted-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    text-decoration: none; /* For <a> tags */
    display: flex;
    align-items: center;
}
.nav-btn:hover { color: white; }

.user-info {
    font-size: 0.9rem;
    color: var(--muted-color);
}
.user-info span { color: var(--accent-color); font-weight: bold; }

.right-icons { display: flex; gap: 5px; }

/* --- MAIN DHIKR CIRCLE --- */
.main-view-layout {
    justify-content: center; /* Vertically center the circle */
}

.dhikr-circle {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: var(--surface-color);
    border: 4px solid #334155;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
}

/* Modes Styles */
.mode-tap {
    cursor: pointer;
    border-color: #334155;
}
.mode-tap:active {
    transform: scale(0.96);
    border-color: white;
}

/* Voice Mode: Non-clickable visual */
.mode-voice {
    cursor: default; /* Show arrow, not hand */
    border-color: var(--accent-color);
}

/* Pulse Animation (Triggered by JS) */
.pulse-active {
    animation: pulse-ring 0.4s ease-out;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 var(--accent-glow); transform: scale(1.02); }
    100% { box-shadow: 0 0 0 50px rgba(0,0,0,0); transform: scale(1); }
}

#countDisplay { font-size: 5rem; font-weight: 200; line-height: 1; margin: 0; }
#dhikrLabel { color: var(--accent-color); font-size: 1rem; margin-top: 10px; font-weight: 600; }

/* --- STATUS TEXT --- */
.status-text {
    margin-top: 30px;
    color: var(--muted-color);
    font-size: 0.9rem;
    text-align: center;
}

.debug-text {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #666;
    font-family: monospace;
    min-height: 20px;
    text-align: center;
}

/* --- STATS STYLES --- */
.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
    justify-content: center;
}

.tab-btn {
    background: transparent;
    border: 1px solid #334155;
    color: var(--muted-color);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    flex: 1;
    max-width: 120px;
}
.tab-btn.active {
    background: var(--accent-color);
    color: black;
    border-color: var(--accent-color);
    font-weight: bold;
}

.stats-list {
    width: 100%;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #334155;
}
.stat-count { color: var(--accent-color); font-weight: bold; }

/* --- ABOUT CARD --- */
.info-card {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid #334155;
}

.donate-btn {
    background: var(--gold-color);
    color: #000;
    font-weight: bold;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    margin-top: 25px;
    transition: transform 0.2s;
}
.donate-btn:active { transform: scale(0.96); }

/* --- ANIMATIONS --- */
.fade-in { animation: fadeIn 0.5s ease-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* ... keep your existing variables and body styles ... */

/* --- FORM ELEMENTS --- */

/* Style for the new Dropdown */
.lang-dropdown {
    width: 80%;
    max-width: 300px;
    padding: 15px;
    font-size: 1.1rem;
    color: white;
    background-color: var(--surface-color);
    border: 1px solid #334155;
    border-radius: 12px;
    outline: none;
    margin: 0 auto 20px auto; /* 'auto' forces it to the center horizontally */
    display: block; /* Ensures margins work */
    text-align: center;
    text-align-last: center; /* Centers text inside the box */
    cursor: pointer;
}

.lang-dropdown option {
    background-color: var(--surface-color);
    color: white;
}
/* --- DANGER ZONE STYLES --- */
.danger-section {
    width: 100%;
    margin-top: 30px;
    border-top: 1px solid #334155;
    padding-top: 20px;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1); /* Red tint */
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.btn-danger:active {
    background: var(--danger-color);
    color: white;
    transform: scale(0.98);
}

.danger-text {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    margin-top: 8px;
}

/* ... keep the rest of your CSS (buttons, circles, etc) ... */