/* RotSis ChatBot v2 - Custom Styles - Unified Interface */


/* Global Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --chat-bg: #f8f9fa;
    --message-user-bg: #0d6efd;
    --message-assistant-bg: #ffffff;
    --border-radius: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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


/* Navigation Enhancements */

.navbar-brand {
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    border-radius: 6px;
    margin: 0 2px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}


/* Layout Styles */

.col-md-5.col-lg-4 {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}


/* Chat Styles */

#chatMessages {
    background: var(--chat-bg);
}


/* Message Styles */

.message {
    display: flex;
    margin-bottom: 16px;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
    font-size: 14px;
}

.user-message .message-avatar {
    background: var(--primary-color);
    color: white;
    order: 2;
    margin-right: 0;
    margin-left: 10px;
}

.assistant-message .message-avatar {
    background: var(--success-color);
    color: white;
}

.message-content {
    flex-grow: 1;
    max-width: 75%;
}

.user-message .message-content {
    text-align: right;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: var(--border-radius);
    word-wrap: break-word;
    box-shadow: var(--shadow);
    position: relative;
    font-size: 0.9rem;
    line-height: 1.4;
}

.user-message .message-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant-message .message-bubble {
    background: var(--message-assistant-bg);
    color: var(--dark-color);
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

.message-time {
    margin-top: 4px;
    font-size: 0.7rem;
}

.user-message .message-time {
    text-align: right;
}


/* Typing Indicator */

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--message-assistant-bg);
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
    font-size: 0.85rem;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary-color);
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%,
    60%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}


/* Suggestions */

#suggestions {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.suggestion-btn {
    font-size: 0.8rem;
    border-radius: 16px;
    transition: all 0.3s ease;
    padding: 4px 12px;
}

.suggestion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}


/* Input Area */

#chatForm {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

#messageInput {
    border: none;
    outline: none;
    font-size: 0.9rem;
    padding: 10px 14px;
}

#messageInput:focus {
    box-shadow: none;
}

#sendButton {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    margin: 2px;
}

#sendButton:hover {
    transform: scale(1.05);
}

#sendButton:disabled {
    opacity: 0.6;
    transform: none;
}


/* Right Panel Styles */

#contentArea {
    background: #ffffff;
}

#welcomeScreen {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}


/* Report Actions */

#reportActions .btn {
    font-size: 0.85rem;
}


/* Chart Container */

.card {
    border: 1px solid #e9ecef;
    box-shadow: var(--shadow);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}


/* Combined Layout */

#combinedContainer .card {
    height: 100%;
}

#combinedContainer .card-body {
    padding: 1rem;
}


/* Scrollbar Styling */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}


/* Modal Enhancements */

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
}


/* Toast Styling */

.toast {
    box-shadow: var(--shadow);
}


/* Report Content Styling */

#reportContent,
#combinedReportContent {
    font-size: 0.9rem;
    line-height: 1.6;
}

#reportContent h1,
#reportContent h2,
#reportContent h3,
#combinedReportContent h1,
#combinedReportContent h2,
#combinedReportContent h3 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

#reportContent h1:first-child,
#combinedReportContent h1:first-child {
    margin-top: 0;
}

#reportContent .highlight,
#combinedReportContent .highlight {
    background: #fff3cd;
    padding: 10px;
    border-left: 4px solid #ffc107;
    margin: 15px 0;
    border-radius: 4px;
}

#reportContent .insight,
#combinedReportContent .insight {
    background: #d1ecf1;
    padding: 10px;
    border-left: 4px solid #17a2b8;
    margin: 15px 0;
    border-radius: 4px;
}


/* Responsive Design */

@media (max-width: 768px) {
    body {
        overflow: auto;
    }
    .container-fluid {
        height: auto !important;
    }
    .row.g-0.h-100 {
        height: auto !important;
        flex-direction: column;
    }
    .col-md-5.col-lg-4 {
        height: 50vh;
        min-height: 400px;
    }
    .col-md-7.col-lg-8 {
        height: 50vh;
        min-height: 400px;
    }
    .message-content {
        max-width: 85%;
    }
    .message-bubble {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .message-avatar {
        width: 30px;
        height: 30px;
        margin-right: 8px;
        font-size: 12px;
    }
    .user-message .message-avatar {
        margin-left: 8px;
    }
    #suggestions {
        padding: 8px;
    }
    .suggestion-btn {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    #combinedContainer .row {
        flex-direction: column;
    }
    #combinedContainer .col-lg-6 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    .message {
        margin-bottom: 12px;
    }
    #reportActions .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    .card-header h6 {
        font-size: 0.9rem;
    }
}


/* Print Styles */

@media print {
    .navbar,
    #suggestions,
    #reportActions,
    .btn {
        display: none !important;
    }
    body {
        overflow: visible;
    }
    .container-fluid {
        height: auto !important;
    }
    .row {
        height: auto !important;
    }
    .col-md-5,
    .col-md-7 {
        width: 100% !important;
        max-width: 100% !important;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}


/* High contrast mode support */

@media (prefers-contrast: high) {
    .message-bubble {
        border: 2px solid;
    }
    .user-message .message-bubble {
        border-color: var(--primary-color);
    }
    .assistant-message .message-bubble {
        border-color: var(--dark-color);
    }
}

.mh-100 {
    max-height: 100%;
}