/* Base styles for the entire application */
:root {
    --primary-color: #3b82f6;
    --primary-light: #93c5fd;
    --primary-dark: #1d4ed8;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --light-color: #f8fafc;
    --dark-color: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --background-color: #f1f5f9;
    --card-background: rgba(255, 255, 255, 0.8);
    --joyful-color: #22c55e;
    --sorrowful-color: #ef4444;
    --glorious-color: #eab308;
    --luminous-color: #3b82f6;
    --font-primary: 'Bricolage Grotesque', sans-serif;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: var(--font-primary);
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    background-image: linear-gradient(to bottom right, #f0f9ff, #dbeafe, #ede9fe);
    background-attachment: fixed;
    overflow-x: hidden;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.backdrop-blur {
    position: relative;
}

.backdrop-blur::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 300px;
    opacity: 0.3;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.5);
}

header h1 {
    font-size: 2.2rem;
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 2rem;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.5);
}

/* Button styles */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.btn:hover::after {
    transform: translateY(0);
}

.btn:active {
    transform: translateY(0);
}

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

.nav-btn {
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
    min-width: 120px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

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

/* Language selector styles */
.language-selector {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.language-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
}

.language-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--box-shadow);
}

/* Home page specific styles */
.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
}

.welcome-text {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--card-background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255,255,255,0.7);
    max-width: 800px;
    width: 100%;
}

.welcome-text h2 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.welcome-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.mystery-selection {
    width: 100%;
    max-width: 800px;
    margin-bottom: 2rem;
}

.mystery-selection h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    font-weight: 600;
}

.mystery-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    width: 100%;
}

.mystery-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    height: 120px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.mystery-btn.recommended {
    border: 2px solid rgba(255, 215, 0, 0.7);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    animation: pulse 2s infinite alternate;
    overflow: visible !important;
}

@keyframes pulse {
    0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
    100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
}

.mystery-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 0;
}

.mystery-btn:hover:before {
    transform: translateY(0);
}

.mystery-btn .mystery-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    z-index: 1;
}

.mystery-btn .mystery-day {
    font-size: 0.9rem;
    opacity: 0.9;
    z-index: 1;
}

.mystery-btn.joyful {
    background-color: rgba(34, 197, 94, 0.85);
}

.mystery-btn.sorrowful {
    background-color: rgba(239, 68, 68, 0.85);
}

.mystery-btn.glorious {
    background-color: rgba(234, 179, 8, 0.85);
    color: var(--dark-color);
}

.mystery-btn.luminous {
    background-color: rgba(59, 130, 246, 0.85);
}

.today-mystery {
    width: 100%;
    max-width: 800px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.mystery-btn.today {
    background-color: linear-gradient(45deg, 
        var(--joyful-color), 
        var(--sorrowful-color), 
        var(--glorious-color), 
        var(--luminous-color));
    background-image: linear-gradient(45deg, 
        var(--joyful-color), 
        var(--sorrowful-color), 
        var(--glorious-color), 
        var(--luminous-color));
    color: white;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 350px;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mystery-btn.today:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.additional-options {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 2rem;
}

.recommended-label {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 215, 0, 0.9);
    color: #000;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    white-space: nowrap;
    z-index: 10;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Fullscreen mode */
.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Rosary page styles */
.rosary-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    position: relative;
    margin: 1rem 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.7);
}

.progress-bar {
    height: 6px;
    background-color: rgba(255,255,255,0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

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

.mystery-indicator {
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.exit-fullscreen {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.5);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
    transition: var(--transition);
}

.exit-fullscreen:hover {
    background: rgba(255,255,255,0.8);
}

/* Prayer container improvements to prevent text overflow */
.prayer-container {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.prayer-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.prayer-text {
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    padding: 0 1rem;
}

/* Compact mode toggle button */
.view-mode-toggle {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: var(--transition);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 5;
}

.view-mode-toggle:hover {
    background: rgba(255,255,255,0.8);
}

.view-mode-toggle .toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.view-mode-toggle .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.view-mode-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.view-mode-toggle .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.view-mode-toggle input:checked + .slider {
    background-color: var(--primary-color);
}

.view-mode-toggle input:checked + .slider:before {
    transform: translateX(16px);
}

/* Compact mode styles */
.prayer-container.compact-mode .prayer-text {
    display: none;
}

.prayer-container.compact-mode .prayer-title {
    margin-bottom: 0;
}

.prayer-container.compact-mode .prayer-title {
    margin-bottom: 0;
}

.prayer-container.compact-mode .prayer-title {
    margin-bottom: 0;
}

.navigation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.bead-indicator {
    background-color: rgba(255,255,255,0.5);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Mystery theme styles */
.joyful-theme {
    border-left: 4px solid var(--joyful-color);
}

.sorrowful-theme {
    border-left: 4px solid var(--sorrowful-color);
}

.glorious-theme {
    border-left: 4px solid var(--glorious-color);
}

.luminous-theme {
    border-left: 4px solid var(--luminous-color);
}

/* Mysteries content */
.mysteries-container {
    background-color: rgba(255,255,255,0.9);
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.7);
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

.mystery-title {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.mystery-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    overflow-wrap: break-word;
    word-wrap: break-word;
    padding: 0 1rem;
}

/* Litanies styles */
.litanies-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    position: relative;
    margin: 1rem 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.7);
}

.instructions {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background-color: rgba(255,255,255,0.5);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255,255,255,0.3);
}

.litany-content {
    text-align: center;
    margin-bottom: 2rem;
}

#current-litany {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
    font-weight: 600;
}

.response {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--accent-color);
    margin: 1rem 0;
}

.litany-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.litany-counter {
    background-color: rgba(255,255,255,0.5);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.exit-fullscreen-litany {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.5);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
    transition: var(--transition);
}

.exit-fullscreen-litany:hover {
    background: rgba(255,255,255,0.8);
}

.return-btn {
    margin-top: 1rem;
    width: 100%;
    max-width: 300px;
}

.litany-actions {
    display: flex;
    justify-content: center;
}

/* Fullscreen prayer mode */
.fullscreen-prayer, .fullscreen-litany {
    background-color: var(--background-color);
    background-image: linear-gradient(to bottom right, #f0f9ff, #dbeafe, #ede9fe);
    padding: 2rem;
    position: relative;
    overflow-y: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    html, body {
        font-size: 16px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .btn {
        font-size: 1rem;
        padding: 0.7rem 1.2rem;
    }
    
    .mystery-buttons {
        grid-template-columns: 1fr;
        max-width: 350px;
        margin: 0 auto;
    }
    
    .welcome-text h2 {
        font-size: 1.6rem;
    }
    
    .welcome-text p {
        font-size: 1rem;
    }
    
    .fullscreen-prayer, .fullscreen-litany {
        padding: 1rem;
    }
    
    .rosary-container, .litanies-container {
        padding: 1rem;
        overflow: hidden;
    }
    
    .prayer-title, #current-litany {
        font-size: 1.4rem;
    }
    
    .prayer-text, .response {
        font-size: 1.1rem;
        padding: 0;
    }
    
    .view-mode-toggle {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    html, body {
        font-size: 14px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0;
    }
    
    .nav-btn {
        min-width: 100px;
        padding: 0.6rem 1rem;
    }
    
    .navigation-controls, .litany-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .navigation-controls .nav-btn, .litany-navigation .nav-btn {
        width: 100%;
    }
    
    .bead-indicator, .litany-counter {
        margin: 0.5rem 0;
    }
    
    .prayer-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .exit-fullscreen {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .view-mode-toggle {
        font-size: 0.7rem;
    }
}