:root {
    --primary-bg: #0f172a;
    /* Deep Navy */
    --secondary-bg: #1e293b;
    /* Lighter Navy for cards */
    --accent-gold: #d4af37;
    /* Gold */
    --accent-gold-light: #fcd34d;
    --accent-gold-dark: #b45309;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);

    --font-main: 'Tajawal', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Remove blue highlight on mobile tap */
}

body {
    font-family: var(--font-main);
    background-color: var(--primary-bg);
    background-image:
        radial-gradient(circle at 50% 0%, #1e3a8a 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, #1e3a8a 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    /* Prevent scrolling on counter view */
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 480px;
    /* Mobile constraint */
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    position: relative;
    z-index: 10;
}

.header-title {
    text-align: center;
}

.header-title h1 {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.header-title p {
    color: var(--accent-gold);
    font-size: 0.9rem;
    font-weight: 300;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--accent-gold);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 3rem;
}

/* Counter Wrapper */
.counter-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 50%;
    margin-bottom: 2rem;
    transition: transform 0.1s;
    /* Soft glow behind the ring */
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.1);
}

.counter-wrapper:active {
    transform: scale(0.98);
}

.counter-content {
    position: absolute;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    /* Let clicks pass through to wrapper */
}

.counter-value {
    font-size: 5rem;
    font-weight: 300;
    line-height: 1;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.target-label {
    font-size: 1rem;
    color: var(--accent-gold);
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Progress Ring */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s ease-in-out;
    transform-origin: 50% 50%;
    stroke-linecap: round;
    /* Filter for glow */
    filter: drop-shadow(0 0 6px var(--accent-gold));
}

.instruction-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    opacity: 0.5;
}

/* Controls (Mic) */
.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.mic-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mic-btn.listening {
    background: var(--accent-gold);
    color: var(--primary-bg);
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.status-text {
    font-size: 0.9rem;
    color: var(--accent-gold);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(212, 175, 55, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

/* Settings Modal */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--secondary-bg);
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section h3 {
    color: var(--accent-gold);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Zikr Grid */
.zikr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.zikr-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.zikr-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.zikr-card.active {
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.zikr-main {
    font-weight: 700;
    font-size: 1rem;
}

.zikr-sub {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Target Pills */
.target-options {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.target-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.2s;
}

.target-btn.active {
    background: var(--accent-gold);
    color: var(--primary-bg);
    border-color: var(--accent-gold);
    font-weight: bold;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Custom Scrollbar for nicer finish */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-bg);
    border-radius: 3px;
}