/* AI Maps Assistant Styles */

* {
    box-sizing: border-box;
}

.ama-app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
}

/* Loading & Error States */
.ama-loading-container,
.ama-error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.ama-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.ama-error-container {
    color: #ef4444;
}

/* Map Panel */
.ama-map-panel {
    position: relative;
    overflow: hidden;
}

.ama-map-loading,
.ama-map-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f9fafb;
}

/* Resize Handle */
.ama-resize-handle {
    height: 8px;
    background: #e5e7eb;
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.ama-resize-handle:hover {
    background: #d1d5db;
}

.ama-resize-handle-bar {
    width: 40px;
    height: 4px;
    background: #9ca3af;
    border-radius: 2px;
}

/* Chat Panel */
.ama-chat-panel {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.ama-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ama-chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

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

.ama-session-title {
    font-size: 14px;
    color: #6b7280;
}

/* Messages */
.ama-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ama-welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.ama-welcome-message h4 {
    color: #111827;
    margin-bottom: 10px;
}

.ama-welcome-message p {
    color: #6b7280;
    margin-bottom: 20px;
}

.ama-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

.ama-suggestions button {
    padding: 12px 16px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.ama-suggestions button:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.ama-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    gap: 8px;
}

.ama-message-user {
    align-self: flex-end;
}

.ama-message-assistant {
    align-self: flex-start;
}

.ama-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
}

.ama-message-user .ama-message-content {
    background: #3B82F6;
    color: white;
    border-bottom-right-radius: 4px;
}

.ama-message-assistant .ama-message-content {
    background: #f3f4f6;
    color: #111827;
    border-bottom-left-radius: 4px;
}

.ama-message-time {
    font-size: 11px;
    color: #9ca3af;
    padding: 0 16px;
}

/* Function Results */
.ama-function-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 16px;
}

.ama-function-result {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.ama-function-result.success {
    background: #d1fae5;
    color: #065f46;
}

.ama-function-result.error {
    background: #fee2e2;
    color: #991b1b;
}

.ama-function-icon {
    font-weight: bold;
}

/* Typing Indicator */
.ama-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.ama-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.4s infinite;
}

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

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

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

/* Chat Input */
.ama-chat-input {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.ama-chat-input textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    min-height: 44px;
    max-height: 120px;
}

.ama-chat-input textarea:focus {
    outline: none;
    border-color: #3B82F6;
}

.ama-send-button {
    padding: 12px 20px;
    background: #3B82F6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    transition: background 0.2s;
}

.ama-send-button:hover:not(:disabled) {
    background: #2563eb;
}

.ama-send-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Pin Info Window */
.ama-pin-info-window {
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    max-width: 250px;
}

.ama-pin-info-window h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #111827;
}

.ama-pin-info-window p {
    margin: 4px 0;
    font-size: 12px;
    color: #6b7280;
}

.ama-pin-info-window .notes {
    font-style: italic;
}
