/* Lorem Chat Widget - Frontend Styles */

.lcw-chat-widget {
    max-width: 800px;
    margin: 30px auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.lcw-response-area {
    padding: 20px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    position: relative;
    background: #f8f9fa;
}

.lcw-response-area > * {
    position: relative;
    z-index: 2;
}

.lcw-welcome-message {
    text-align: center;
    padding: 60px 20px;
}

.lcw-welcome-message h2 {
    margin: 0 0 15px 0;
    font-size: 32px;
    font-weight: 600;
}

.lcw-welcome-message p {
    margin: 0;
    font-size: 18px;
    opacity: 0.7;
}

/* Message blocks */
.lcw-message-block {
    margin-bottom: 20px;
    display: flex;
    animation: slideIn 0.3s ease-out;
}

.lcw-user-message {
    justify-content: flex-end;
}

.lcw-assistant-message {
    justify-content: flex-start;
}

.lcw-message-bubble {
    max-width: 75%;
    padding: 15px 20px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.lcw-user-bubble {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.lcw-assistant-bubble {
    background: white;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Response text styling */
.lcw-response-text {
    line-height: 1.8;
}

.lcw-response-text h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 15px 0;
    border-bottom: 2px solid currentColor;
    padding-bottom: 8px;
}

.lcw-response-text h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 20px 0 12px 0;
}

.lcw-response-text p {
    margin: 0 0 12px 0;
    text-align: justify;
}

.lcw-response-text ul {
    margin: 12px 0;
    padding-left: 25px;
}

.lcw-response-text li {
    margin: 6px 0;
    line-height: 1.6;
}

/* Typing indicator */
.lcw-typing-indicator {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lcw-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #90a4ae;
    animation: typing 1.4s infinite;
}

.lcw-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.lcw-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Message metadata */
.lcw-message-meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    gap: 10px;
    flex-wrap: wrap;
}

.lcw-meta-left {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    opacity: 0.7;
}

.lcw-meta-left span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lcw-meta-right {
    display: flex;
    gap: 8px;
}

.lcw-action-btn {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lcw-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.lcw-action-btn:active {
    transform: scale(0.95);
}

.lcw-action-btn.lcw-active {
    background: rgba(0, 123, 255, 0.1);
    border-color: #007bff;
}

.lcw-action-btn.lcw-copied {
    background: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
}

/* Text shadow styles for readability */
.lcw-text-style-shadow .lcw-response-text {
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.9),
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 30px rgba(255, 255, 255, 0.7),
        1px 1px 2px rgba(0, 0, 0, 0.3),
        -1px -1px 2px rgba(0, 0, 0, 0.3);
}

.lcw-text-style-shadow .lcw-response-text h2 {
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 1),
        0 0 25px rgba(255, 255, 255, 0.9),
        0 0 35px rgba(255, 255, 255, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.4),
        -2px -2px 4px rgba(0, 0, 0, 0.4);
}

.lcw-text-style-shadow .lcw-response-text h3 {
    text-shadow: 
        0 0 12px rgba(255, 255, 255, 1),
        0 0 22px rgba(255, 255, 255, 0.85),
        0 0 32px rgba(255, 255, 255, 0.75),
        1px 1px 3px rgba(0, 0, 0, 0.35),
        -1px -1px 3px rgba(0, 0, 0, 0.35);
}

.lcw-text-style-shadow .lcw-response-text li {
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.9),
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 30px rgba(255, 255, 255, 0.7),
        1px 1px 2px rgba(0, 0, 0, 0.3),
        -1px -1px 2px rgba(0, 0, 0, 0.3);
}

/* Style avec overlay (ancien style) */
.lcw-text-style-overlay .lcw-assistant-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1;
    border-radius: 18px;
}

.lcw-text-style-overlay .lcw-response-text,
.lcw-text-style-overlay .lcw-message-meta {
    position: relative;
    z-index: 2;
}

/* Style avec halo renforcé */
.lcw-text-style-strong-shadow .lcw-response-text {
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 1),
        0 0 25px rgba(255, 255, 255, 1),
        0 0 35px rgba(255, 255, 255, 0.9),
        0 0 45px rgba(255, 255, 255, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.5),
        -2px -2px 4px rgba(0, 0, 0, 0.5),
        3px 3px 6px rgba(0, 0, 0, 0.4),
        -3px -3px 6px rgba(0, 0, 0, 0.4);
}

.lcw-text-style-strong-shadow .lcw-response-text h2 {
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 1),
        0 0 30px rgba(255, 255, 255, 1),
        0 0 40px rgba(255, 255, 255, 0.95),
        0 0 50px rgba(255, 255, 255, 0.9),
        3px 3px 6px rgba(0, 0, 0, 0.6),
        -3px -3px 6px rgba(0, 0, 0, 0.6),
        4px 4px 8px rgba(0, 0, 0, 0.5),
        -4px -4px 8px rgba(0, 0, 0, 0.5);
}

.lcw-text-style-strong-shadow .lcw-response-text h3 {
    text-shadow: 
        0 0 18px rgba(255, 255, 255, 1),
        0 0 28px rgba(255, 255, 255, 1),
        0 0 38px rgba(255, 255, 255, 0.95),
        0 0 48px rgba(255, 255, 255, 0.85),
        2px 2px 5px rgba(0, 0, 0, 0.55),
        -2px -2px 5px rgba(0, 0, 0, 0.55),
        3px 3px 7px rgba(0, 0, 0, 0.45),
        -3px -3px 7px rgba(0, 0, 0, 0.45);
}

.lcw-text-style-strong-shadow .lcw-response-text li {
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 1),
        0 0 25px rgba(255, 255, 255, 1),
        0 0 35px rgba(255, 255, 255, 0.9),
        0 0 45px rgba(255, 255, 255, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.5),
        -2px -2px 4px rgba(0, 0, 0, 0.5),
        3px 3px 6px rgba(0, 0, 0, 0.4),
        -3px -3px 6px rgba(0, 0, 0, 0.4);
}

/* Style minimaliste */
.lcw-text-style-minimal .lcw-response-text {
    text-shadow: 
        0 0 5px rgba(255, 255, 255, 0.8),
        1px 1px 2px rgba(0, 0, 0, 0.2),
        -1px -1px 2px rgba(0, 0, 0, 0.2);
}

.lcw-text-style-minimal .lcw-response-text h2 {
    text-shadow: 
        0 0 8px rgba(255, 255, 255, 0.9),
        1px 1px 3px rgba(0, 0, 0, 0.25),
        -1px -1px 3px rgba(0, 0, 0, 0.25);
}

.lcw-text-style-minimal .lcw-response-text h3 {
    text-shadow: 
        0 0 7px rgba(255, 255, 255, 0.85),
        1px 1px 2px rgba(0, 0, 0, 0.22),
        -1px -1px 2px rgba(0, 0, 0, 0.22);
}

.lcw-text-style-minimal .lcw-response-text li {
    text-shadow: 
        0 0 5px rgba(255, 255, 255, 0.8),
        1px 1px 2px rgba(0, 0, 0, 0.2),
        -1px -1px 2px rgba(0, 0, 0, 0.2);
}

.lcw-input-area {
    display: flex;
    padding: 20px;
    background: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    gap: 10px;
}

.lcw-question-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.lcw-question-input:focus {
    border-color: rgba(0, 123, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.lcw-send-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: white;
}

.lcw-send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.lcw-send-button:active {
    transform: scale(0.95);
}

.lcw-send-button svg {
    transition: transform 0.3s ease;
}

.lcw-send-button:hover svg {
    transform: translateX(2px);
}

.lcw-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.lcw-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .lcw-chat-widget {
        margin: 15px;
        border-radius: 8px;
    }
    
    .lcw-response-area {
        padding: 15px;
        max-height: 400px;
    }
    
    .lcw-welcome-message {
        padding: 40px 15px;
    }
    
    .lcw-welcome-message h2 {
        font-size: 24px;
    }
    
    .lcw-welcome-message p {
        font-size: 16px;
    }
    
    .lcw-message-bubble {
        max-width: 85%;
        padding: 12px 16px;
    }
    
    .lcw-response-text h2 {
        font-size: 20px;
    }
    
    .lcw-response-text h3 {
        font-size: 18px;
    }
    
    .lcw-input-area {
        padding: 15px;
    }
    
    .lcw-question-input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .lcw-send-button {
        width: 45px;
        height: 45px;
    }
    
    .lcw-message-meta {
        font-size: 11px;
    }
    
    .lcw-meta-left,
    .lcw-meta-right {
        width: 100%;
    }
    
    .lcw-action-btn {
        padding: 5px 8px;
        font-size: 14px;
    }
}

/* Scrollbar personnalisé */
.lcw-response-area::-webkit-scrollbar {
    width: 8px;
}

.lcw-response-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.lcw-response-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.lcw-response-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.lcw-input-area {
    display: flex;
    padding: 20px;
    background: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    gap: 10px;
}

.lcw-question-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.lcw-question-input:focus {
    border-color: rgba(0, 123, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.lcw-send-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: white;
}

.lcw-send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.lcw-send-button:active {
    transform: scale(0.95);
}

.lcw-send-button svg {
    transition: transform 0.3s ease;
}

.lcw-send-button:hover svg {
    transform: translateX(2px);
}

.lcw-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.lcw-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    .lcw-chat-widget {
        margin: 15px;
        border-radius: 8px;
    }
    
    .lcw-response-area {
        padding: 20px;
        max-height: 400px;
    }
    
    .lcw-welcome-message {
        padding: 40px 15px;
    }
    
    .lcw-welcome-message h2 {
        font-size: 24px;
    }
    
    .lcw-welcome-message p {
        font-size: 16px;
    }
    
    .lcw-response-content h2 {
        font-size: 22px;
    }
    
    .lcw-response-content h3 {
        font-size: 18px;
    }
    
    .lcw-input-area {
        padding: 15px;
    }
    
    .lcw-question-input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .lcw-send-button {
        width: 45px;
        height: 45px;
    }
}

/* Scrollbar personnalisé */
.lcw-response-area::-webkit-scrollbar {
    width: 8px;
}

.lcw-response-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.lcw-response-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.lcw-response-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}
