/**
 * Public styles for Leitor de Editais por IA
 */

/* Container */
.ldeia-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    line-height: 1.5;
}

.ldeia-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.ldeia-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

/* Main Layout */
.ldeia-main {
    display: flex;
    gap: 20px;
}

.ldeia-sidebar {
    flex: 0 0 300px;
}

.ldeia-chat-container {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 600px;
    overflow: hidden;
}

/* Sidebar Sections */
.ldeia-upload-section,
.ldeia-quick-questions,
.ldeia-export-options {
    background: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ldeia-upload-section h3,
.ldeia-quick-questions h3,
.ldeia-export-options h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

/* File Upload */
.ldeia-file-input {
    position: relative;
    margin-bottom: 15px;
}

.ldeia-file-input label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #f7f7f7;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.ldeia-file-input label:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.ldeia-file-input input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.ldeia-file-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm-1 1.5L18.5 9H13V3.5zM6 20V4h5v7h7v9H6z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 10px;
}

.ldeia-file-label {
    font-size: 14px;
}

.ldeia-file-info {
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    font-size: 14px;
}

.ldeia-file-name {
    font-weight: bold;
    margin-bottom: 5px;
    word-break: break-all;
}

.ldeia-upload-progress {
    margin-top: 15px;
}

.ldeia-progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.ldeia-progress-fill {
    height: 100%;
    background: #4CAF50;
    width: 0%;
    transition: width 0.3s;
}

.ldeia-progress-text {
    font-size: 12px;
    text-align: center;
    color: #666;
}

/* Buttons */
.ldeia-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
    text-decoration: none;
}

.ldeia-button:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.ldeia-primary-button {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.ldeia-primary-button:hover {
    background: #45a049;
    border-color: #45a049;
}

.ldeia-upload-actions {
    text-align: center;
}

/* Quick Questions */
.ldeia-quick-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.ldeia-quick-button {
    padding: 10px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 14px;
}

.ldeia-quick-button:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

/* Export Options */
.ldeia-export-buttons {
    display: flex;
    gap: 10px;
}

.ldeia-icon-text,
.ldeia-icon-doc {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

.ldeia-icon-text {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm-1 1.5L18.5 9H13V3.5zM6 20V4h5v7h7v9H6zm2-6h8v2H8v-2zm0-4h8v2H8v-2z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.ldeia-icon-doc {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm-1 1.5L18.5 9H13V3.5zM6 20V4h5v7h7v9H6zm2-6h8v2H8v-2zm0-4h8v2H8v-2z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

/* Chat Interface */
.ldeia-chat-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
}

.ldeia-chat-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.ldeia-document-info {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.ldeia-icon-doc {
    margin-right: 5px;
}

.ldeia-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
}

.ldeia-chat-welcome {
    text-align: center;
    padding: 30px 0;
}

.ldeia-welcome-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.ldeia-icon-chat {
    display: inline-block;
    width: 48px;
    height: 48px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234CAF50"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.2L4 17.2V4h16v12z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.ldeia-message {
    margin-bottom: 15px;
    display: flex;
}

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

.ldeia-ai-message {
    justify-content: flex-start;
}

.ldeia-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #4CAF50;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.ldeia-icon-bot {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFFFFF"><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.38-1 1.72V7h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H9a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2V5.72c-.6-.34-1-.98-1-1.72a2 2 0 0 1 2-2m3 13a1 1 0 0 0-1-1a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1m-4 0a1 1 0 0 0-1-1a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.ldeia-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.ldeia-user-message .ldeia-message-content {
    background: #4CAF50;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ldeia-ai-message .ldeia-message-content {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ldeia-typing-indicator {
    display: flex;
    align-items: center;
}

.ldeia-typing-indicator span {
    height: 8px;
    width: 8px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite both;
}

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

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

@keyframes typing {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

.ldeia-chat-input {
    padding: 15px;
    border-top: 1px solid #eee;
    background: #fff;
}

.ldeia-input-container {
    display: flex;
    position: relative;
}

.ldeia-input-container textarea {
    flex: 1;
    padding: 12px 40px 12px 15px;
    border: 1px solid #ddd;
    border-radius: 24px;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    font-family: inherit;
    font-size: 14px;
    background: #f9f9f9;
    transition: border-color 0.3s, background-color 0.3s;
}

.ldeia-input-container textarea:focus {
    outline: none;
    border-color: #4CAF50;
    background: #fff;
}

.ldeia-input-container button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.ldeia-input-container button:hover {
    background: rgba(76, 175, 80, 0.1);
}

.ldeia-icon-send {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234CAF50"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.ldeia-input-note {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    text-align: center;
}

/* Login Required / Access Denied */
.ldeia-login-required,
.ldeia-access-denied,
.ldeia-no-api-key {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.ldeia-login-message,
.ldeia-access-message,
.ldeia-api-message {
    max-width: 500px;
    margin: 0 auto;
}

.ldeia-login-button,
.ldeia-config-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
}

.ldeia-login-button:hover,
.ldeia-config-button:hover {
    background: #45a049;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .ldeia-main {
        flex-direction: column;
    }
    
    .ldeia-sidebar {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .ldeia-chat-container {
        height: 500px;
    }
    
    .ldeia-message-content {
        max-width: 85%;
    }
}
