/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Accessibility - Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid #D32F2F;
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 2rem;
    color: #D32F2F;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.version-badge {
    background: linear-gradient(135deg, #D32F2F, #B71C1C);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-secondary {
    background: rgba(211, 47, 47, 0.1);
    border: 1px solid rgba(211, 47, 47, 0.3);
    color: #D32F2F;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: rgba(211, 47, 47, 0.2);
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    gap: 2rem;
    padding: 2rem;
    overflow: hidden;
}

/* Chat Container */
.chat-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 80%;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bot-message {
    align-self: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #D32F2F, #B71C1C);
    color: white;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.message-content {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.user-message .message-content {
    background: linear-gradient(135deg, #D32F2F, #B71C1C);
    color: white;
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* Markdown Content Styling */
.markdown-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #1a1a1a;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: #D32F2F;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    line-height: 1.3;
}

.markdown-content h1 {
    font-size: 1.8em;
    border-bottom: 3px solid #D32F2F;
    padding-bottom: 0.3em;
}

.markdown-content h2 {
    font-size: 1.5em;
    border-bottom: 2px solid rgba(211, 47, 47, 0.3);
    padding-bottom: 0.3em;
}

.markdown-content h3 {
    font-size: 1.3em;
    color: #B71C1C;
}

.markdown-content h4 {
    font-size: 1.15em;
    color: #B71C1C;
}

.markdown-content h5 {
    font-size: 1.05em;
}

.markdown-content h6 {
    font-size: 1em;
    color: #666;
}

.markdown-content p {
    margin: 0.75em 0;
    text-align: justify;
}

.markdown-content ul,
.markdown-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin: 0.5em 0;
    line-height: 1.6;
}

.markdown-content li > ul,
.markdown-content li > ol {
    margin: 0.5em 0;
}

.markdown-content strong {
    font-weight: 700;
    color: #D32F2F;
}

.markdown-content em {
    font-style: italic;
    color: #555;
}

.markdown-content code {
    background: rgba(211, 47, 47, 0.08);
    color: #B71C1C;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
    border-left: 4px solid #D32F2F;
}

.markdown-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 4px solid #D32F2F;
    padding-left: 1em;
    margin: 1em 0;
    color: #555;
    font-style: italic;
    background: rgba(211, 47, 47, 0.05);
    padding: 0.5em 1em;
    border-radius: 4px;
}

.markdown-content a {
    color: #D32F2F;
    text-decoration: none;
    border-bottom: 1px solid rgba(211, 47, 47, 0.3);
    transition: all 0.2s ease;
}

.markdown-content a:hover {
    border-bottom-color: #D32F2F;
    color: #B71C1C;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
    overflow: hidden;
    border-radius: 8px;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid rgba(211, 47, 47, 0.2);
    padding: 0.75em 1em;
    text-align: left;
}

.markdown-content table th {
    background: linear-gradient(135deg, #D32F2F, #B71C1C);
    color: white;
    font-weight: 600;
}

.markdown-content table tr:nth-child(even) {
    background: rgba(211, 47, 47, 0.05);
}

.markdown-content hr {
    border: none;
    border-top: 2px solid rgba(211, 47, 47, 0.2);
    margin: 1.5em 0;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
}

/* First paragraph after heading - no extra margin */
.markdown-content h1 + p,
.markdown-content h2 + p,
.markdown-content h3 + p {
    margin-top: 0.5em;
}

/* Nested lists */
.markdown-content ul ul,
.markdown-content ol ol,
.markdown-content ul ol,
.markdown-content ol ul {
    list-style-type: circle;
    margin-left: 1.5em;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    text-align: right;
}

/* Chat Input */
.chat-input-container {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#chatInput {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(211, 47, 47, 0.2);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#chatInput:focus {
    border-color: #D32F2F;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D32F2F, #B71C1C);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

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

.suggestion-btn {
    background: rgba(211, 47, 47, 0.1);
    border: 1px solid rgba(211, 47, 47, 0.3);
    color: #D32F2F;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.suggestion-btn:hover {
    background: rgba(211, 47, 47, 0.2);
    transform: translateY(-1px);
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    overflow-y: auto;
}

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

.sidebar-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section h3 i {
    color: #D32F2F;
}



/* Status Items */
.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.status-label {
    font-size: 0.9rem;
    color: #666;
}

.status-value {
    font-weight: 600;
    color: #333;
}

.status-value.online {
    color: #28a745;
}

.status-value.offline {
    color: #dc3545;
}

/* Suggestions */
.suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    background: rgba(211, 47, 47, 0.05);
    border: 1px solid rgba(211, 47, 47, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.suggestion-item:hover {
    background: rgba(211, 47, 47, 0.1);
    transform: translateX(4px);
}

.suggestion-item i {
    color: #D32F2F;
    font-size: 1rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    background: white;
    padding: 2rem 3rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.loading-spinner i {
    font-size: 2rem;
    color: #D32F2F;
    margin-bottom: 1rem;
}

.loading-spinner p {
    color: #666;
    font-size: 1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.modal-body {
    padding: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-icon {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Message Sources */
.message-sources {
    margin-top: 1rem;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.sources-list {
    list-style: decimal;
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.sources-list li {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.similarity-score {
    color: #2196F3;
    margin: 0 0.5rem;
    font-weight: 500;
}

.file-name {
    color: #4CAF50;
    margin-left: 0.5rem;
    font-family: monospace;
    background: rgba(76, 175, 80, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.message-sources a {
    color: #1976D2;
    text-decoration: none;
    margin-left: 0.5rem;
    background: rgba(25, 118, 210, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.message-sources a:hover {
    background: rgba(25, 118, 210, 0.2);
    text-decoration: underline;
}

/* Message Confidence */
.message-confidence {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

.confidence-high {
    color: #28a745;
    font-weight: 600;
}

.confidence-medium {
    color: #ffc107;
    font-weight: 600;
}

.confidence-low {
    color: #dc3545;
    font-weight: 600;
}

/* Message Enhanced */
.message-enhanced {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

.search-queries {
    background: rgba(211, 47, 47, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.retrieval-method {
    background: rgba(211, 47, 47, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

/* Responsive Design */

/* Tablet and below (1200px) */
@media (max-width: 1200px) {
    .sidebar {
        width: 280px;
    }
    
    .container {
        max-width: 100%;
    }
}

/* Tablet (768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        height: auto;
        min-height: 100vh;
    }
    
    .main-content {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .sidebar {
        width: 100%;
        order: -1;
        padding: 1.5rem;
        max-height: 400px;
    }
    
    .header {
        padding: 1rem 1.5rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .btn-secondary {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .chat-container {
        height: calc(100vh - 500px);
        min-height: 400px;
    }
    
    .message {
        max-width: 95%;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .message-content {
        padding: 0.875rem 1.25rem;
    }
    
    .message-text {
        font-size: 0.9rem;
    }
    
    /* Markdown adjustments for tablet */
    .markdown-content h1 {
        font-size: 1.5em;
    }
    
    .markdown-content h2 {
        font-size: 1.3em;
    }
    
    .markdown-content h3 {
        font-size: 1.15em;
    }
    
    .markdown-content {
        font-size: 0.95rem;
    }
    
    .markdown-content pre {
        font-size: 0.85rem;
        overflow-x: auto;
    }
    
    .markdown-content table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
    }
    
    .chat-input-wrapper {
        gap: 0.75rem;
    }
    
    #chatInput {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .send-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .input-actions {
        gap: 0.5rem;
    }
    
    .suggestion-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

/* Mobile (480px) */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    .header {
        padding: 0.875rem 1rem;
    }
    
    .logo h1 {
        font-size: 1.1rem;
    }
    
    .logo i {
        font-size: 1.25rem;
    }
    
    .version-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .btn-secondary {
        font-size: 0.8rem;
        padding: 0.35rem 0.7rem;
    }
    
    .main-content {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .sidebar {
        padding: 1rem;
        max-height: 350px;
    }
    
    .sidebar-section {
        margin-bottom: 1.5rem;
    }
    
    .sidebar-section h3 {
        font-size: 1rem;
    }
    
    .status-item {
        padding: 0.5rem 0;
    }
    
    .status-label {
        font-size: 0.85rem;
    }
    
    .status-value {
        font-size: 0.85rem;
    }
    
    .suggestion-item {
        padding: 0.625rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .chat-container {
        height: calc(100vh - 480px);
        min-height: 350px;
        border-radius: 12px;
    }
    
    .chat-messages {
        padding: 0.875rem;
        gap: 1rem;
    }
    
    .message {
        max-width: 100%;
        gap: 0.625rem;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .message-content {
        padding: 0.75rem 1rem;
        border-radius: 14px;
    }
    
    .message-text {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    /* Markdown mobile optimizations */
    .markdown-content {
        font-size: 0.875rem;
        line-height: 1.6;
    }
    
    .markdown-content h1 {
        font-size: 1.3em;
    }
    
    .markdown-content h2 {
        font-size: 1.2em;
    }
    
    .markdown-content h3 {
        font-size: 1.1em;
    }
    
    .markdown-content h4,
    .markdown-content h5,
    .markdown-content h6 {
        font-size: 1em;
    }
    
    .markdown-content p {
        text-align: left;
        margin: 0.5em 0;
    }
    
    .markdown-content ul,
    .markdown-content ol {
        padding-left: 1.5em;
        margin: 0.75em 0;
    }
    
    .markdown-content li {
        margin: 0.375em 0;
    }
    
    .markdown-content pre {
        padding: 0.75em;
        font-size: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .markdown-content code {
        font-size: 0.85em;
        word-break: break-word;
    }
    
    .markdown-content table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .markdown-content table th,
    .markdown-content table td {
        padding: 0.5em 0.75em;
        white-space: nowrap;
    }
    
    .markdown-content blockquote {
        padding: 0.375em 0.75em;
        margin: 0.75em 0;
    }
    
    .message-sources {
        font-size: 0.8rem;
        padding: 0.75rem;
        margin-top: 0.75rem;
    }
    
    .sources-list {
        margin-left: 1.25rem;
    }
    
    .sources-list li {
        font-size: 0.8rem;
        padding: 0.375rem;
        margin-bottom: 0.375rem;
    }
    
    .message-time {
        font-size: 0.7rem;
    }
    
    .chat-input-container {
        padding: 0.875rem;
    }
    
    .chat-input-wrapper {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    #chatInput {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border-radius: 20px;
    }
    
    .send-btn {
        width: 42px;
        height: 42px;
        font-size: 1rem;
        flex-shrink: 0;
    }
    
    .input-actions {
        gap: 0.375rem;
    }
    
    .suggestion-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        border-radius: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }
    
    .stat-card {
        padding: 0.875rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 1.25rem 1rem 0.75rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .loading-spinner {
        padding: 1.5rem 2rem;
    }
    
    .loading-spinner i {
        font-size: 1.5rem;
    }
    
    .loading-spinner p {
        font-size: 0.9rem;
    }
}

/* Extra small mobile (360px) */
@media (max-width: 360px) {
    .logo h1 {
        font-size: 1rem;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .message-content {
        padding: 0.625rem 0.875rem;
    }
    
    .markdown-content {
        font-size: 0.8rem;
    }
    
    .chat-input-wrapper {
        flex-wrap: wrap;
    }
    
    #chatInput {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .send-btn {
        width: 100%;
        border-radius: 20px;
        height: 40px;
    }
}

/* Landscape mobile optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .container {
        height: auto;
    }
    
    .sidebar {
        max-height: 200px;
        overflow-y: auto;
    }
    
    .chat-container {
        height: 400px;
    }
    
    .header {
        padding: 0.5rem 1rem;
    }
    
    .main-content {
        padding: 0.5rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn-secondary,
    .suggestion-btn,
    .suggestion-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .send-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Better scrolling */
    .chat-messages,
    .sidebar {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent zoom on input focus */
    #chatInput {
        font-size: 16px;
    }
}

/* Print styles */
@media print {
    .header-actions,
    .sidebar,
    .chat-input-container,
    .loading-overlay {
        display: none !important;
    }
    
    .chat-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .message-content {
        break-inside: avoid;
    }
}

/* ============================================
   Review/Feedback Component Styles
   ============================================ */

/* Floating Review Button - High Contrast Design */
.review-floating-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    /* White background with red accent for high contrast */
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #D32F2F;
    border: 3px solid #D32F2F;
    border-radius: 50px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    /* Strong shadow for visibility against red background */
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(255, 255, 255, 0.5),
        0 4px 20px rgba(211, 47, 47, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: float 3s ease-in-out infinite, pulseGlow 2s ease-in-out infinite;
    /* Add backdrop blur effect for extra visibility */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.review-floating-btn:hover {
    transform: translateY(-5px) scale(1.08);
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
    border-color: #B71C1C;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 6px rgba(255, 255, 255, 0.7),
        0 6px 30px rgba(211, 47, 47, 0.7);
    color: #B71C1C;
}

.review-floating-btn:active {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(255, 255, 255, 0.6),
        0 3px 15px rgba(211, 47, 47, 0.6);
}

.review-floating-btn i {
    font-size: 1.3rem;
    color: #D32F2F;
    filter: drop-shadow(0 2px 4px rgba(211, 47, 47, 0.3));
    transition: all 0.3s ease;
}

.review-floating-btn:hover i {
    color: #B71C1C;
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 3px 6px rgba(211, 47, 47, 0.5));
}

.review-btn-text {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(211, 47, 47, 0.2);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.3),
            0 0 0 4px rgba(255, 255, 255, 0.5),
            0 4px 20px rgba(211, 47, 47, 0.5);
    }
    50% {
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.3),
            0 0 0 6px rgba(255, 255, 255, 0.7),
            0 4px 25px rgba(211, 47, 47, 0.7);
    }
}

/* Review Modal */
.review-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.review-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.review-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
}

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

.review-modal-header {
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.review-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.review-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.review-modal-body {
    padding: 2rem;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.review-label {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-label i {
    color: #D32F2F;
}

.optional {
    font-weight: 400;
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}

/* Star Rating */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.5rem;
}

.star-rating input[type="radio"] {
    display: none;
}

.star-rating label.star {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.star-rating label.star:hover,
.star-rating label.star:hover ~ label.star {
    color: #ffc107;
    transform: scale(1.1);
}

.star-rating input[type="radio"]:checked ~ label.star,
.star-rating input[type="radio"]:checked ~ label.star ~ label.star {
    color: #ffc107;
}

.star-rating input[type="radio"]:checked + label.star {
    animation: starPulse 0.3s ease;
}

@keyframes starPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.rating-text {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 0.5rem;
    min-height: 1.5rem;
    transition: color 0.3s ease;
}

.rating-text.active {
    color: #D32F2F;
    font-weight: 600;
}

/* Form Inputs */
.review-select,
.review-input,
.review-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

.review-select:focus,
.review-input:focus,
.review-textarea:focus {
    outline: none;
    border-color: #D32F2F;
    background: white;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.review-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.char-count {
    text-align: right;
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.25rem;
}

.char-count.warning {
    color: #ff9800;
}

.char-count.error {
    color: #f44336;
}

/* Review Actions */
.review-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.review-submit-btn,
.review-cancel-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.review-submit-btn {
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.review-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

.review-submit-btn:active {
    transform: translateY(0);
}

.review-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.review-cancel-btn {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
}

.review-cancel-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

/* Success Message */
.review-success {
    text-align: center;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.review-success.hidden {
    display: none;
}

.success-icon {
    font-size: 4rem;
    color: #4caf50;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.review-success h3 {
    font-size: 1.75rem;
    color: #333;
    margin: 0;
}

.review-success p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

.review-close-success {
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.review-close-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .review-floating-btn {
        bottom: 1rem;
        right: 1rem;
        padding: 0.875rem 1.25rem;
        border-width: 2px;
        box-shadow: 
            0 6px 24px rgba(0, 0, 0, 0.3),
            0 0 0 3px rgba(255, 255, 255, 0.5),
            0 3px 15px rgba(211, 47, 47, 0.5);
    }

    .review-floating-btn:hover {
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 0 0 5px rgba(255, 255, 255, 0.7),
            0 4px 20px rgba(211, 47, 47, 0.7);
    }

    .review-btn-text {
        display: none;
    }

    .review-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .review-modal-header {
        padding: 1.25rem 1.5rem;
    }

    .review-modal-header h2 {
        font-size: 1.25rem;
    }

    .review-modal-body {
        padding: 1.5rem;
    }

    .star-rating label.star {
        font-size: 1.75rem;
    }

    .review-actions {
        flex-direction: column;
    }
} 