:root {
    --primary-color: #0d9488;
    /* Teal 600 */
    --primary-dark: #0f766e;
    /* Teal 700 */
    --secondary-color: #f0fdfa;
    /* Teal 50 */
    --accent-color: #f59e0b;
    /* Amber 500 */
    --text-color: #1f2937;
    /* Gray 800 */
    --bg-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    overflow-x: hidden;
    padding-bottom: 80px;
    /* Space for bottom nav */
}

/* Header */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-title {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1.25rem;
}

/* Navigation Controls */
.nav-controls {
    background: white;
    border-radius: 12px;
    padding: 5px 10px;
    margin: 5px 0;
    /* box-shadow: var(--shadow);*/
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-label {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Slider */
.slider-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    touch-action: pan-y;
    /* Allow vertical scroll, handle horizontal swipe in JS if needed */
}

.slider-wrapper {
    display: flex;
    transition: transform 0.3s ease-in-out;
    width: 100%;
}

.slide {
    min-width: 100%;
    flex: 0 0 100%;
    padding: 0 5px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

.quran-page {
    width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: block;
}

/* Slider Navigation Buttons */
.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(249, 247, 238, 0.8);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: var(--primary-color);
    box-shadow: 0;
    transition: all 0.2s;
}

.slider-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
    background: rgba(255, 255, 255, 1);
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

.slider-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.nav-item {
    text-align: center;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.8rem;
    flex: 1;
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 2px;
}

/* Settings & History */
.settings-page,
.history-page {
    padding: 20px;
    background: white;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
}

.settings-page.active,
.history-page.active {
    transform: translateX(0);
}

.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    margin-right: 15px;
}

/* Toggles */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* History Grid */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
}

.history-btn {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    border-radius: 8px;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.9rem;
}

.history-btn.completed {
    background: var(--primary-color);
    color: white;
}

/* Completed Checkbox */
.completed-check-container {
    text-align: center;
    margin: 2px 0;
}

.btn-check-completed {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 10px;
    border-radius: 20px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.2s;
}

.btn-check-completed.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--secondary-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* RTL Slider Support */
.slider-wrapper.rtl-mode {
    direction: rtl;
}

/* Ensure icons and other elements stay LTR globally, 
   but specific slider adjustments if needed */