

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

/* Base typography and page level styles */
html {
    /* Set base font size for rem units */
    font-size: 16px;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optional: Set specific font families for headings if desired */
h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Prevent scrolling when prayer page is active */
body.prayer-page-active {
    overflow: hidden;
}

/* ==============================================
   Header Styles
============================================== */
header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Header container */
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

/* Logo and title grouping */
.header-content > div:first-child {
    display: flex;
    align-items: center;
    min-width: 0;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.header-content img {
    max-width: 48px;
    height: auto;
}

/* ==============================================
   Grid Layout and Cards
============================================== */
/* Main page grid container */
.grid-container {
    width: 100%;
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
    display: block;
}

/* Card grid layout */
.card-grid {
    width: 100%;
    display: block; /* Default to single column on mobile */
}

/* Individual card styling */
.card {
    width: 100%;
    margin-bottom: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Card image container */
.card-image {
    width: 100%;
    padding-bottom: 66.67%; /* 3:2 aspect ratio */
    position: relative;
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card content area */
.card-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.card-description {
    color: #666;
    font-size: 0.9rem;
}

/* ==============================================
   Prayer Page Styles
============================================== */
/* Main prayer page container */
.prayer-page {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    z-index: 1000;
    display: none;
    background-image: url('/assets/images/defaults/default-bg.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-color: rgba(0, 0, 0, 0.7);
}

/* Prayer content container */
#prayerContent {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000; /* Base black background */
}


/* Individual slide styling */
.prayer-slide {
    position: absolute;
    inset: 0;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    background-color: transparent;
}

/* Add specific styles for image slides */
.prayer-slide[style*="background-image"] img {
    max-width: 80%;
    height: auto;
    margin: auto;
    display: block;
    position: relative;
}

/* Active slide state */
.prayer-slide.active {
    display: block;
    opacity: 1;
}

/* Prayer content text container */
.prayer-content-overlay {
    position: relative;
    z-index: 2;  /* Ensure text displays above images */
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 1.5rem 0;  /* Top padding for spacing */
    color: white;
}

/* Text container width constraint */
.prayer-content-overlay .prayer-text-container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 0.5rem 1rem;
}

/* Prayer slide title */
.prayer-content-overlay h2 {
    font-size: clamp(1.4rem, 2.75vw, 2rem);
    color: #E57373;
    text-align: center;
    width: 100%;
    margin-bottom: 1rem;
}

/* Prayer slide main text */
.prayer-content-overlay .prayer-text {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.4;
    text-align: center;
}

/* Prayer text container with improved spacing */
.prayer-text-container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Prayer text styling */
.prayer-text {
    text-align: center;
    margin-bottom: 15px;
}

/* Image wrapper for vertical centering */
.prayer-image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 3vh auto;
}

/* Image styling with responsive sizing */
.prayer-image {
    max-width: 90%;
    max-height: 35vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ==============================================
   Prayer Page Navigation Elements
============================================== */
/* Slide counter */
.slide-number {
    position: fixed;
    top: 2rem;
    right: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    z-index: 1010;
}

/* Back button */
.back-button {
    position: fixed;
    top: 2rem;
    left: 2rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1010;
    cursor: pointer;
}

.back-button:hover {
    background: rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.8);
}

/* Navigation controls container */
.navigation-controls {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 1010;
    width: auto;
}

/* Previous/Next buttons container */
.nav-buttons {
    display: flex;
    gap: 1rem;
}

/* Navigation buttons */
.nav-button {
    background: #E57373;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1rem;
    min-width: 120px;
}

.nav-button:hover {
    background: #d32f2f;
}

/* Auto-advance controls */
.auto-advance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-top: 0.5rem;
}

.auto-advance label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    cursor: pointer;
}

.auto-advance input[type="checkbox"] {
    cursor: pointer;
    opacity: 0.5;
}

.auto-advance:hover {
    background: rgba(0, 0, 0, 0.5);
}

.auto-advance:hover label {
    color: rgba(255, 255, 255, 0.8);
}

/* ==============================================
   Loading Indicator
============================================== */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1001;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* ==============================================
   Audio Player
============================================== */
/* Audio container */
.audio-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}

/* Toggle button */
.audio-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.audio-toggle i {
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
}

.audio-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.audio-toggle:hover i {
    color: rgba(255, 255, 255, 0.8);
}

/* Audio panel */
.audio-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 300px;
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    display: none;
    box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

.audio-panel.active {
    display: block;
    animation: slideUp 0.3s ease;
}

/* Audio player controls */
.custom-audio-player {
    width: 100%;
    color: white;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 20px;
}

/* Play/Pause and Loop buttons */
.play-pause-btn, 
.loop-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.play-pause-btn:hover, 
.loop-btn:hover {
    opacity: 1;
}

.loop-btn.active {
    color: #E57373;
}

/* Time slider */
.time-slider {
    flex-grow: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

/* Audio source selector */
.audio-selector {
    width: 100%;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    margin-top: 8px;
}

.audio-selector option {
    background: #333;
    color: white;
}

/* ==============================================
   Animations
============================================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* ==============================================
   Media Queries
============================================== */
/* Mobile Styles */
@media screen and (max-width: 767px) {
    /* Header adjustments */
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .header-content > div:first-child {
        flex: 1 1 100%;
    }

    .logo {
        font-size: 1.1rem;
    }

    .feedback-button {
        margin-left: auto;
        margin-top: 0.5rem;
    }

    /* Prayer content adjustments */
    .prayer-content-overlay {
        padding-top: 6rem;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .prayer-content-overlay h2 {
        font-size: clamp(1.2rem, 2.25vw, 1.6rem);
    }

    .prayer-content-overlay .prayer-text {
        font-size: clamp(1.1rem, 2.5vw, 1.5rem);
        line-height: 1.3;
    }
}

/* Tablet Styles */
@media screen and (min-width: 768px) {
    .grid-container {
        margin: 2rem auto;
        padding: 0 2rem;
    }
    
    .card-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Desktop Styles */
@media screen and (min-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .prayer-content-overlay {
        padding-top: 4rem;
    }
    
    .prayer-content-overlay .prayer-text {
        font-size: clamp(1.7rem, 3.2vw, 2.3rem);
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

/* Small mobile screens (like iPhone) */
@media screen and (max-width: 428px) {
    .prayer-image {
        max-height: 40vh; /* Larger on phones */
    }
}

/* Larger screens */
@media screen and (min-width: 1024px) {
    .prayer-image {
        max-height: 50vh; /* Larger on desktop */
    }
}