@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #8FCC33;
    --primary-dark: #7AB628;
    --secondary: #16A9E4;
    --bg-main: #f8f9fa;
    --bg-chat: #ffffff;
    --bg-sidebar: #143d2b;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #ececf1;
    --border: #e1e4e8;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --sat: env(safe-area-inset-top);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    height: 100%;
    overflow: hidden;
    display: flex;
}

body>#container {
    width: 100% !important;
    height: 100dvh;
    overflow: auto !important;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

input,
textarea,
select {
    font-size: 16px;
}

.mob-header,
.main-content .header {
    padding-top: max(var(--sat), 16px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 100;
}

.sidebar.collapsed {
    width: 80px;
}

/* Sidebar Logo Section */
.sidebar-logo {
    padding: 6px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 70px;
}

.logo-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

/* .logo-link:hover {
    transform: scale(1.05);
} */

.logo-image {
    width: 10.5rem;
    object-fit: contain;
    filter: brightness(0.95);
    transition: filter 0.2s ease, width 0.2s ease;

}

/* Collapsed sidebar */
.sidebar.collapsed .logo-image {
    width: 44px;
    margin-top: 14px;
    margin-bottom: 6px;
    content: url(https://lexcomply.com/assests/img/favicon-min.png);
    border-radius: 8px;
    padding: 4px;
    background: var(--bg-chat);
}

/* Hover effect */
.logo-link:hover .logo-image {
    filter: brightness(1);
}

.sidebar-toggle-btn {
    background: var(--bg-chat);
    border: 1px solid var(--bg-sidebar);
    color: var(--bg-sidebar);
    width: 42px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgb(143 204 51 / 10%);
    border-color: var(--primary);
    color: var(--primary);
}

.sidebar.collapsed .sidebar-toggle-btn svg {
    transform: scaleX(-1);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Default (expanded) */
.sidebar-toggle-btn .icon-collapsed {
    display: none;
}

/* When sidebar is collapsed */
.sidebar.collapsed~.main-content .sidebar-toggle-btn .icon-expanded {
    display: none;
}

.sidebar.collapsed~.main-content .sidebar-toggle-btn .icon-collapsed {
    display: inline-block;
}

.new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.new-chat-btn:hover {
    background: rgb(143 204 51 / 10%);
    border-color: var(--primary);
}

.sidebar.collapsed .new-chat-btn {
    padding: 12px;
    justify-content: center;
}

.sidebar.collapsed .new-chat-btn .btn-text {
    display: none;
}

/* Templates Section */
.templates-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
    min-height: 0;
}

.templates-header {
    margin-bottom: 12px;
}

.templates-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(236, 237, 241, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .templates-title {
    opacity: 0;
    display: none;
}

.templates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
    overflow: hidden;
}

.template-item:hover {
    background: rgb(143 204 51 / 10%);
    border-color: rgba(143, 204, 51, 0.3);
    transform: translateX(4px);
}

.template-item svg {
    flex-shrink: 0;
    color: var(--primary);
    min-width: 16px;
}

.template-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .template-text {
    display: none;
}

.sidebar.collapsed .template-item {
    justify-content: center;
    padding: 12px;
}

/* Chat History */
.chat-history {
    flex: 0;
    overflow-y: auto;
    padding: 0;
}

.chat-history-item {
    padding: 12px;
    margin: 4px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-history-item:hover {
    background: var(--bg-sidebar-hover);
}

.chat-history-item.active {
    background: var(--bg-sidebar-hover);
}

/* Support Section */
.sidebar-support {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    margin-top: auto;
}

.sidebar-support a {
    text-decoration: none;
}

.support-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
}

.support-item {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    /* text-align: left; */
    justify-content: center;
}

.support-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(143, 204, 51, 0.3);
}

.support-item svg {
    flex-shrink: 0;
    /* color: var(--primary); */
    min-width: 18px;
}

.support-text {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .support-text {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    position: relative;
    height: 100dvh;
}

/* Header */
.header {
    background: var(--bg-chat);
    padding: 16px 24px 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 1px 3px var(--shadow);
    z-index: 10;
    flex-wrap: wrap;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.menu-toggle:hover {
    color: var(--primary);
}

.app-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-right: auto;
    letter-spacing: -0.5px;
}

/* Wrapper */
.jurisdiction-selector {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

/* Dropdown base */
/* Base dropdown */
.jurisdiction-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    min-width: 200px;
    height: 42px;
    padding: 10px 42px 10px 14px;

    border: 1px solid var(--border, #d0d5dd);
    border-radius: 10px;

    background-color: var(--bg-chat);
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7L10 12L15 7' stroke='%2398A2B3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;

    color: var(--text-primary, #101828);
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;
    transition: all 0.25s ease;
}

/* Hover */
.jurisdiction-dropdown:hover {
    border-color: var(--primary);
}

/* Focus */
.jurisdiction-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
}

/* ===============================
   OPTION MENU SOFTENING
   =============================== */

/* Chrome / Edge / Firefox */
.jurisdiction-dropdown option {
    background-color: var(--bg-chat);
    color: var(--text-primary, #101828);
    font-size: 14px;
    font-weight: 500;

    padding: 12px 14px;
    border-radius: 8px;
}

/* Hover */
.jurisdiction-dropdown option:hover {
    background-color: color-mix(in srgb, var(--primary) 10%, var(--bg-chat));
}

/* Selected */
.jurisdiction-dropdown option:checked {
    background-color: color-mix(in srgb, var(--primary) 18%, var(--bg-chat));
    color: var(--primary);
    font-weight: 600;
}

/* Keyboard active */
.jurisdiction-dropdown option:active {
    background-color: color-mix(in srgb, var(--primary) 26%, var(--bg-chat));
}

/* Remove dark system border (WebKit) */
@supports (-webkit-appearance: none) {
    select.jurisdiction-dropdown {
        border-color: var(--border, #d0d5dd);
    }
}


/* Header User Section */
.header-user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(143, 204, 51, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #84c02d40;
}

.user-profile-header:hover {
    background: rgba(143, 204, 51, 0.12);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-chat);
    font-weight: 600;
    flex-shrink: 0;
}

.user-email-header {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.user-menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.user-menu-btn:hover {
    color: var(--primary);
}

.logout-btn-header {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.logout-btn-header:hover {
    background: #ef4444;
    color: var(--bg-chat);
}

/* Dropdown Menu Styles */
.user-profile-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-chat);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 16px var(--shadow-lg);
    min-width: 200px;
    margin-top: 8px;
    z-index: 1001;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(143, 204, 51, 0.08);
}

.dropdown-item svg {
    flex-shrink: 0;
    color: var(--text-primary);
}

.dropdown-item.user-info {
    pointer-events: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
}

.dropdown-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-email-dropdown {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-all;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.logout-item {
    color: #ef4444;
}

.logout-item svg {
    color: #ef4444;
}

.logout-item:hover {
    background: rgba(239, 68, 68, 0.08);
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.user-profile-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 140px;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 40px 20px;
}

.welcome-content {
    max-width: 800px;
    text-align: center;
}

.bot-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-chat);
    box-shadow: 0 8px 24px rgba(143, 204, 51, 0.3);
}

.bot-image {
    width: 100%;
    height: 100%;
    border: 1px solid #fefefe;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: #8bc34a42 0px 1px 3px, rgb(139 195 74 / 21%) 0px 1px 2px;
    padding: 4px;
    background: var(--bg-chat);
}

.welcome-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.welcome-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.suggestions-grid {
    display: flex;
    grid-template-columns: repeat(auto-fit, minmax(300px, 2fr));
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.suggestion-card {
    background: var(--bg-chat);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    flex-direction: column;
}

.suggestion-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateY(-2px);
}

.suggestion-card svg {
    flex-shrink: 0;
    color: var(--primary);
}

.suggestion-card span {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Messages */
.messages {
    padding: 24px;
    max-width: 1028px;
    margin: 0 auto;
    width: 100%;
}

.message {
    margin-bottom: 24px;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    display: flex;
    flex-direction: column;
    max-width: 97%;
}

/* Bot â†’ LEFT */
.message.bot {
    align-self: flex-start;
    text-align: left;
}

/* User â†’ RIGHT */
.message.user {
    align-self: flex-end;
    text-align: right;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    /* margin-bottom: 12px; */
    position: relative;
}

.message.user .message-header {
    flex-direction: row-reverse;
    text-align: right;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--secondary), #1391cc);
    color: var(--bg-chat);
    position: absolute;
    top: 0;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--bg-chat);
    position: absolute;
    top: 0;
}

.message-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.message-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    word-wrap: break-word;
}

.message-content p {
    margin-bottom: 12px;
}

.message-content ul,
.message-content ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.message-content li {
    margin-bottom: 6px;
}

.message-content code {
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #1f2937;
}

.message-content pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.message-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 13px;
}

.message.user .message-content {
    background: linear-gradient(135deg, rgba(22, 169, 228, 0.1), rgba(22, 169, 228, 0.05));
    padding: 12px 16px;
    border-radius: 14px 0px 14px 14px;
    border: 1px solid rgba(22, 169, 228, 0.15);
    display: inline-block;
    width: fit-content;
    max-width: 70%;
    margin-left: auto;
    margin-right: 44px;
    text-align: left;
}

.message.bot .message-content {
    background: linear-gradient(135deg, rgba(143, 204, 51, 0.08), rgba(143, 204, 51, 0.04));
    padding: 12px 16px;
    border-radius: 0px 14px 14px;
    display: inline-block;
    margin-left: 44px;
    border: 1px solid rgba(143, 204, 51, 0.2);
    margin-right: 37px;
    width: fit-content;
    max-width: 75%;
}

.message-footer {
    font-size: 12px;
    margin-left: 44px;
    margin-right: 37px;
    max-width: 75%;
    margin-top: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 16px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area - Floating */
.input-area {
    position: relative;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.input-container {
    display: flex;
    flex-direction: column;
    position: absolute;
    gap: 8px;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    width: calc(100% - 48px);
    max-width: 900px;
    border-radius: 10px;
    background-color: #ffffff45;
    backdrop-filter: blur(2px);
}

.input-wrapper {
    max-width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-chat);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.98);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 16px 40px rgba(143, 204, 51, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    color: var(--text-primary);
    background: transparent;
}

#messageInput::placeholder {
    color: var(--text-secondary);
}

.voice-btn,
.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-btn {
    background: transparent;
    color: var(--text-secondary);
}

.voice-btn:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.voice-btn.listening {
    background: #ef4444;
    color: var(--bg-chat);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.send-btn {
    background: var(--primary);
    color: var(--bg-chat);
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(143, 204, 51, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-footer {
    max-width: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 0 4px;
}

.char-count {
    font-weight: 500;
}

.input-hint {
    font-style: italic;
}

/* Floating Action Button */
.fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--bg-chat);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(143, 204, 51, 0.4);
    z-index: 1000;
    transition: all 0.3s;
}

.fab:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {

    /* Sidebar Mobile Styling */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100dvh;
        width: 280px;
        transform: translateX(-100%);
        z-index: 1000;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        overflow-y: auto;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    /* Sidebar Backdrop - darker overlay on mobile */
    .sidebar.active {
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    }

    /* Overlay backdrop when sidebar is open */
    body::before {
        content: '';
        position: fixed;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0);
        z-index: 999;
        pointer-events: none;
        transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Show backdrop when sidebar is active */
    body:has(.sidebar.active)::before {
        background: rgba(0, 0, 0, 0.5);
        pointer-events: auto;
    }

    .sidebar-toggle-btn {
        flex-shrink: 0;
        /* order: 1; */
    }

    .menu-toggle {
        display: block;
    }

    /* Header Mobile Styling */
    .header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .app-title {
        font-size: 18px;
    }

    /* Hide Jurisdiction Selectors on Mobile */
    .jurisdiction-selector {
        display: none !important;
    }

    .jurisdiction-dropdown {
        display: none !important;
    }

    .state-dropdown {
        display: none !important;
    }

    /* User Profile Mobile Styling */
    .header-user-section {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin-left: auto;
        flex-basis: auto;
        margin-top: 0;
        gap: 8px;
    }

    .user-profile-header {
        padding: 6px;
        background: transparent;
        gap: 0;
    }

    .user-email-header {
        display: none !important;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
    }

    .user-menu-btn {
        display: none;
    }

    .mode-selector {
        display: none;
    }

    .suggestions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .messages {
        padding: 16px;
    }

    .input-area {
        bottom: 16px;
        width: calc(100% - 32px);
        left: 16px;
        transform: translateX(0);
        max-width: none;
    }

    .input-hint {
        display: none;
    }

    .chat-container {
        padding-bottom: 120px;
    }

    .welcome-content h2 {
        font-size: 24px;
    }

    .welcome-content p {
        font-size: 14px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Cursor Blink */
.cursor-blink {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--primary);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.ai-disclaimer {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.75;
    text-align: center;
    flex: 1;
    white-space: nowrap;
}

.message.bot .source-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.source-pill {
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(143, 204, 51, 0.15);
    color: #4d7c0f;
    border: 1px solid rgba(143, 204, 51, 0.35);
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.source-pill:hover {
    background: rgba(143, 204, 51, 0.25);
    border-color: rgba(143, 204, 51, 0.45);
}

/* Additional Professional Refinements */
.message-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(143, 204, 51, 0.3);
    transition: all 0.2s ease;
}

.message-content a:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
}

.message-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    margin-left: 0;
    margin-right: 0;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 12px;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Focus visible for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, opacity;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.message-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid rgba(143, 204, 51, 0.2);
}

/* Usage section */
.sidebar-usage {
    margin-top: auto;
    padding: 16px;
    background: var(--bg-main);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 10px;
    border-radius: 10px;
}

/* Header */
.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.usage-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.usage-count {
    font-size: 12px;
    color: #6b7280;
}

/* Progress bar */
.usage-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.usage-progress {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.3s ease;
    display: block;
}

/* Footer text */
.usage-hint {
    margin-top: 6px;
    font-size: 11px;
    color: #6b7280;
}

/* =====================================================================================================================
=====================================================================================================================
====================================================================================================================
----------------------------------------- For index file ---------------------------------------------------------------
====================================================================================================================
====================================================================================================================
==================================================================================================================== */


.banner-container {
    display: flex;
    height: 100vh;
    width: 100%;
    padding-top: 3rem;
}

/* right Side - Brand & Info */
.banner-right {
    flex: 1;
    /* background: var(--bg-chat); */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 60px;
    /* color: var(--bg-chat); */
    /* position: relative; */
    /* overflow: hidden; */
}

/* .banner-right::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: moveGrid 20s linear infinite;
} */

@keyframes moveGrid {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(40px, 40px);
    }
}

/* .brand-content {
    position: relative;
    z-index: 1;
 max-width: 500px; 
text-align: center;
padding: 100px 20px;
background-color: var(--bg-chat);
}

*/

.brand-content .logo-container {
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease-out;
}


.brand-content .logo-container img {
    width: 200px;
    height: auto;
    filter: brightness(0) invert(1);
}

.banner-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.banner-subtitle {
    font-size: 20px;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 30px;
    line-height: 1.5;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    opacity: 0.9;
}

.feature-icon {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* left Side - Login Form */
.banner-left {
    flex: 1;
    /* background: var(--bg-chat); */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.login-container {
    width: 100%;
    max-width: 440px;
    animation: fadeIn 0.8s ease-out 0.3s backwards;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
}

.login-description {
    font-size: 16px;
    color: #6c757d;
}

.login-form {

    flex-direction: column;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: slideIn 0.3s ease-out;
    width: 100%;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e4e8;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(143, 204, 51, 0.1);
}

.form-input.otp-input {
    text-align: center;
    letter-spacing: 8px;
    font-size: 18px;
    font-weight: 600;
}

.form-button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--bg-chat);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.form-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(143, 204, 51, 0.3);
}

.form-button:active {
    transform: translateY(0);
}

.form-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.form-button.secondary {
    background: #f3f4f6;
    color: #2c3e50;
}

.form-button.secondary:hover {
    background: #e5e7eb;
}

.sent-email-info {
    margin-bottom: 16px;
    padding: 12px;
    background: #f0fdf4;
    border-radius: 8px;
    color: #166534;
    font-size: 14px;
    text-align: center;
}

.sent-email-info strong {
    color: #15803d;
}

.error-message {
    display: none;
    margin-top: 2rem;
    padding: 6px;
    background: #fef2f2;
    border-radius: 8px;
    color: #ef4444;
    width: 100%;
    font-size: 12px;
    text-align: center;
}

.error-message.show {
    display: block;
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .banner-container {
        flex-direction: column;
        padding-top: 0;
        height: auto;
    }

    .brand-overlay {
        clip-path: none !important;
        padding: 10px !important;
    }

    .banner-left .login-header {
        margin-bottom: 0;
    }

    .banner-left {
        padding: 40px 30px;
        min-height: 40dvh;
        margin-top: 3rem;
        align-items: flex-start;
    }

    .banner-title {
        font-size: 36px;
    }

    .banner-subtitle {
        font-size: 18px;
    }

    .feature-list {
        margin-top: 30px;
    }

    .banner-right {
        padding: 40px 30px;
        /* display: none; */
    }



    .input-container {
        width: calc(100% - 12px);
        bottom: 10px;
    }
}

@media (max-width: 640px) {
    .banner-left {
        padding: 30px 20px;
    }

    .banner-title {
        font-size: 28px;
    }

    .banner-subtitle {
        font-size: 16px;
    }

    .logo-container img {
        width: 150px;
    }

    .banner-right {
        padding: 30px 20px;
        /* display: none; */
    }

    .context-first-section .list6 li {
        flex-direction: column !important;
    }

    .context-first-section .list6 li:nth-child(odd) {
        padding-left: 15px !important;
    }

    .login-title {
        font-size: 24px;
    }
}

.login-header .bot-image {
    width: 5rem;
    height: 5rem;

    margin-bottom: 20px;
    box-shadow: #8bc34a42 2px 3px 6px, rgb(139 195 74 / 25%) 1px 3px 5px;
}

.brand-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 16px;
}

.brand-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay */
.brand-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #06565ebf 0%, #1a9a82db 100%);
    clip-path: polygon(45% 0, 100% 0, 100% 100%, -25% 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 40px;
    /* backdrop-filter: blur(1px); */
}

/* Feature list */
.feature-list {
    max-width: 360px;
    color: #fff;
}

.feature-item {
    position: relative;
    padding-left: 26px;
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
}

/* Checkmark dot */
.feature-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 10px;
    height: 10px;
    background-color: #ffffff;
    border-radius: 50%;
}

.sidebar.collapsed .sidebar-usage {
    display: none;
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background-color: var(--primary, #017bec);
    border-radius: 50%;
    opacity: 0.3;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typing {
    0% {
        opacity: 0.3;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

/* ----- */
.message-footer.disclaimer {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.4;
    color: #6b7280;
    /* slate-500 */
}

.message-footer.disclaimer.faded {
    opacity: 0;
    animation: fadeInDisclaimer 0.6s ease forwards;
    animation-delay: 0.3s;
}

@keyframes fadeInDisclaimer {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }

    to {
        opacity: 0.6;
        transform: translateY(0);
    }
}

.message-content {
    position: relative;
}

/* floating icon */
.copy-btn {
    position: absolute;
    bottom: 1px;
    right: 1px;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;

    opacity: 0;
    transform: scale(.9);
    transition: .18s ease;
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

/* show on hover OR when done */
.message.bot.done:hover .copy-btn,
.message.bot.done .copy-btn {
    opacity: 1;
    transform: scale(1);
}

/* hover effect */
.copy-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

/* copied state */
.copy-btn.copied {
    background: #10b981;
    color: white;
}

.message.bot.done .copy-btn {
    animation: fadeInCopy .25s ease;
}

@keyframes fadeInCopy {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-p {
    position: relative;
    /* padding-left: 26px; */
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    font-weight: 500;
    color: var(--bg-chat);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.7s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}