/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8B4513;
    --secondary-color: #D2691E;
    --accent-color: #CD853F;
    --text-color: #2C1810;
    --bg-color: #FFF8E7;
    --card-bg: #FFFFFF;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --spacing: 1rem;
    
    /* Blue Candle Light Colors (Morning) */
    --blue-candle-dark: #0b1f3b;
    --blue-candle-medium: #163a63;
    --blue-candle-light: #2e5b8a;
    --blue-candle-glow: #4aa3ff;
    --blue-candle-bg: #050b1a;
    --blue-candle-text: #e3f2ff;

    /* Green Candle Light Colors (Evening) */
    --green-candle-dark: #1a3d1a;
    --green-candle-medium: #2d5a2d;
    --green-candle-light: #4a7c4a;
    --green-candle-glow: #5cb85c;
    --green-candle-bg: #0f2e0f;
    --green-candle-text: #e8f5e8;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans Malayalam', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    background: linear-gradient(135deg, #FFF8E7 0%, #F5E6D3 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Better font rendering for English pages */
html[lang="en"] body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans Malayalam', sans-serif;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #050b1a 0%, #111827 100%);
}

[data-theme="dark"] footer {
    color: #999;
}

[data-theme="dark"] .info-section {
    background: #0b1220;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .info-section h3,
[data-theme="dark"] .info-item-title {
    color: #facc6b;
}

[data-theme="dark"] .info-text,
[data-theme="dark"] .info-list li,
[data-theme="dark"] .info-meta {
    color: #e5e7eb;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    padding: 1.5rem 1rem 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
}

/* Menu Toggle Button */
.menu-toggle {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    color: var(--text-color);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.menu-toggle .menu-icon {
    display: block;
    line-height: 1;
}

[data-theme="dark"] .menu-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.header-top > div:first-child {
    flex: 1;
    min-width: 200px;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.site-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 400;
}

.header-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.control-group-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Notification Toggle Button */
.notification-toggle {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.notification-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.notification-toggle.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

.notification-toggle.active .notification-icon {
    animation: bell-ring 0.5s ease;
}

.notification-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

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

@keyframes bell-ring {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
    20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

[data-theme="dark"] .notification-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-color);
}

[data-theme="dark"] .notification-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .notification-toggle.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 90%;
    max-width: 400px;
    height: 100%;
    background: var(--card-bg);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.menu-overlay.active .menu-content {
    transform: translateX(0);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--primary-color);
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.menu-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.menu-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-nav {
    flex: 1;
    padding: 1rem 0;
}

.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-list li {
    margin: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(139, 69, 19, 0.1);
    border-left-color: var(--primary-color);
}

.menu-icon-item {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.menu-item-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.menu-item-desc {
    font-size: 0.85rem;
    opacity: 0.7;
    color: var(--text-color);
}

.menu-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 1rem 1.5rem;
    border: none;
    padding: 0;
}

.menu-section-title {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
    color: var(--text-color);
}

[data-theme="dark"] .menu-content {
    background: var(--card-bg);
}

[data-theme="dark"] .menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .menu-divider {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive Menu */
@media (max-width: 768px) {
    .menu-content {
        width: 85%;
        max-width: 320px;
    }
    
    .menu-header {
        padding: 1.25rem;
    }
    
    .menu-header h2 {
        font-size: 1.25rem;
    }
    
    .menu-item {
        padding: 0.875rem 1.25rem;
    }
    
    .menu-icon-item {
        font-size: 1.25rem;
        width: 36px;
    }
}

.pill-toggle,
.pill-segmented {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pill-toggle button,
.pill-toggle .pill-btn,
.pill-segmented button {
    border: none;
    background: transparent;
    color: #fdfdfd;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.pill-toggle .pill-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pill-toggle button.active,
.pill-toggle button:disabled,
.pill-segmented button.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
}

/* Navigation */
.prayer-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-btn {
    flex: 1;
    min-width: 150px;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: var(--shadow);
}

.nav-btn:hover:not(:disabled) {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.nav-btn.active[data-prayer="morning"] {
    background: var(--blue-candle-medium);
    border-color: var(--blue-candle-glow);
    box-shadow: 0 0 15px rgba(74, 163, 255, 0.5);
}

.nav-btn.active[data-prayer="evening"] {
    background: var(--green-candle-medium);
    border-color: var(--green-candle-glow);
    box-shadow: 0 0 15px rgba(92, 184, 92, 0.5);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Main Content */
main {
    flex: 1;
    margin-bottom: 2rem;
}

.prayer-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    position: relative;
}

/* Morning Prayer - Blue Candle Light Theme */
.morning-prayer {
    background: linear-gradient(135deg, var(--blue-candle-bg) 0%, var(--blue-candle-dark) 100%);
    color: var(--blue-candle-text);
    box-shadow: 0 0 30px rgba(74, 163, 255, 0.3), 0 0 60px rgba(74, 163, 255, 0.2);
    border: 2px solid var(--blue-candle-glow);
}

.morning-prayer::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 30px;
    background: linear-gradient(to bottom, #e3f2ff, #4aa3ff);
    border-radius: 4px 4px 0 0;
    box-shadow: 0 0 20px rgba(74, 163, 255, 0.8), 0 0 40px rgba(74, 163, 255, 0.6);
    animation: candle-flicker 2s ease-in-out infinite alternate;
    z-index: 1;
}

.morning-prayer::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(74, 163, 255, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: candle-glow 2s ease-in-out infinite alternate;
    z-index: 0;
}

/* Evening Prayer - Green Candle Light Theme */
.evening-prayer {
    background: linear-gradient(135deg, var(--green-candle-bg) 0%, var(--green-candle-dark) 100%);
    color: var(--green-candle-text);
    box-shadow: 0 0 30px rgba(92, 184, 92, 0.3), 0 0 60px rgba(92, 184, 92, 0.2);
    border: 2px solid var(--green-candle-glow);
}

.evening-prayer::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 30px;
    background: linear-gradient(to bottom, #ffd700, #5cb85c);
    border-radius: 4px 4px 0 0;
    box-shadow: 0 0 20px rgba(92, 184, 92, 0.8), 0 0 40px rgba(92, 184, 92, 0.6);
    animation: candle-flicker 2s ease-in-out infinite alternate;
    z-index: 1;
}

.evening-prayer::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(92, 184, 92, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: candle-glow 2s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes candle-flicker {
    0% {
        transform: translateX(-50%) translateY(0) scaleY(1);
        opacity: 1;
    }
    25% {
        transform: translateX(-50%) translateY(-2px) scaleY(1.05);
        opacity: 0.9;
    }
    50% {
        transform: translateX(-50%) translateY(1px) scaleY(0.95);
        opacity: 0.95;
    }
    75% {
        transform: translateX(-50%) translateY(-1px) scaleY(1.02);
        opacity: 0.92;
    }
    100% {
        transform: translateX(-50%) translateY(0) scaleY(1);
        opacity: 1;
    }
}

@keyframes candle-glow {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translateX(-50%) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.6;
    }
}

.prayer-section.hidden {
    display: none;
}

.prayer-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-color);
    position: relative;
    z-index: 2;
}

.prayer-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.prayer-header-content > div:first-child {
    flex: 1;
    min-width: 200px;
}

/* Text-to-Speech Button */
.tts-btn {
    display: none; /* Hidden by default */
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    backdrop-filter: blur(5px);
    white-space: nowrap;
}

/* Show TTS button only on mobile/tablet and in production */
.tts-btn.show {
    display: flex;
}

.tts-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.tts-btn.speaking {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.tts-icon {
    font-size: 1.2rem;
}

.tts-text {
    font-size: 0.9rem;
}

.morning-prayer .tts-btn {
    border-color: rgba(74, 163, 255, 0.4);
    color: var(--blue-candle-text);
}

.morning-prayer .tts-btn:hover {
    background: rgba(74, 163, 255, 0.2);
    border-color: var(--blue-candle-glow);
    box-shadow: 0 0 15px rgba(74, 163, 255, 0.4);
}

.morning-prayer .tts-btn.speaking {
    background: rgba(74, 163, 255, 0.3);
    border-color: var(--blue-candle-glow);
    box-shadow: 0 0 20px rgba(74, 163, 255, 0.6);
}

.evening-prayer .tts-btn {
    border-color: rgba(92, 184, 92, 0.4);
    color: var(--green-candle-text);
}

.evening-prayer .tts-btn:hover {
    background: rgba(92, 184, 92, 0.2);
    border-color: var(--green-candle-glow);
    box-shadow: 0 0 15px rgba(92, 184, 92, 0.4);
}

.evening-prayer .tts-btn.speaking {
    background: rgba(92, 184, 92, 0.3);
    border-color: var(--green-candle-glow);
    box-shadow: 0 0 20px rgba(92, 184, 92, 0.6);
}

/* Audio Message Popup */
.audio-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.audio-message-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 350px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.audio-message-content p {
    margin: 0 0 0.75rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.audio-message-sub {
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    color: #666 !important;
}

.audio-message-tip {
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    color: var(--primary-color) !important;
    background: var(--bg-color);
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 1rem !important;
}

.audio-message-close {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.audio-message-close:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.morning-prayer .prayer-header {
    border-bottom: 2px solid var(--blue-candle-glow);
    padding-top: 2rem;
}

.prayer-header h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.morning-prayer .prayer-header h2 {
    color: var(--blue-candle-glow);
    text-shadow: 0 0 10px rgba(74, 163, 255, 0.8), 0 0 20px rgba(74, 163, 255, 0.5);
}

.evening-prayer .prayer-header {
    border-bottom: 2px solid var(--green-candle-glow);
    padding-top: 2rem;
}

.evening-prayer .prayer-header h2 {
    color: var(--green-candle-glow);
    text-shadow: 0 0 10px rgba(92, 184, 92, 0.8), 0 0 20px rgba(92, 184, 92, 0.5);
}

.prayer-time {
    font-size: 1.1rem;
    color: var(--secondary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.morning-prayer .prayer-time {
    color: #b3dbff;
    text-shadow: 0 0 5px rgba(74, 163, 255, 0.6);
}

.evening-prayer .prayer-time {
    color: #a8e6a8;
    text-shadow: 0 0 5px rgba(92, 184, 92, 0.6);
}

.prayer-instruction {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
}

.morning-prayer .prayer-instruction {
    color: #c6d8f0;
}

.evening-prayer .prayer-instruction {
    color: #b8d4b8;
}

/* Prayer Content */
.prayer-content {
    line-height: 2.2;
    position: relative;
    z-index: 2;
}

.prayer-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-align: justify;
    color: var(--text-color);
    padding: 1rem;
    background: #FAF9F6;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.morning-prayer .prayer-text {
    color: var(--blue-candle-text);
    background: rgba(11, 31, 59, 0.75);
    border-left: 4px solid var(--blue-candle-glow);
    box-shadow: 0 0 15px rgba(74, 163, 255, 0.25), inset 0 0 10px rgba(74, 163, 255, 0.12);
    backdrop-filter: blur(2px);
}

.evening-prayer .prayer-text {
    color: var(--green-candle-text);
    background: rgba(26, 61, 26, 0.6);
    border-left: 4px solid var(--green-candle-glow);
    box-shadow: 0 0 15px rgba(92, 184, 92, 0.2), inset 0 0 10px rgba(92, 184, 92, 0.1);
    backdrop-filter: blur(2px);
}

.prayer-end {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--accent-color);
    text-align: center;
}

.morning-prayer .prayer-end {
    border-top: 2px solid var(--blue-candle-glow);
}

.evening-prayer .prayer-end {
    border-top: 2px solid var(--green-candle-glow);
}

.prayer-end p {
    font-size: 1.1rem;
    margin: 0.8rem 0;
    font-weight: 600;
    color: var(--primary-color);
}

.morning-prayer .prayer-end p {
    color: var(--blue-candle-glow);
    text-shadow: 0 0 8px rgba(74, 163, 255, 0.7);
}

/* Additional Prayers Section */
.additional-prayers {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(74, 163, 255, 0.3);
}

.morning-prayer .additional-prayers {
    border-top: 2px solid rgba(74, 163, 255, 0.3);
}

.evening-prayer .additional-prayers {
    border-top: 2px solid rgba(92, 184, 92, 0.3);
}

.prayer-subsection {
    margin-bottom: 2rem;
}

.prayer-subsection:last-child {
    margin-bottom: 0;
}

.prayer-subtitle {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-align: center;
}

.morning-prayer .prayer-subtitle {
    color: var(--blue-candle-glow);
    text-shadow: 0 0 10px rgba(74, 163, 255, 0.8), 0 0 20px rgba(74, 163, 255, 0.5);
}

.evening-prayer .prayer-subtitle {
    color: var(--green-candle-glow);
    text-shadow: 0 0 10px rgba(92, 184, 92, 0.8), 0 0 20px rgba(92, 184, 92, 0.5);
}

.prayer-end-inline {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1rem;
    color: var(--primary-color);
}

.morning-prayer .prayer-end-inline {
    color: var(--blue-candle-glow);
    text-shadow: 0 0 8px rgba(74, 163, 255, 0.7);
}

.evening-prayer .prayer-end-inline {
    color: var(--green-candle-glow);
    text-shadow: 0 0 8px rgba(92, 184, 92, 0.7);
}

.evening-prayer .prayer-end p {
    color: var(--green-candle-glow);
    text-shadow: 0 0 8px rgba(92, 184, 92, 0.7);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    color: #666;
    font-size: 0.9rem;
    margin-top: auto;
}

/* Social Sharing */
.social-sharing {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .social-sharing {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.share-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

[data-theme="dark"] .share-label {
    color: #e5e7eb;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
}

.share-facebook {
    background: #1877F2;
}

.share-facebook:hover {
    background: #166FE5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(24, 119, 242, 0.3);
}

.share-twitter {
    background: #1DA1F2;
}

.share-twitter:hover {
    background: #1A91DA;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(29, 161, 242, 0.3);
}

.share-whatsapp {
    background: #25D366;
}

.share-whatsapp:hover {
    background: #22C55E;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

/* Google Maps */
.map-container {
    margin-top: 1rem;
}

.map-container iframe {
    width: 100%;
    height: 250px;
    border: 0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.btn-directions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.btn-directions:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.back-to-top:active {
    transform: translateY(-1px);
}

[data-theme="dark"] .back-to-top {
    background: var(--blue-candle-medium);
    box-shadow: 0 4px 12px rgba(74, 163, 255, 0.3);
}

[data-theme="dark"] .back-to-top:hover {
    background: var(--blue-candle-glow);
    box-shadow: 0 6px 20px rgba(74, 163, 255, 0.5);
}

/* Info sections (prayer timings & contact) */
.info-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.info-section > div {
    width: 100%;
    min-width: 0; /* Prevents grid overflow */
}

.info-grid > div {
    min-width: 0; /* Prevents text overflow */
    overflow-wrap: break-word;
}

.info-section h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.info-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.info-text {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.info-text:last-child {
    margin-bottom: 0;
}

.info-text strong {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

[data-theme="dark"] .info-text strong {
    color: #facc6b;
}

.info-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0;
}

.info-list li {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.info-meta {
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.75rem;
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 90%;
    width: 400px;
    text-align: center;
}

.install-prompt.hidden {
    display: none;
}

.install-prompt p {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-color);
}

.install-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-install,
.btn-dismiss {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.btn-install:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-dismiss {
    background: #e0e0e0;
    color: var(--text-color);
}

.btn-dismiss:hover {
    background: #d0d0d0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0.75rem;
    }

    header {
        padding: 1.25rem 1rem 0.75rem;
        margin-bottom: 1.5rem;
    }

    .header-top {
        flex-direction: row;
        align-items: center;
    }
    
    .header-left {
        flex: 1;
        min-width: auto;
    }

    .header-controls {
        width: auto;
        justify-content: flex-end;
        flex-shrink: 0;
    }
    
    .menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .info-section {
        padding: 1.25rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .info-text {
        font-size: 0.9rem;
        margin-bottom: 0.625rem;
    }
    
    .info-section h3 {
        font-size: 1.2rem;
    }
    
    .map-container iframe {
        height: 200px;
    }
    
    .btn-directions {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .social-sharing {
        gap: 0.5rem;
        flex-direction: column;
    }
    
    .share-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        right: 1.5rem;
        font-size: 1.3rem;
    }

    .site-title {
        font-size: 2rem;
    }

    .site-subtitle {
        font-size: 1rem;
    }

    .prayer-nav {
        margin-bottom: 1.5rem;
    }

    .nav-btn {
        min-width: 120px;
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .prayer-section {
        padding: 1.5rem;
    }

    .prayer-header h2 {
        font-size: 1.5rem;
    }
    
    .prayer-header-content {
        flex-direction: column;
        align-items: center;
    }
    
    .tts-btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .tts-text {
        font-size: 0.85rem;
    }

    .prayer-time {
        font-size: 1rem;
    }

    .prayer-text {
        font-size: 1rem;
        padding: 0.875rem;
        line-height: 2;
    }
    
    .morning-prayer::before,
    .evening-prayer::before {
        width: 6px;
        height: 25px;
    }
    
    .morning-prayer::after,
    .evening-prayer::after {
        width: 50px;
        height: 50px;
        top: 15px;
    }

    .prayer-end p {
        font-size: 1rem;
    }

    .install-prompt {
        width: calc(100% - 2rem);
        max-width: 350px;
        padding: 1.25rem;
    }

    .install-buttons {
        flex-direction: column;
    }

    .btn-install,
    .btn-dismiss {
        width: 100%;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .site-title {
        font-size: 1.75rem;
    }

    .prayer-section {
        padding: 1.25rem;
    }

    .prayer-text {
        font-size: 0.95rem;
        padding: 0.75rem;
        line-height: 1.9;
    }
    
    .morning-prayer::before,
    .evening-prayer::before {
        width: 5px;
        height: 20px;
    }
    
    .morning-prayer::after,
    .evening-prayer::after {
        width: 40px;
        height: 40px;
        top: 12px;
    }

    .prayer-header h2 {
        font-size: 1.3rem;
    }
}

    .map-container iframe {
        height: 180px;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.2rem;
    }
    
    .share-label {
        font-size: 0.85rem;
    }
    
    .share-btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.75rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .install-prompt,
    .prayer-nav,
    footer {
        display: none;
    }

    .prayer-section {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
button:focus,
.nav-btn:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000000;
        --bg-color: #FFFFFF;
        --card-bg: #FFFFFF;
    }
}

