/* slam_bot_styles.css */
:root {
    --primary-color: #0e4d92;
    --primary-light: #3a7bc8;
    --primary-dark: #0a3a6e;
    --secondary-color: #f1f1f1;
    --user-message-bg: #e6f2ff;
    --bot-message-bg: #f0f4f8;
    --text-color: #333;
    --light-text: #666;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: white;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-container {
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    text-align: center;
    position: relative;
}

    .chat-header h1 {
        font-size: 1.3rem;
        font-weight: 600;
    }

    .chat-header p {
        font-size: 0.8rem;
        opacity: 0.9;
        margin-top: 5px;
    }
    .chat-header {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 15px 20px;
    }

    .header-logo {
        height: 75px;
        width: auto;
        flex-shrink: 0;
    }

    .header-text {
        flex: 1;
    }

@media (max-width: 600px) {
    .header-logo {
        height: 55px;
    }
    
    .chat-header {
        gap: 10px;
    }
}

.chatbox {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: var(--border-radius);
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    align-self: flex-end;
    background-color: var(--user-message-bg);
    color: var(--text-color);
    border-bottom-right-radius: 4px;
}

.bot-message {
    align-self: flex-start;
    background-color: var(--bot-message-bg);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: var(--light-text);
    margin-top: 5px;
    text-align: right;
}

.input-area {
    display: flex;
    padding: 12px;
    background-color: white;
    border-top: 1px solid #e1e5eb;
    gap: 8px;
}

    .input-area input {
        flex: 1;
        padding: 10px 15px;
        border: 1px solid #ddd;
        border-radius: 20px;
        outline: none;
        font-size: 0.9rem;
        transition: var(--transition);
    }

        .input-area input:focus {
            border-color: var(--primary-light);
            box-shadow: 0 0 0 2px rgba(14, 77, 146, 0.2);
        }

    .input-area button {
        padding: 10px 20px;
        background-color: var(--primary-color);
        color: white;
        border: none;
        border-radius: 20px;
        cursor: pointer;
        font-weight: 600;
        transition: var(--transition);
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .input-area button:hover {
            background-color: var(--primary-dark);
        }

        .input-area button:disabled {
            background-color: #cccccc;
            cursor: not-allowed;
        }

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background-color: var(--bot-message-bg);
    border-radius: var(--border-radius);
    align-self: flex-start;
    max-width: 70px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--light-text);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

    .typing-dot:nth-child(1) {
        animation-delay: -0.32s;
    }

    .typing-dot:nth-child(2) {
        animation-delay: -0.16s;
    }

@keyframes typingAnimation {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.results-container {
    margin-top: 8px;
    border-top: 1px dashed #ddd;
    padding-top: 8px;
}

.result-link {
    display: block;
    padding: 6px 10px;
    margin: 4px 0;
    background-color: white;
    border-radius: 6px;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    transition: var(--transition);
    border: 1px solid #e1e5eb;
}

    .result-link:hover {
        background-color: #f0f7ff;
        border-color: var(--primary-light);
    }

.markdown-content {
    line-height: 1.5;
    font-size: 0.85rem;
}

    .markdown-content h2 {
        margin-top: 12px;
        margin-bottom: 8px;
        font-size: 1.1rem;
        color: var(--primary-dark);
    }

    .markdown-content h3 {
        margin-top: 10px;
        margin-bottom: 6px;
        font-size: 1rem;
    }

    .markdown-content p {
        margin-bottom: 8px;
    }

    .markdown-content ul, .markdown-content ol {
        margin-left: 16px;
        margin-bottom: 8px;
    }

    .markdown-content li {
        margin-bottom: 4px;
    }

    .markdown-content hr {
        border: none;
        height: 1px;
        background-color: #ddd;
        margin: 12px 0;
    }

.welcome-message {
    text-align: center;
    padding: 12px;
    background-color: #e6f7ff;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #bae7ff;
}

    .welcome-message h2 {
        font-size: 1.1rem;
        margin-bottom: 8px;
        color: var(--primary-dark);
    }

    .welcome-message p {
        font-size: 0.85rem;
        margin: 4px 0;
        color: var(--text-color);
    }

/* Feedback Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--primary-color);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close:hover {
    color: #ddd;
}

.modal-body {
    padding: 20px;
}

.rating-container {
    margin: 20px 0;
    text-align: center;
}

.rating-stars {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.star {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: var(--transition);
    margin: 0 2px;
}

.star:hover,
.star.active {
    color: #ffc107;
    transform: scale(1.1);
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--light-text);
    margin-top: 5px;
}

.feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary, .btn-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: #f1f1f1;
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #e1e1e1;
}

/* Feedback button in bot messages */
.feedback-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
    text-align: center;
}

.feedback-button {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition);
}

.feedback-button:hover {
    background-color: var(--primary-color);
    color: white;
}

@media (max-width: 600px) {
    .message {
        max-width: 90%;
    }

    .input-area {
        padding: 10px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .star {
        font-size: 1.7rem;
    }
}
/* Add these styles to your existing CSS */

.feedback-text-container {
    margin: 20px 0;
}

.feedback-text-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.feedback-text-container textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: var(--transition);
}

.feedback-text-container textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(14, 77, 146, 0.2);
}

/* Table Styles for Markdown Content */
/* Improved Markdown Styles */
.markdown-content {
    line-height: 1.6;
    font-size: 14px;
}

.markdown-content h1 {
    color: #2c3e50;
    margin: 25px 0 15px 0;
    font-size: 1.6rem;
    font-weight: 700;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.markdown-content h2 {
    color: #2c3e50;
    margin: 20px 0 12px 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.markdown-content h3 {
    color: #34495e;
    margin: 18px 0 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.markdown-content hr {
    margin: 20px 0;
    border: none;
    border-top: 2px solid #e1e1e1;
}

.markdown-content ul {
    margin: 12px 0;
    padding-left: 24px;
}

.markdown-content li {
    margin: 6px 0;
    padding-left: 8px;
}

.markdown-content li.check {
    list-style-type: none;
    margin-left: -8px;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.markdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.markdown-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid #e1e1e1;
    color: #2c3e50;
}

.markdown-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.markdown-table tr:last-child td {
    border-bottom: none;
}

.markdown-table tr:hover {
    background-color: #f8f9fa;
}

/* Message spacing */
.bot-message .markdown-content {
    padding: 5px 0;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* Online Status */
.online-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: #90ee90;
    margin-top: 4px;
    animation: blinkOnline 1.2s infinite;
}

@keyframes blinkOnline {
    0%   { opacity: 1; }
    50%  { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Typing indicator loader */
/* Wrapper bubble */


.typing-indicator {
    display: flex;
    align-items: center;
    width: fit-content;
    max-width: 60%;
    padding: 10px 14px;
    margin: 8px 0;
    background-color: var(--bot-message-bg);
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    color: var(--primary-dark); 
}

/* Row layout */
.typing-status {
    display: flex;
    align-items: center;
}

/* Rotating text */
.typing-text {
    font-size: 14px;
    font-weight: 500;
    margin-right: 10px;
}

/* Dot container */
.typing-dots {
    display: flex;
    gap: 4px;
}

/* Animated dots */
.typing-dot {
    width: 8px;
    height: 8px;
    background: #8f8b8b;   /* MATCHING color */
    border-radius: 50%;
    opacity: 0.4;
    animation: typingBlink 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
    0% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.4); }
    100% { opacity: 0.2; transform: scale(1); }
}
/*--------------------------------Mode Button-------------------------------*/
/* Input container hosting everything */
.input-container {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 10px;
    padding: 8px 4px;
    border: 1px solid #e1e4eb;
    box-shadow: 0 0 4px rgba(0,0,0,0.07);
    gap: 6px;
}

/* LEFT SIDE BUTTON GROUP */
.mode-inside {
    display: flex;
    gap: 4px;
}

/* Smaller mode buttons */
.mode-option {
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    border: none;
    background: #f0f4ff;
    color: #0e4d92;
    cursor: pointer;
    transition: 0.2s ease;
}

.mode-option.active {
    background: #0e4d92;
    color: white;
}

/* Textarea */
textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 1.0rem;
    padding: 4px;
    padding-right: 16px;
    background: transparent;
}

/* Smaller send button */
.send-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #0e4d92;
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}


/* ---------------- Related Resources Layout ---------------- */

.related-title {
    margin-bottom: 8px;
}

/* Each resource block */
.resource-item {
    padding: 8px 0;
    border-bottom: 1px dashed #ddd;
}

/* File name line */
.resource-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

/* Button row */
.resource-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.resource-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid #e1e5eb;
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s ease;
}

    .resource-btn:hover {
        background-color: #f0f7ff;
        border-color: var(--primary-light);
    }
