/* Menu and Banner Enhancements - Additional Polish */

.sidebar_close .logo-details .logo_name {
    opacity: 0;
    pointer-events: none;
}

.showMenu {
    display: block !important;
}

.showMenu .sub-menu {
    display: block !important;
}

/* Enhanced animations for menu interactions */
.sidebar .nav-links li {
    animation: none;
}

.sidebar .nav-links li.showMenu {
    background: rgba(232, 181, 0, 0.1);
}

.sidebar .nav-links li.showMenu > a .link_name {
    color: #E8B500;
    font-weight: 600;
}

/* Profile and notification enhancements */
.profile_initials {
    background: linear-gradient(135deg, #E8B500 0%, #FFC107 100%);
    color: #2A3A56;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(232, 181, 0, 0.3);
}

.profile_initials:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(232, 181, 0, 0.4);
    background: linear-gradient(135deg, #FFC107 0%, #E8B500 100%);
}

#notificationPanel,
#userMenuPanel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0;
    position: fixed;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    width: 340px;
    display: none;
    flex-direction: column;
    transition: left 0.3s ease;
    z-index: 9999;
}

/* Make the content area scrollable */
#notificationPanelContent {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding: 0;
    max-height: calc(100vh - 60px); /* Account for header/tabs */
}

/* Positioning based on sidebar state */
.sidebar.sidebar_close ~ #notificationPanel,
.sidebar.sidebar_close ~ #userMenuPanel {
    left: 60px;
}

.sidebar:not(.sidebar_close) ~ #notificationPanel,
.sidebar:not(.sidebar_close) ~ #userMenuPanel {
    left: 335px;
}

@media (max-width: 800px) {

    #notificationPanel,
    #userMenuPanel {
        left: 40px;
        width: 100vw;
        max-width: 100vw;
    }
}

#notificationPanel ul,
#userMenuPanel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#notificationPanel li,
#userMenuPanel li {
    padding: 12px 16px;
    border-bottom: 1px solid #F8F9FA;
    transition: all 0.3s ease;
}

#notificationPanel li:hover,
#userMenuPanel li:hover {
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
}

#notificationPanel li:last-child,
#userMenuPanel li:last-child {
    border-bottom: none;
}

/* Additional notification panel styling */
#notificationPanel h3,
#userMenuPanel h3 {
    margin: 0;
    padding: 10px;
    background-color: rgb(53 72 96);
    color: white;
    border-bottom: 1px solid #ccc;
}

/* Search icon enhancements */
.searchIcon {
    color: rgba(255, 255, 255, 0.8);
    font-size: x-large;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 6px;
}

.searchIcon:hover {
    color: #E8B500;
    background: rgba(232, 181, 0, 0.1);
    transform: scale(1.1);
}

/* Enhanced modal styling */
.Loginmodal {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.5);
}

.Loginmodal-content {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 40%;
    margin: 10% auto;
    overflow: hidden;
}

.LoginInputContainer {
    padding: 24px;
}

.LoginInputContainer input[type=text],
.LoginInputContainer input[type=password] {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0 16px 0;
    border: 2px solid #DEE2E6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.LoginInputContainer input[type=text]:focus,
.LoginInputContainer input[type=password]:focus {
    border-color: #35486E;
    box-shadow: 0 0 0 3px rgba(53, 72, 110, 0.1);
    outline: none;
}

.modalimgcontainer {
    background: linear-gradient(135deg, #35486E 0%, #4A5F7A 100%);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chatbot enhancements */
.chatbot {
    position: fixed;
    bottom: 40px;
    left: 40px;
    width: 35%;
    min-width: 30%;
    max-width: 80%;
    height: 400px;
    min-height: 25%;
    max-height: 80%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #DEE2E6;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    display: none; /* Hidden by default */
    resize: both;
    overflow: hidden; /* Prevent content overflow during resize */
}

.chatbot-header {
    background: linear-gradient(135deg, #35486E 0%, #4A5F7A 100%);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
    flex: 0 0 auto; /* Fixed size, no grow or shrink */
    position: relative;
}

/* Custom resize handle in top-right of header */
.chatbot-resize-handle {
    position: relative;
    width: 20px;
    height: 20px;
    cursor: nw-resize;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chatbot-resize-handle:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-resize-handle::before {
    content: '';
    width: 12px;
    height: 12px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><path d="M1 1l10 10M1 5l6 6M5 1l6 6" stroke="white" stroke-width="1" fill="none" stroke-linecap="round"/></svg>') no-repeat center;
    background-size: contain;
}

.chatbot-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 16px 0 16px; /* Remove bottom padding */
    overflow: hidden;
    margin-bottom: 3%;
    height: 57%;
}

#chat-log {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #DEE2E6;
    border-radius: 6px;
    background: #F8F9FA;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 0; /* Remove bottom margin */
}

/* Loading indicator styles */
.thinking-indicator {
    display: inline-block;
    animation: thinking 1.5s infinite;
    color: #6C757D;
    font-style: italic;
}

.thinking-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes thinking {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0.5;
    }
}

@keyframes dots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }

    100% {
        content: '';
    }
}

.chatbot-input {
    flex: 0 0 auto;
    padding: 16px;
    border-top: 1px solid #DEE2E6;
    display: flex;
    gap: 8px;
    background: white;
    border-radius: 0 0 12px 12px;
    width: 100%;
    box-sizing: border-box;
    position: sticky;
    bottom: 0;
}

.chatbot-input textarea {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #DEE2E6;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 36px;
    max-height: 100px;
    font-family: inherit;
}

.chatbot-input textarea:focus {
    border-color: #35486E;
    outline: none;
    box-shadow: 0 0 0 3px rgba(53, 72, 110, 0.1);
}

/* Chat message styling */
.chat-message {
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 6px;
    clear: both;
}

.chat-message.user {
    background: #E3F2FD;
    margin-left: 20%;
    text-align: right;
}

.chat-message.ai {
    background: #F5F5F5;
    margin-right: 20%;
}

.chat-message.error {
    background: #FFEBEE;
    color: #C62828;
    border-left: 4px solid #F44336;
}

.chat-message .sender {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 12px;
    color: #666;
}

.chat-message .content {
    line-height: 1.4;
}

.chat-message .content p {
    margin: 0 0 8px 0;
}

.chat-message .content p:last-child {
    margin-bottom: 0;
}

.chat-message .content ul,
.chat-message .content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.chat-message .content code {
    background: #F8F9FA;
    border: 1px solid #DEE2E6;
    border-radius: 3px;
    padding: 2px 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.chat-message .content pre {
    background: #F8F9FA;
    border: 1px solid #DEE2E6;
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    margin: 8px 0;
}

/* jQuery UI Resizable handle styling - removed to fix errors */

.chatbot-input button {
    background: linear-gradient(135deg, #35486E 0%, #4A5F7A 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-input button:hover {
    background: linear-gradient(135deg, #4A5F7A 0%, #35486E 100%);
    transform: translateY(-1px);
}

/* Login form textbox styling to ensure consistency */
.textbox,
input.textbox[type=text],
input.textbox[type=password] {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0 16px 0;
    border: 2px solid #DEE2E6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: white;
}

.textbox:focus,
input.textbox[type=text]:focus,
input.textbox[type=password]:focus {
    border-color: #35486E;
    box-shadow: 0 0 0 3px rgba(53, 72, 110, 0.1);
    outline: none;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus improvements for keyboard navigation */
.sidebar .nav-links li a:focus,
.sidebar .nav-links li .sub-menu a:focus {
    outline: 2px solid #E8B500;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .sidebar.sidebar_close {
        width: 60px;
        position: fixed;
    }

    .dropdown_menu-content {
        min-width: 200px;
        left: 0;
        right: auto;
    }

    #notification_banner,
    #site_notification_banner {
        width: 90%;
        right: 5%;
        left: 5%;
    }
}