/**
 * The Mourning Room - Modal Styles (v2.0)
 * Simplified and stabilized for reliability
 */

/* Modal Backdrop */
.mourning-room-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(246, 246, 246, 0.95);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Main Modal Container */
.mourning-room-container {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    box-sizing: border-box;
}

/* Close Button */
.mourning-room-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #666666;
    font-size: 20px;
    cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 300;
    padding: 5px;
    line-height: 1;
}

.mourning-room-close:hover {
    color: #333333;
}

/* Title */
.mourning-room-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 24px;
    color: #333333;
    text-align: center;
    margin: 0 0 20px 0;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Subtitle */
.mourning-room-subtitle {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #666666;
    text-align: center;
    margin: 0 0 20px 0;
    font-weight: 300;
    line-height: 1.4;
}

/* Pre-submit prompt */
.mourning-room-prompt {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #999999;
    text-align: center;
    margin: 0 0 15px 0;
    font-weight: 300;
    font-style: italic;
    line-height: 1.4;
}

/* Input Section */
.mourning-room-input-section {
    margin: 25px 0;
}

/* Name Input */
.mourning-room-name-input {
    width: 100%;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 2px;
    padding: 10px 15px;
    font-size: 14px;
    color: #333333;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 300;
    margin-bottom: 10px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mourning-room-name-input:focus {
    outline: none;
    border-color: #999999;
    box-shadow: inset 0 0 3px rgba(153, 153, 153, 0.2);
}

.mourning-room-name-input::placeholder {
    color: #aaaaaa;
    font-style: italic;
}

/* Message Input */
.mourning-room-input {
    width: 100%;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    padding: 15px 20px;
    font-size: 15px;
    color: #333333;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 300;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    resize: none;
    min-height: 60px;
    box-sizing: border-box;
}

.mourning-room-input:focus {
    outline: none;
    border-color: #999999;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mourning-room-input::placeholder {
    color: #999999;
    font-weight: 300;
}

/* Character Counter */
.mourning-room-counter {
    position: absolute;
    bottom: -25px;
    right: 10px;
    font-size: 11px;
    color: #aaaaaa;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 300;
}

.mourning-room-counter.warning {
    color: #cc9900;
}

.mourning-room-counter.danger {
    color: #cc3333;
}

/* Submit Button */
.mourning-room-submit {
    display: block;
    width: 100%;
    background: #e8e8e8;
    border: 1px solid #cccccc;
    border-radius: 2px;
    padding: 12px 25px;
    font-size: 14px;
    color: #555555;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mourning-room-submit:hover {
    background: #dddddd;
    border-color: #bbbbbb;
}

.mourning-room-submit:disabled {
    background: #f5f5f5;
    color: #aaaaaa;
    cursor: not-allowed;
}

/* Error Message */
.mourning-room-error {
    display: none;
    background: #ffe6e6;
    border: 1px solid #ffcccc;
    border-radius: 2px;
    padding: 10px 15px;
    margin: 15px 0;
    font-size: 13px;
    color: #cc3333;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 300;
}

/* Quote Section */
.mourning-room-quote {
    margin: 30px 0 0 0;
    padding: 20px 0;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.mourning-room-quote.show {
    opacity: 1;
}

.mourning-room-quote-text {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #777777;
    font-weight: 300;
    font-style: italic;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.mourning-room-quote-label {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: #aaaaaa;
    font-weight: 300;
    text-transform: lowercase;
}

/* Shared Emotional Space */
.mourning-room-shared-space {
    display: none;
    margin-top: 30px;
    padding: 30px 0;
    text-align: center;
}

/* User's submitted message */
.mourning-room-user-message {
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 1.0s ease;
}

.mourning-room-user-message.show {
    opacity: 1;
    transform: translateY(0);
}

.mourning-room-user-label {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #aaaaaa;
    font-weight: 300;
    margin-bottom: 8px;
}

.mourning-room-user-text {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: #888888;
    font-weight: 300;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 8px;
}

.mourning-room-user-footer {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: #bbbbbb;
    font-weight: 300;
}

/* Lyric line */
.mourning-room-lyric-line {
    margin: 25px 0 35px 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    color: #777777;
    font-weight: 300;
    font-style: italic;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(10px);
    transition: all 1.2s ease;
}

.mourning-room-lyric-line.show {
    opacity: 1;
    transform: translateY(0);
}

/* Artist lyric styling (Maggie Lindemann) */
.mourning-room-lyric-line.has-artist {
    text-align: center;
}

.lyric-text.artist-lyric {
    color: #8B7D6B; /* Warmer, more golden tone to distinguish from regular submissions */
    font-size: 17px;
    font-weight: 400;
    margin-bottom: 8px;
    line-height: 1.5;
}

.lyric-attribution {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #A0967D; /* Slightly lighter version of the lyric color */
    font-weight: 300;
    font-style: normal;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* Echoes from others */
.mourning-room-echoes {
    margin-top: 40px;
    opacity: 0;
    transform: translateY(15px);
    transition: all 1.0s ease;
}

.mourning-room-echoes.show {
    opacity: 1;
    transform: translateY(0);
}

.mourning-room-echoes-label {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #999999;
    font-weight: 300;
    margin-bottom: 20px;
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

.mourning-room-echo-item {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: rgba(136, 136, 136, 0.7);
    font-weight: 300;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.8s ease;
}

.mourning-room-echo-item.show {
    opacity: 1;
    transform: translateY(0);
}

.mourning-room-echo-item:last-child {
    margin-bottom: 0;
}

/* Cycling echo items have smoother, longer transitions */
.mourning-room-echo-item.cycling {
    transition: opacity 1.2s ease-in-out, transform 1.2s ease-in-out;
    min-height: 20px; /* Prevent layout shift during transitions */
}

.mourning-room-echo-item.cycling.show {
    opacity: 0.8;
    transform: translateY(0);
}

/* Echo message and attribution styling */
.echo-message {
    margin-bottom: 5px;
    line-height: 1.5;
}

.echo-attribution {
    font-size: 11px;
    color: rgba(136, 136, 136, 0.5);
    font-style: normal;
    text-align: right;
    margin-top: 3px;
}

/* Match top lyric attribution styling exactly */
.mourning-room-echo-item .echo-attribution.artist-attribution,
.echo-attribution.artist-attribution {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    font-size: 13px !important; /* Match top lyric attribution size */
    color: #E8B4A0 !important; /* Warm rose gold */
    font-weight: 500 !important; /* Match top lyric attribution weight */
    font-style: italic !important;
    text-transform: lowercase !important;
    letter-spacing: 0.8px !important;
    margin-top: 8px !important; /* Match top lyric spacing */
    text-shadow: 0 0 10px rgba(232, 180, 160, 0.6) !important; /* Match top lyric glow */
    text-align: right !important; /* Keep right-aligned for echo attribution */
}

/* Clean styling for Maggie's messages in echo cycling - MATCH THE TOP LYRIC */
.mourning-room-echo-item.artist-message,
.mourning-room-echo-item[data-artist="true"] {
    /* Remove all extra visual elements to match the clean top lyric style */
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-align: center !important; /* Match the centered top lyric */
}

.mourning-room-echo-item.artist-message .echo-message,
.mourning-room-echo-item[data-artist="true"] .echo-message {
    color: #E8B4A0 !important; /* Warm rose gold - same as top lyric */
    font-family: Georgia, 'Times New Roman', serif !important; /* Match top lyric font */
    font-size: 16px !important; /* Match top lyric size */
    font-weight: 300 !important; /* Match top lyric weight */
    font-style: italic !important; /* Match top lyric style */
    line-height: 1.6 !important; /* Match top lyric line height */
    text-shadow: 0 0 12px rgba(232, 180, 160, 0.5) !important; /* Match top lyric glow */
    letter-spacing: normal !important;
    margin-bottom: 8px !important;
}

/* Artist lyric styling - ENHANCED WITH HIGHEST SPECIFICITY */
.mourning-room-lyric-line .lyric-text.artist-lyric,
.lyric-text.artist-lyric {
    color: #E8B4A0 !important; /* Warm rose gold */
    font-size: 18px !important;
    font-weight: 500 !important;
    margin-bottom: 10px !important;
    line-height: 1.5 !important;
    text-shadow: 0 0 12px rgba(232, 180, 160, 0.5) !important;
}

.mourning-room-lyric-line .lyric-attribution,
.lyric-attribution {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    font-size: 13px !important;
    color: #E8B4A0 !important; /* Warm rose gold */
    font-weight: 500 !important;
    font-style: italic !important;
    text-transform: lowercase !important;
    letter-spacing: 0.8px !important;
    margin-top: 8px !important;
    text-shadow: 0 0 10px rgba(232, 180, 160, 0.6) !important;
}

/* Ensure all Maggie Lindemann attributions are consistently styled */
.echo-attribution[data-artist="true"],
.poetry-attribution[data-artist="true"],
.lyric-attribution[data-artist="true"],
.mourning-room-echo-item[data-artist="true"] .echo-attribution,
.poetry-line[data-artist="true"] .poetry-attribution,
.mourning-room-lyric-line[data-artist="true"] .lyric-attribution {
    color: #E8B4A0 !important;
    font-weight: 500 !important;
    text-shadow: 0 0 10px rgba(232, 180, 160, 0.6) !important;
    font-style: italic !important;
    text-transform: lowercase !important;
    letter-spacing: 0.8px !important;
}

/* Limbo message at bottom */
.mourning-room-limbo-message {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: rgba(170, 170, 170, 0.6);
    font-weight: 300;
    font-style: italic;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    text-align: center;
    pointer-events: none;
    max-width: 300px;
    line-height: 1.4;
}

.mourning-room-limbo-message.show {
    opacity: 1;
}

/* Enter Full Room Button */
.mourning-room-full-room-button {
    margin-top: 30px;
    text-align: center;
    opacity: 0;
    transform: translateY(15px);
    transition: all 1.5s ease;
}

.mourning-room-full-room-button.show {
    opacity: 1;
    transform: translateY(0);
}

.enter-full-room-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(136, 136, 136, 0.3);
    color: #888888;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 300;
    padding: 12px 24px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

.enter-full-room-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(136, 136, 136, 0.5);
    color: #999999;
    transform: translateY(-1px);
}

.full-room-hint {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 10px;
    color: #aaaaaa;
    font-weight: 300;
    font-style: italic;
    margin-top: 8px;
    opacity: 0.7;
}

/* Full Room Experience */
.mourning-room-full-experience {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #fafafa 0%, #f6f6f6 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

.mourning-room-full-experience.active {
    display: flex !important;
    opacity: 1 !important;
}

.full-room-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    font-size: 24px;
    color: rgba(136, 136, 136, 0.6);
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    transition: color 0.3s ease;
    z-index: 10;
}

.full-room-close:hover {
    color: rgba(136, 136, 136, 0.9);
}

/* Poetry Container */
.full-room-poetry-container {
    width: 100%;
    max-width: 800px;
    height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 40px 20px;
}

.poetry-line {
    margin: 20px 0;
    text-align: center;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 1.2s ease;
    padding: 0 40px;
    position: relative;
    z-index: 10;
}

.poetry-line.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.poetry-line.fade-out {
    opacity: 0;
    transform: translateY(-20px) scale(1.05);
    transition: all 0.8s ease;
}

.poetry-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    color: #777777;
    font-weight: 300;
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 8px;
}

.poetry-attribution {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: rgba(136, 136, 136, 0.6);
    font-weight: 300;
    font-style: normal;
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

.poetry-attribution.artist-attribution {
    color: #E8B4A0 !important; /* Warm rose gold */
    font-weight: 600 !important;
    text-shadow: 0 0 12px rgba(232, 180, 160, 0.6) !important;
    font-style: italic !important;
    text-transform: lowercase !important;
    letter-spacing: 0.8px !important;
    font-size: 13px !important;
}

/* Subtle full room poetry styling for Maggie - Elegant but not overpowering */
.poetry-line.artist-line {
    /* Remove dramatic styling, keep it simple like other messages */
}

.poetry-text.artist-poetry {
    color: #E8B4A0 !important; /* Warm rose gold */
    font-size: 18px !important; /* Same size as regular messages */
    font-weight: 500 !important; /* Slightly bolder but not too much */
    text-shadow: 0 0 8px rgba(232, 180, 160, 0.4) !important; /* Subtle glow */
}

/* Full Room Footer */
.full-room-footer {
    position: absolute;
    bottom: 40px;
    text-align: center;
    width: 100%;
}

.full-room-title {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    color: #666666;
    font-weight: 300;
    margin-bottom: 5px;
}

.full-room-subtitle {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: #aaaaaa;
    font-weight: 300;
    font-style: italic;
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .mourning-room-container {
        padding: 30px 20px;
        margin: 20px;
        max-width: none;
    }
    
    .mourning-room-title {
        font-size: 20px;
    }
    
    .mourning-room-input {
        padding: 12px 15px;
    }
    
    .mourning-room-submit {
        padding: 12px 20px;
    }
    
    .mourning-room-limbo-message {
        bottom: 15px;
        font-size: 10px;
        max-width: 250px;
    }
    
    /* MOBILE FULL ROOM EXPERIENCE - FIXED LAYOUT */
    .mourning-room-full-experience {
        /* Add safe area padding for mobile browsers */
        padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Allow scrolling if content is too tall */
        justify-content: flex-start;
        align-items: center;
        padding-top: 40px;
        padding-bottom: 80px; /* Extra space at bottom */
    }
    
    .full-room-close {
        top: 15px;
        right: 15px;
        font-size: 24px;
        padding: 8px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }
    
    .full-room-poetry-container {
        max-width: 90%;
        padding: 20px;
        height: auto; /* Let content determine height */
        min-height: 60vh; /* Ensure some minimum space for content */
        max-height: none; /* Remove height restriction */
        overflow: visible; /* Allow content to flow naturally */
        margin-bottom: 20px; /* Space before footer */
    }
    
    .poetry-text {
        font-size: 16px;
        line-height: 1.5;
    }
    
    .poetry-text.artist-poetry {
        font-size: 16px;
    }
    
    .poetry-line {
        padding: 0 15px;
        margin: 12px 0;
    }
    
    /* MOBILE FOOTER - POSITIONED AT BOTTOM BUT VISIBLE */
    .full-room-footer {
        position: absolute;
        bottom: 20px; /* Lower to bottom but not cut off */
        left: 0;
        right: 0;
        padding: 15px 20px;
        width: 100%;
        text-align: center;
        /* Ensure it's always visible with safe area */
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
    
    .full-room-title {
        font-size: 15px;
        margin-bottom: 8px;
        color: #777777;
    }
    
    .full-room-subtitle {
        font-size: 11px;
        color: #aaaaaa;
        line-height: 1.4;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .mourning-room-full-experience {
        padding: 15px;
        padding-top: 30px;
        padding-bottom: 60px;
    }
    
    .full-room-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .full-room-poetry-container {
        padding: 15px;
        max-width: 95%;
        min-height: 50vh;
    }
    
    .poetry-text {
        font-size: 15px;
    }
    
    .poetry-text.artist-poetry {
        font-size: 15px;
    }
    
    .poetry-line {
        padding: 0 10px;
        margin: 10px 0;
    }
    
    .full-room-footer {
        bottom: 15px; /* Even closer to bottom on small screens */
        padding: 12px 15px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    
    .full-room-title {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .full-room-subtitle {
        font-size: 10px;
    }
} 