/* static/css/base.css - Base styles and layout */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden;
    overscroll-behavior: none;
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    overscroll-behavior: none;
}

/* Text selection rules */
.message,
.chat-input,
.debug-content,
.agent-info,
.routing-info,
.message div,
p,
span,
strong,
i,
b,
em {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.example-query,
.send-button,
.chat-header,
.version-badge,
.session-info,
.confidence-indicator,
.action-btn,
.submit-btn,
.choice-button,
.image-upload-button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Main container */
.chat-container {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: none;
    position: relative;
}

/* Header */
.chat-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    position: relative;
}

.version-badge {
    position: absolute;
    top: 10px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: normal;
}

.session-info {
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.8);
}

/* Loading indicator */
.loading {
    display: none;
    text-align: center;
    margin: 10px 0;
    color: #6c757d;
}

.loading.show {
    display: block;
}

/* Image upload styles */
.image-upload-button {
    padding: 15px;
    background: linear-gradient(45deg, #28a745, #218838);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.image-upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.image-upload-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.file-input {
    display: none;
}

.image-preview {
    max-width: 200px;
    max-height: 200px;
    margin: 10px 0;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.image-container {
    position: relative;
    display: inline-block;
    margin: 10px 0;
}

.remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-weight: bold;
}

.attached-indicator {
    display: none;
    padding: 5px 10px;
    background: #28a745;
    color: white;
    border-radius: 15px;
    font-size: 0.8em;
    margin-left: 10px;
}

.attached-indicator.show {
    display: inline-block;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animations */
@keyframes typing {

    0%,
    60%,
    100% {
        opacity: 0.3;
    }

    30% {
        opacity: 1;
    }
}

.typing-dots span {
    animation: typing 1.4s infinite;
    animation-fill-mode: both;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes bounce {

    0%,
    20%,
    53%,
    80%,
    100% {
        transform: translateY(0);
    }

    40%,
    43% {
        transform: translateY(-8px);
    }

    70% {
        transform: translateY(-4px);
    }

    90% {
        transform: translateY(-2px);
    }
}