/* Chat Complaint Interface Styles */

.chat-container {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 20px;
    max-width: 1400px;
    margin: 30px auto;
    padding: 20px;
    height: calc(100vh - 200px);
    min-height: 600px;
}

/* Chat Panel */
.chat-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
}

.chat-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    margin-bottom: 16px;
    animation: messageSlide 0.3s ease-out;
}

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

.message.bot {
    justify-content: flex-start;
}

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

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

.message.bot .message-bubble {
    background: white;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}

/* Tag Chips */
.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f0f2f5;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.tag-chip:hover {
    background: #e8eaf0;
    border-color: #667eea;
    transform: translateY(-1px);
}

.tag-chip.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tag-chip .check-icon {
    margin-left: 8px;
    font-size: 12px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    border: 1px solid #e0e0e0;
    width: fit-content;
}

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

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

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

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

/* Chat Input */
.chat-input-container {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 12px;
}

.chat-input-container input[type="file"] {
    display: none;
}

.attach-btn {
    background: #f0f2f5;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.attach-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

.message-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.message-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Map Panel */
.map-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.map-panel-header {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.map-panel-header h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #333;
}

.map-panel-header p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.map-container {
    flex: 1;
    position: relative;
    min-height: 400px;
}

#chatMap {
    width: 100%;
    height: 100%;
}

.location-status {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    z-index: 1000;
    display: none;
}

.location-status.active {
    display: block;
}

.location-status.error {
    background: #f8d7da;
    color: #721c24;
}

.location-status.success {
    background: #d4edda;
    color: #155724;
}

/* Action Buttons in Map */
.map-actions {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
}

.map-action-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.map-action-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.map-action-btn svg {
    width: 16px;
    height: 16px;
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .chat-container {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
    }

    .map-panel {
        order: -1;
        height: 300px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .chat-panel {
        height: calc(100vh - 380px);
        min-height: 500px;
    }

    .message-bubble {
        max-width: 85%;
    }
}

@media (max-width: 640px) {
    .chat-container {
        padding: 10px;
        margin: 10px auto;
    }

    .chat-header {
        padding: 15px;
    }

    .chat-header h2 {
        font-size: 20px;
    }

    .chat-messages {
        padding: 15px;
    }

    .chat-input-container {
        padding: 12px 15px;
        gap: 8px;
    }

    .attach-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .send-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .message-input {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Photo Preview in Chat */
.photo-message {
    margin-top: 8px;
}

.photo-message img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.message.user .photo-message img {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Review Summary */
.review-summary {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.review-summary h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
}

.review-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.review-item:last-child {
    border-bottom: none;
}

.review-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.review-value {
    color: #333;
    font-size: 14px;
    text-align: right;
    max-width: 60%;
}

/* Success Animation */
.success-message {
    text-align: center;
    padding: 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: successPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.success-icon svg {
    width: 48px;
    height: 48px;
    stroke: white;
    stroke-width: 3;
}

.complaint-number {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin: 12px 0;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}
