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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #faf8f3 0%, #f5f1e8 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

.background-image {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    height: auto;
    max-height: 80vh;
    opacity: 1;
    z-index: 0;
    pointer-events: none;
}

.background-image.left {
    left: 1vw;
    width: 20vw;
    max-width: 350px;
}

.background-image.right {
    right: 1vw;
    width: 26vw;
    max-width: 450px;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 900px;
    width: 100%;
    height: 90vh;
    max-height: 800px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

header {
    background: linear-gradient(135deg, #87ceeb 0%, #5dade2 100%);
    color: white;
    padding: 15px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
}

header h1 {
    font-size: 1.5em;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-direction: column;
}

.crucifix-icon {
    height: 70px;
    width: auto;
    max-width: 70px;
    max-height: 70px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    display: block;
}

.scapular-icon {
    height: 120px;
    width: auto;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.header-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.back-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
}

.mystery-display {
    font-size: 1.2em;
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 10px;
}

.language-selector {
    display: inline-block;
}

.language-dropdown {
    padding: 6px 12px;
    font-size: 0.9em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.language-dropdown:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.language-dropdown option {
    background: #2d3748;
    color: white;
}

main {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Mystery Selection Styles */
.mystery-selection-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

@media (max-width: 768px) {
    .mystery-selection-main {
        justify-content: flex-start;
        padding-top: 10px;
    }
}

.selection-title {
    font-size: 1.3em;
    color: #2d3748;
    text-align: center;
    margin-bottom: 5px;
}

.litany-option {
    width: 100%;
    max-width: 500px;
    padding: 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85em;
    color: #2d3748;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

.checkbox-label span {
    user-select: none;
}

.mystery-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}

.mystery-btn {
    padding: 12px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.mystery-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.mystery-btn.joyful {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
}

.mystery-btn.sorrowful {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.mystery-btn.glorious {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.mystery-icon {
    font-size: 1.8em;
    margin-bottom: 4px;
}

.mystery-btn h3 {
    font-size: 1.1em;
    color: #2d3748;
    margin-bottom: 2px;
}

.mystery-btn p {
    font-size: 0.75em;
    color: #4a5568;
    font-style: italic;
}

/* Mystery of the Day Animation */
.mystery-btn.mystery-of-the-day {
    position: relative;
    overflow: hidden;
    animation: pulse-glow 2s ease-in-out infinite;
    box-shadow: 0 5px 25px rgba(255, 215, 0, 0.4);
}

.mystery-btn.mystery-of-the-day::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shine 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 5px 25px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 5px 35px rgba(255, 215, 0, 0.7);
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Mystery Image Styles */
.mystery-image-container {
    display: none;
    flex: 1;
    min-width: 0;
    min-height: 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.mystery-image-container img {
    width: 100%;
    height: 100%;
    max-height: 35vh;
    object-fit: contain;
    display: block;
    border-radius: 10px;
}

.prayer-current {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 30px;
    border-radius: 15px;
    border: 3px solid #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    margin-bottom: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.prayer-current.mystery-layout {
    flex-direction: row;
    align-items: center;
    gap: 30px;
}

.prayer-current.mystery-layout .prayer-title {
    flex: 1;
    font-size: 1.6em;
    margin-bottom: 0;
    text-align: left;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
    flex-shrink: 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-fill.joyful-progress {
    background: linear-gradient(90deg, #ffeaa7 0%, #fdcb6e 100%);
}

.progress-fill.sorrowful-progress {
    background: linear-gradient(90deg, #a29bfe 0%, #6c5ce7 100%);
}

.progress-fill.glorious-progress {
    background: linear-gradient(90deg, #74b9ff 0%, #0984e3 100%);
}

.prayer-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex-shrink: 0;
}

.prayer-preview-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prayer-preview {
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
    height: 80px;
    overflow: hidden;
}

.prayer-preview.previous {
    background: rgba(100, 100, 100, 0.1);
    border-left: 4px solid #cbd5e0;
}

.prayer-preview.next {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
}

.prayer-preview .label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #718096;
    font-weight: bold;
}

.prayer-preview .prayer-title {
    font-size: 1em;
    color: #2d3748;
    font-weight: 600;
}

.prayer-current .prayer-title {
    color: #2d3748;
    font-size: 1.8em;
    margin-bottom: 20px;
    text-align: center;
    flex-shrink: 0;
}

.prayer-current .prayer-text {
    font-size: 1.1em;
    line-height: 1.8;
    color: #4a5568;
    text-align: center;
    margin-bottom: 15px;
    white-space: pre-line;
    max-height: none;
    flex: 1;
    overflow-y: auto;
}

.bead-counter {
    text-align: center;
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
    margin-top: 15px;
}

.btn {
    padding: 15px 30px;
    font-size: 1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

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

/* Intentions Styles */
.intentions-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.intentions-header .intentions-default-btn {
    position: absolute;
    right: 0;
}

.intentions-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
}

.intentions-textarea {
    width: 100%;
    flex: 1;
    min-height: 300px;
    padding: 15px;
    font-family: 'Georgia', serif;
    font-size: 1em;
    line-height: 1.6;
    color: #2d3748;
    background: white;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.intentions-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.intentions-textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.intentions-default-btn {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3748;
    padding: 3px 8px;
    font-size: 0.55em;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 6px;
    width: auto;
}

.intentions-default-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(253, 203, 110, 0.4);
}

/* Completion Message Styles */
.completion-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.completion-text {
    font-size: 1.5em;
    color: #2d3748;
    font-weight: bold;
    text-align: center;
}

.rosary-count {
    font-size: 1.2em;
    color: #667eea;
    font-weight: 600;
    padding: 10px 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

#rosaryCountNumber {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 1.3em;
    font-weight: bold;
    color: #5a67d8;
}

.another-rosary-question {
    font-size: 1.1em;
    color: #4a5568;
    text-align: center;
    margin-top: 10px;
}

.completion-buttons {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 400px;
    margin-top: 10px;
}

.completion-buttons .btn {
    flex: 1;
}

@media (max-width: 768px) {
    .background-image.left {
        width: 15vw;
        min-width: 80px;
    }
    
    .background-image.right {
        width: 19vw;
        min-width: 100px;
    }
    
    .container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    header {
        padding: 15px;
        position: relative;
    }
    
    .back-btn {
        padding: 5px 10px;
        font-size: 0.75em;
    }
    
    header h1 {
        font-size: 1.3em;
        margin-bottom: 8px;
    }
    
    .header-title-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .crucifix-icon {
        height: 40px;
        max-width: 40px;
        object-fit: contain;
    }
    
    .scapular-icon {
        height: 35px;
    }
    
    .header-controls {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .mystery-display {
        font-size: 0.9em;
    }
    
    main {
        padding: 15px;
    }
    
    .selection-title {
        font-size: 1.2em;
    }
    
    .litany-option {
        max-width: 100%;
        padding: 8px;
    }
    
    .checkbox-label {
        font-size: 0.8em;
        gap: 8px;
    }
    
    .checkbox-label input[type="checkbox"] {
        width: 14px;
        height: 14px;
    }
    
    .mystery-options {
        max-width: 100%;
        gap: 10px;
    }
    
    .mystery-btn {
        padding: 12px;
    }
    
    .mystery-icon {
        font-size: 1.5em;
        margin-bottom: 3px;
    }
    
    .mystery-btn h3 {
        font-size: 1em;
        margin-bottom: 2px;
    }
    
    .mystery-btn p {
        font-size: 0.7em;
    }
    
    .mystery-image-container {
        max-width: 100%;
        margin: 15px auto;
    }
    
    .prayer-current.mystery-layout {
        flex-direction: column;
    }

    .prayer-current.mystery-layout .prayer-title {
        text-align: center;
        margin-bottom: 10px;
    }

    .mystery-image-container img {
        height: auto;
        max-height: 43.75vh;
    }
    
    .prayer-current {
        padding: 15px;
        margin-bottom: 15px;
        min-height: 180px;
    }
    
    .prayer-current .prayer-title {
        font-size: 1.1em;
        margin-bottom: 12px;
    }
    
    .prayer-current .prayer-text {
        font-size: 0.85em;
        line-height: 1.5;
        margin-bottom: 10px;
        white-space: pre-line;
    }
    
    .bead-counter {
        font-size: 1em;
        margin-top: 10px;
    }
    
    .progress-bar {
        margin-bottom: 15px;
        height: 6px;
    }
    
    .prayer-navigation {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .prayer-preview {
        padding: 8px;
        height: 50px;
        gap: 4px;
    }
    
    .prayer-preview .label {
        font-size: 0.6em;
    }
    
    .prayer-preview .prayer-title {
        font-size: 0.7em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .btn {
        padding: 8px 10px;
        font-size: 0.7em;
        letter-spacing: 0.3px;
    }
    
    .completion-message {
        padding: 15px;
        gap: 15px;
    }
    
    .completion-text {
        font-size: 1.2em;
    }
    
    .rosary-count {
        font-size: 1em;
        padding: 8px 15px;
    }
    
    .another-rosary-question {
        font-size: 0.95em;
    }
    
    .completion-buttons {
        flex-direction: column;
        max-width: 100%;
        gap: 10px;
    }
    
    .intentions-textarea {
        min-height: 200px;
        font-size: 0.85em;
        padding: 10px;
    }
    
    .intentions-default-btn {
        font-size: 0.5em;
        padding: 2px 6px;
    }
    
    .intentions-header {
        gap: 8px;
    }
}
