/* =========================================
   Variables
   ========================================= */
:root {
    --bg-color: #F7F4EB;       /* بيج فاتح */
    --card-bg: #FFFFFF;
    --text-primary: #3B2E24;   /* بني داكن */
    --text-secondary: #705B48; /* بني فاتح */
    --primary-color: #2D4C63;  /* أزرق هادئ */
    --primary-hover: #1E3547;
    --secondary-color: #B59371;/* بيج غامق / ذهبي */
    --secondary-hover: #9A7B5C;
    --fire-color: #E65100;
}

/* =========================================
   Base Styles
   ========================================= */
body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

hr {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 20px 0;
}

/* =========================================
   Layout & Containers
   ========================================= */
.container {
    width: 90%;
    max-width: 600px;
}

.card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: opacity 0.3s ease;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* =========================================
   Inputs & Forms
   ========================================= */
input {
    width: 80%;
    padding: 10px 15px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    transition: background-color 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 5px 10px;
    font-size: 0.9rem;
}

.audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: bold;
}

.audio-btn:hover {
    background-color: var(--bg-color);
}

.controls {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.controls .btn {
    flex: 1;
}

.audio-controls {
    margin-bottom: 25px;
}

/* =========================================
   Progress Bar & Badges
   ========================================= */
.progress-container {
    background-color: #eee;
    border-radius: 10px;
    height: 8px;
    width: 100%;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--primary-color);
    height: 100%;
    width: 0%;
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.streak-badge {
    background-color: #FFF3E0;
    color: var(--fire-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    border: 1px solid #FFE0B2;
}

/* =========================================
   Ayah & Text Sections
   ========================================= */
.ayah-container {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
}

.ayah-wrapper {
    width: 100%;
    animation: fadeIn 0.5s ease-in-out;
}

.ayah-text {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    line-height: 2.2;
    color: var(--text-primary);
    margin: 0;
    animation: fadeIn 0.5s ease-in-out;
}

.english-text {
    font-family: sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 15px;
    direction: ltr;
    line-height: 1.5;
}

/* =========================================
   Tooltip (Hover Logic)
   ========================================= */
.tooltip-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip-text {
    visibility: hidden;
    width: 280px;
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 10;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.95rem;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* =========================================
   Utilities & Animations
   ========================================= */
.loader {
    color: var(--secondary-color);
    font-weight: bold;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}