/* wisdom/public/assets/css/guru.css */
/* COMPLETE VERSION - UPDATED WITH MOBILE FIXES */

/* --- 1. INTRO / HERO CONTENT (Top of Chat) --- */
.centered-chat {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    align-items: center;      
    min-height: 100%;        
    padding-top: calc(5vh + 20px); 
    padding-bottom: 120px;   
    box-sizing: border-box;
}

#intro-content {
    text-align: center;
    padding: 0 1.5rem;       
    max-width: 500px;
    width: 100%;
    background-color: transparent;
    animation: fadeIn 0.8s ease-out;
}

.hero-brand-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;       
    font-weight: 600;        
    line-height: 1.15;
    color: #2c3e50;
    margin-bottom: 30px;     
    text-shadow: 0 1px 1px rgba(255,255,255,0.8); 
}

.guru-image-container {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}

.guru-hero-img {
    max-width: 240px;       
    width: 70%;              
    height: auto;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.15); 
    transition: transform 0.3s ease;
}

#initial-instruction p.instruction-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1.15rem;      
    font-weight: 400;        
    color: #555;
    margin: 0;
}

/* --- 2. CHAT HISTORY AREA --- */
#chat-history {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* --- 3. DIALOG BUBBLES --- */
.msg-row {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.msg-label {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msg-content {
    padding: 1rem;
    border-radius: 8px;
    line-height: 1.6;
    position: relative;
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    word-wrap: break-word; 
}

/* DU (Användaren) */
.msg-user {
    align-items: flex-end; 
}
.msg-user .msg-label {
    color: #888;
    margin-right: 4px;
}
.msg-user .msg-content {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px 8px 0 8px; 
    color: #333;
    max-width: 85%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* GURU */
.msg-guru {
    align-items: flex-start; 
}
.msg-guru .msg-label {
    color: #d4a017; 
    margin-left: 4px;
}

.msg-guru .msg-content {
    background-color: #fff;
    border-left: 3px solid #d4a017; 
    border-radius: 4px;
    max-width: 90%; 
    width: fit-content; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* --- 4. MARKDOWN STYLING (Inside Guru Response) --- */
.msg-content h3 {
    font-size: 1.1rem;
    color: #d4a017;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}
.msg-content p { margin-bottom: 0.8rem; }
.msg-content ul, .msg-content ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.msg-content li { margin-bottom: 0.3rem; }
.msg-content blockquote {
    border-left: 3px solid #e0dcd0;
    margin: 1rem 0;
    padding-left: 1rem;
    color: #666;
    font-style: italic;
    background: #fafafa;
    padding: 0.5rem 1rem;
}
.msg-content {
    padding: 1rem;
    border-radius: 8px;
    position: relative;
    word-wrap: break-word;

    /* READER FRIENDLY OPTIMIZATION */
    font-family: 'Lora', serif;
    font-size: 19px;           
    line-height: 1.65;         
    color: #2c3e50;            
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

/* --- 5. FIXED INPUT AREA (Bottom) --- */
#input-area-wrapper {
    background-color: #eaf4f8; 
    padding: 0.5rem;
    border-top: 1px solid #dcecf2;
    z-index: 95;
    width: 100%;
    
    /* NYTT: Lyft upp inmatningsfältet ovanför iPhones safe area */
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

/* Start View (Knappen) */
#initial-view {
    padding: 0.5rem;
    display: flex;
    justify-content: center;
}

.btn-hero-simple {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
    background-color: #2c2c2c;
    color: #d4a017 !important; 
    border: 1px solid #d4a017;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    max-width: 280px;
}

/* Form View (Input) */
.guru-form-clean {
    width: 100%;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.input-row {
    display: flex;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
    align-items: flex-end;
}

#guru-input {
    flex-grow: 1;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-family: 'Lora', serif;
    font-size: 1rem;
    resize: none;
    overflow-y: hidden;
    min-height: 45px;
    max-height: 120px; 
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

#guru-input:focus {
    outline: none;
    border-color: #d4a017;
}

#ask-btn {
    height: 45px;
    padding: 0 1.5rem;
    background-color: #2c2c2c;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- 6. UTILITY & ANIMATIONS --- */
.hidden-interface { display: none !important; }
.visible-interface { display: block !important; }

/* Loading Spinner (In Button) */
.spinner-btn {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulseText {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.meditating-pulse {
    display: inline-block;
    white-space: nowrap;       
    color: #d4a017;            
    font-family: 'Lora', serif;
    font-style: italic;
    font-weight: 600;
    padding: 0 5px;
    animation: pulseText 1.5s infinite ease-in-out;
}