/* agent.css - Agent chat interface styles */

body {
    background: #f0f2f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

.agent-container {
    max-width: 1200px;
    margin: 2rem auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.chat-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 700px;
}

.chat-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #1f82a0 0%, #92d4f0 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #ddd;
}

.chat-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.chat-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.95;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f9f9f9;
}

.message {
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

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

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

.message-user .message-content {
    background: linear-gradient(135deg, rgba(2, 88, 88, 0.85) 0%, rgba(1, 146, 172, 0.9) 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
}

.message-agent {
    display: flex;
    justify-content: flex-start;
}

.message-agent .message-content {
    background: linear-gradient(135deg, rgb(77, 187, 187) 0%, rgba(148, 235, 250, 0.9) 100%);
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.25rem;
    padding: 0 1rem;
}

.input-area {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    background: white;
    border-radius: 0 0 12px 12px;
}

.input-group {
    display: flex;
    gap: 0.75rem;
}

.input-group input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: #295f79;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group button {
    padding: 0.75rem 1.5rem;
    background: #295f79;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.input-group button:hover:not(:disabled) {
    background: #295f79;
    transform: translateY(-2px);
}

.input-group button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.info-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 2rem;
    overflow-y: auto;
}

.info-section {
    margin-bottom: 2rem;
}

.info-section h3 {
    color: #295f79;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sample-queries {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sample-query {
    padding: 0.75rem 1rem;
    background: #f0f0f0;
    border-left: 3px solid #295f79;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.sample-query:hover {
    background: #e0e0f0;
    transform: translateX(5px);
}

.metadata {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #666;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.metadata-label {
    font-weight: 600;
}

/* Status indicator */
.status-online {
    color: #4CAF50;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #295f79;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Image Upload Styles */
.drop-zone {
    border: 2px dashed #295f79;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    margin-bottom: 1rem;
    transition: all 0.3s;
    cursor: pointer;
}

.drop-zone:hover {
    background: #e8f4f8;
    border-color: #1f82a0;
}

.drop-zone.drag-over {
    background: #d4e9f2;
    border-color: #1f82a0;
    transform: scale(1.02);
}

.drop-zone i {
    font-size: 2rem;
    color: #295f79;
    margin-bottom: 0.5rem;
}

.drop-zone p {
    margin: 0.5rem 0;
    color: #666;
}

.drop-hint {
    font-size: 0.85rem;
    color: #999;
}

.image-upload-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 8px;
    border: 2px solid #4CAF50;
}

.image-preview-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.image-preview-container img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.remove-image-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.upload-hint {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #2e7d32;
    font-weight: 600;
}

#imageBtn {
    background: #1f82a0;
    padding: 0.75rem 1rem;
}

#imageBtn:hover {
    background: #1565c0;
}

.visual-search-hint {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left-color: #1f82a0;
}

/* Gallery display for visual search results */
.artwork-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.artwork-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.artwork-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.artwork-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.artwork-info {
    padding: 0.75rem;
}

.artwork-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #333;
}

.artwork-artist {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.artwork-price {
    font-size: 0.9rem;
    color: #4CAF50;
    font-weight: 600;
}

.artwork-score {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.25rem;
}

.search-results-header {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #4CAF50;
}

.search-results-header h4 {
    margin: 0;
    color: #2e7d32;
    font-size: 1rem;
}

.gallery-message {
    width: min(100%, 820px);
}

.gallery-message .message-time {
    padding-left: 0;
}

@media (max-width: 768px) {
    .agent-container {
        grid-template-columns: 1fr;
    }

    .chat-panel, .info-panel {
        height: auto;
    }
    
    .artwork-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
