/*******************************
* Variables & Root Settings
*******************************/
:root {
    /* Colors */
    --color-primary: #2c3e50;
    --color-secondary: #3498db;
    --color-text: #212529;
    --color-border: #dee2e6;
    --color-background: #f8f9fa;
    --color-white: #fff;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 15px;
}

/*******************************
* Common/Global Styles
*******************************/
.btn-animate {
    transition: all 0.3s ease-in-out !important;
}

/* Hide footer on small screens for chatbot page */
@media (max-width: 576px) {
    .navbar-toggler {
        background-color: var(--color-secondary); /* Or any lighter color */
        color: var(--color-secondary); /* Optional: Adjust icon color */
        margin-right: auto;
    }

    .navbar-toggler-icon {
        background-image: none; /* Optional: Reset default icon */
        color: var(--color-white); /* Optional: Custom icon color */
        border: 0px solid var(--color-border); /* Optional: Add a border */
    }

    .chatbot-page footer {
        display: none !important;
    }
}
.btn-animate:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

.btn-animate:active {
    transform: translateY(0px);
}

/*******************************
* Layout Components
*******************************/
/* Section Cards */
.section-card {
    border-radius: var(--radius-lg);
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    overflow: hidden;
}

/* Guidelines */
.guideline-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    height: 100%;
    background: var(--color-background);
}

/* Ensure card body uses flexbox */
.card-body {
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    justify-content: space-between; /* Space between title and buttons */
    height: 100%; /* Ensure it takes full height */
}

/* Guideline Card Buttons - Mobile First */
@media (max-width: 576px) {
    .card-body .d-flex.justify-content-between {
        justify-content: center !important;
        gap: 0.5rem;
    }
}

/*******************************
* Chat Components - Mobile First
*******************************/
/* Chat Container */
.chat-container {
    height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--color-background);
}

/* Chat Messages Area */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem;
    height: calc(100vh - 60px);
    background: var(--color-background);
    margin: 0;
}

/* Message Styling */
.message {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    max-width: 100%;
    position: relative;
    box-shadow: none;
}

.message::before {
    display: none;
}

.user-message {
    background: var(--color-secondary);
    color: var(--color-white);
    margin-left: auto;
    padding-right: 0.75rem;
}

.assistant-message {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    margin-right: auto;
    color: var(--color-text);
    padding-left: 0.75rem;
    width: 100%;
}

/* Message Content */
.message-content {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 0;
    width: 100%;
}

.markdown-body {
    padding-right: 1rem;
    width: 100%;
    word-break: break-word;
}

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: none;
    border: none;
    color: #6c757d;
    padding: 0.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
}

/* Message Input */
.message-input {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    padding: 0.5rem;
    background-color: var(--color-white);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Card Optimizations */
.card-header {
    padding: 0.5rem;
}

.card-body {
    padding: 0.5rem;
}

/* Tables in Chat */
table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
}

/*******************************
* Header Styles - Mobile First
*******************************/
.header {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 0.5rem 0;
    text-align: center;
}

.header__title {
    color: var(--color-white);
    margin-bottom: 0;
    font-size: 1.5rem;
}

.header__title-highlight {
    color: var(--color-secondary);
    white-space: nowrap;
    font-size: 1.5rem;
}

.header__subtitle {
    color: var(--color-white);
    margin-bottom: 0;
    font-size: 1rem;
}

.header .nav-link-hover {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    transition: background-color 0.3s ease;
}

.card-header .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/*******************************
* Tablet Styles (768px and up)
*******************************/
@media (min-width: 577px) and (max-width: 991px) {
    .message {
        padding: 1.5rem;
    }

    .assistant-message {
        padding-left: 2.5rem;
    }

    .user-message {
        padding-right: 2rem;
    }

    .message::before {
        display: block;
        font-size: 1.4rem;
    }

    .header__title,
    .header__title-highlight {
        font-size: 2rem;
    }

    .header__subtitle {
        font-size: 1.2rem;
    }
}

/*******************************
* Desktop Styles (992px and up)
*******************************/
@media (min-width: 992px) {
    .chat-container {
        height: calc(100% - 50px);
        padding: var(--spacing-md);
        max-width: 900px;
        margin: 0 auto;
    }

    .chat-messages {
        padding: 1.5rem;
        height: calc(100% - 96px);
        margin: 0.5rem;
    }

    .message {
        padding: 2.5rem;
        margin-bottom: 1rem;
        box-shadow: var(--shadow-sm);
    }

    .message::before {
        display: block;
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        position: absolute;
        top: 1rem;
        font-size: 1.8rem;
    }

    .user-message::before {
        content: "\f80d";
        right: 1rem;
        color: rgba(255, 255, 255, 0.9);
    }

    .assistant-message::before {
        content: "\f0f0";
        left: 1rem;
        color: var(--color-secondary);
        font-size: 2rem;
    }

    .assistant-message {
        padding-left: 4rem;
    }

    .user-message {
        padding-right: 3rem;
    }

    .message-content {
        padding: var(--spacing-md);
    }

    .markdown-body {
        padding-right: 2rem;
    }

    .message-input {
        padding: 1rem 1.5rem;
        gap: 0.5rem;
    }

    .card-header {
        padding: 1rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .header__title,
    .header__title-highlight {
        font-size: 2.4rem;
    }

    .header__subtitle {
        font-size: 1.44rem;
    }

    .header .nav-link-hover {
        font-size: 1.08rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topic-card {
    animation: fadeIn 0.5s ease-in-out;
}

/* Navigation Styles */
.nav-link-hover:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
}

/* Loading State */
#loading {
    text-align: center;
    padding: 0.5rem;
    font-style: italic;
    color: #6c757d;
}

@media (min-width: 992px) {
    #loading {
        padding: 1rem;
    }
}

/* About Page Form Styles */
.about-form {
    max-width: 600px; /* Set a maximum width for the form */
    margin: 0 auto; /* Center the form */
}

.about-form .form-control {
    width: 100%; /* Reduce form field lengths by 50% */
    margin: 0 auto; /* Center the form fields */
}

@media (max-width: 992px) {
    .navbar-nav {
        text-align: left;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .header__subtitle {
        display: none;
    }
}

@media (max-width: 576px) {
    .hero-section .btn {
        display: block;
        margin: 0 auto;
        width: 75%;
    }
}

/* Centering the image in its container */
.img-fluid {
    display: block; /* Ensure the image is treated as a block element */
    margin-left: auto; /* Center horizontally */
    margin-right: auto; /* Center horizontally */
}