/* chat-header.php */

:root {
    --bg-body: #ffffff;
    --bg-sidebar: #F7F8FA;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --sidebar-width: 280px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    overflow-x: hidden;
}

.nav-item:hover,
.nav-item.active {
    background-color: #fff !important;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #F7F8FA;

    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 1000;

}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 0px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 8px;
}

/* .sidebar {
            height: 100vh;
            display: flex;
            flex-direction: column;
            background: #fff;
            border-right: 1px solid #e5e7eb;
        } */



.user-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 4px;
    cursor: pointer;
}

/* Sidebar Search */
.sidebar-search {
    position: relative;
    margin-bottom: 20px;
}

.sidebar-search input {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px 8px 35px;
    width: 100%;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sidebar-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.kbd-badge {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 10px;
    padding: 4px 10px 4px 25px;
    color: #000000e6;

    font-family: monospace;
}

/* Navigation */
.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: background 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background-color: #f3f4f6;
}

.nav-item i {
    margin-right: 10px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.nav-shortcut {
    font-size: 11px;
    color: var(--text-secondary);
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 1px 5px;
    border-radius: 4px;
}

/* Sections */
.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 24px;
    margin-bottom: 20px !important;
    padding-left: 12px;
}

.list-link {
    display: block;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-link:hover {
    color: var(--text-primary);
}


.btn-new-chat-sidebar {
    margin-top: auto;
    width: 100%;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-new-chat-sidebar:hover {
    background-color: var(--accent-blue-hover);
    color: white;
}

.main-content {
    margin-left: var(--sidebar-width);
    /* padding: 20px 30px; */
    width: calc(100% - var(--sidebar-width));
}

.main-content-sec {

    margin-top: 0px !important;
    margin: 0%;
    padding: 24px 20px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search input {
    padding-left: 36px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.nav-shortcut {
    font-size: 11px;
    font-weight: 600 !important;
    color: #050505;
}

.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Welcome Card */
.welcome-section {
    background: #fff;
    border: 1px solid #c6c6c6ff;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    background: radial-gradient(circle at bottom, #5344fe69 0%, #ffffff 50%);
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.welcome-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.welcome-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.welcome-input-wrapper {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 6px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.welcome-input {
    border: none;
    flex-grow: 1;
    padding: 12px 16px;
    font-size: 16px;
    outline: none;
    color: var(--text-primary);
}

.welcome-input::placeholder {
    color: #9ca3af;
}

.btn-send {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Chat List Section */
.list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.list-controls-right {
    display: flex;
    gap: 10px;
}

.control-input {
    width: 250px;
    padding: 6px 12px 6px 30px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.control-btn {
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Chat List Item */
.chat-item {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}

.chat-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border-color: #d1d5db;
}

.chat-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 15px;
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Model Badge */
.badge-model {
    background-color: #f3f4f6;
    color: #374151;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    border: 1px solid #e5e7eb;
}

.meta-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-dots {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.menu-dots:hover {
    background: #f3f4f6;
}

/* Helper for search icon placement */
.search-icon-wrapper {
    position: relative;
}

.search-icon-wrapper i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
}

@media (max-width: 768px) {

    .welcome-section {
        padding: 30px 20px;
        margin-bottom: 24px;
        border-radius: 15px;
    }

    .welcome-title {
        font-size: 22px;
    }

    .welcome-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .welcome-input-wrapper {
        padding: 4px;
    }

    .welcome-input {
        font-size: 14px;
        padding: 10px;
    }

    /* 2. List Controls: Stack vertical and make input full width */
    .list-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .list-controls-right {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        /* Allows items to wrap on very small screens */
        gap: 10px;
    }

    .search-icon-wrapper {
        flex-grow: 1;
        /* Search bar takes available space */
        width: 100%;
        /* Force full width on mobile */
    }

    .control-input {
        width: 100%;
        /* Input fills the wrapper */
        min-width: unset;
        /* Remove the 250px limit */
    }

    .control-btn {
        flex-grow: 1;
        /* Buttons share remaining space equally */
        justify-content: center;
    }

    .chat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 15px;
    }

    .chat-title {
        width: 100%;
        margin-bottom: 0;
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .chat-meta {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
    }

    .badge-model {
        font-size: 11px;
        padding: 2px 8px;
    }

    .main-content-sec {

        margin-top: 0px !important;
        margin: 0%;
        padding: 0px 0px !important;

    }
}

/* Extra small screens (Phones < 400px) */
@media (max-width: 400px) {
    .chat-meta {
        font-size: 11px;
    }

    .meta-stat i {
        display: none;
        /* Hide icons to save space if needed */
    }
}



/* Chat.php */



:root {
    --primary-blue: #2563EB;
    --primary-blue-hover: #1d4ed8;
    --bg-gradient-start: #F9FAFB;
    --bg-gradient-end: #EFF6FF;
    --text-main: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.main-content {
    margin-left: 280px;
    min-height: 100vh;
    background: radial-gradient(circle at bottom, #5344fe45 0%, #ffffff 60%);
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
}

.chat-navbar {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    margin-right: 24px;
}

.search-wrapper {
    position: relative;
    width: 320px;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    outline: none;
    color: var(--text-main);
}

.search-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
}

.kbd-badge {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    font-size: 10px;
    padding: 2px 6px;
    color: #000000e6;

    font-weight: 600;
}

.btn-new-chat {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.btn-new-chat:hover {
    background-color: var(--primary-blue-hover);
    color: white;
}

.sidebar {
    transition: all 0.3s ease-in-out;

    z-index: 1050;
}

.main-content {
    transition: all 0.3s ease-in-out;

}

@media (min-width: 769px) {

    body.sidebar-hidden .sidebar {
        margin-left: -280px;
    }

    body.sidebar-hidden .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    body:not(.sidebar-hidden) #mainToggle {
        display: none;
    }
}

@media (max-width: 768px) {


    .sidebar {
        margin-left: -280px;
        box-shadow: none;
    }


    .main-content {
        margin-left: 0 !important;
    }


    body.sidebar-mobile-open .sidebar {
        margin-left: 0;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }

    /* Optional: Dim the background when sidebar is open on mobile */
    body.sidebar-mobile-open .main-content {
        opacity: 0.5;
        pointer-events: none;
        /* Prevent clicking content while menu is open */
    }
}

/* chat-finance.php */



/* Logic when sidebar is hidden (Desktop) */
body.sidebar-hidden .main-content {
    margin-left: 0 !important;
    width: 100%;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0 !important;
        /* Always 0 on mobile */
        width: 100%;
        padding: 20px;
        /* Smaller padding for mobile */
    }
}

/* --- Page Specific Styles --- */
:root {
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --btn-teal: #0f766e;
    --btn-teal-hover: #0d9488;
    --bg-banner: #ebebeb;
    --border-color: #e5e7eb;
}

h2 {
    font-weight: 600;
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
}

/* Banner Styles */
.create-banner {
    background-color: var(--bg-banner);
    border-radius: 10px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
    border: 1px solid #f3f4f6;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.banner-icon {
    font-size: 24px;
    color: #374151;
    display: flex;
    align-items: center;
}

.banner-text h5 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.banner-text p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.btn-create {
    background-color: var(--btn-teal);
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    font-size: 14px;
    white-space: nowrap;
    /* Prevent text wrapping */
}

.btn-create:hover {
    background-color: var(--btn-teal-hover);
    color: white;
}

/* Mobile Adjustments for Banner */
@media (max-width: 768px) {
    .create-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .btn-create {
        width: 100%;
    }
}

/* --- Template Cards --- */
.section-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.template-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    background: white;
    min-height: 220px;
}

.template-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    cursor: pointer;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-emoji {
    font-size: 24px;
    margin-top: auto;
}

.emoji-red {
    color: #ef4444;
    font-weight: bold;
}

.emoji-blue {
    color: #3b82f6;
}

/* chat-history.php */

:root {
    --sidebar-width: 280px;
    --sub-sidebar-width: 320px;
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --bg-main: #F8FAFC;
    --text-main: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
}

.move {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 6px;
    /* avoids content hiding behind scrollbar */
}

/* Chrome / Edge / Safari */
.move::-webkit-scrollbar {
    width: 0px;
}

.move::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 10px;
}

.move::-webkit-scrollbar-track {
    background: transparent;
}

.toggle-container {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 12px;
}

.toggle-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    position: relative;
}

.toggle-btn i {
    margin-right: 6px;
}

.toggle-btn.active {
    color: #2563eb;
}


.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}



.library-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
}

/* Toggle Switch */
.toggle-container {
    background: #F1F5F9;
    padding: 4px;
    border-radius: 8px;
    display: flex;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: #ffffff;
    color: var(--text-main);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sub-search {
    position: relative;
    margin-bottom: 24px;
}

.sub-search input {
    width: 100%;
    padding: 8px 30px 8px 32px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
}

.sub-search i.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.sub-search i.filter-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: pointer;
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    color: #94A3B8;
    margin-bottom: 12px;
}

.cat-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s;
    background: #fff;
    cursor: pointer;
}

.cat-item:hover {
    border-color: #cbd5e1;
}

.cat-item.active {
    border-color: var(--primary-blue);
    background-color: #EFF6FF;
}

.cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--primary-blue);
}

.cat-item.active .cat-icon {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.cat-content {
    flex-grow: 1;
    overflow: hidden;
}

.cat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.cat-name {
    font-size: 13px;
    font-weight: 600;
}

.cat-badge {
    font-size: 10px;
    background: #F1F5F9;
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

.cat-desc {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.btn-create-template {
    width: 100%;
    padding: 10px;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    margin-top: 10px;
    transition: background 0.2s;
    z-index: 1000;
}

/* .btn-create-template {
        position: fixed;
        bottom: 0;
        left: 0;
      
    } */

.btn-create-template:hover {
    background: #F1F5F9;
}

/* chay-history-details.php */

:root {
    --sidebar-width: 280px;
    --sub-sidebar-width: 320px;
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --bg-main: #F8FAFC;
    --text-main: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
}


.history-content {
    margin-left: 280px;
    padding: 40px 60px;
    min-height: 100vh;
    background-color: var(--bg-main);
}

.page-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
}

.header-icon-box {
    width: 48px;
    height: 48px;
    background-color: var(--primary-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-right: 16px;
    flex-shrink: 0;
}

.header-details h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-main);
}

.header-details p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Cards */
.template-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.template-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border-color: #cbd5e1;
}

.t-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.t-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.t-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.t-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.t-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.t-actions {
    display: flex;
    gap: 12px;
}

.icon-action {
    color: #94A3B8;
    font-size: 18px;
    cursor: pointer;
}

.icon-action:hover {
    color: var(--text-main);
}

/* chat3.php */
:root {
    --primary-blue: #2563EB;
    --primary-blue-hover: #1d4ed8;
    --bg-gradient-start: #F9FAFB;
    --bg-gradient-end: #EFF6FF;
    --text-main: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}


.chat-navbar {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    margin-right: 24px;
}

.search-wrapper {
    position: relative;
    width: 320px;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    outline: none;
    color: var(--text-main);
}

.search-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
}

.kbd-badge {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    font-size: 10px;
    padding: 2px 6px;
    color: #000000e6;

    font-weight: 600;
}

.btn-new-chat {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.btn-new-chat:hover {
    background-color: var(--primary-blue-hover);
    color: white;
}

/* --- Chat Area --- */
.chat-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px 120px;
    /* Bottom padding for floating input */
    flex-grow: 1;
}

.date-divider {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    position: relative;
}

.date-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #E5E7EB;
    z-index: 0;
}

.date-divider span {
    background: #FBFBFC;
    /* Matches approx gradient top */
    padding: 0 12px;
    position: relative;
    z-index: 1;
}

.msg-block {
    display: flex;
    gap: 16px;
    margin-bottom: 0px;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.msg-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.msg-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.msg-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-text {
    color: #374151;
    font-size: 15px;
    line-height: 1.6;
}

.ai-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-top: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.ai-text {
    color: #374151;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.icon-actions {
    display: flex;
    gap: 4px;
}

.action-icon-btn {
    background: none;
    border: none;
    color: #9CA3AF;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
}

.action-icon-btn:hover {
    background-color: #F3F4F6;
    color: #4B5563;
}

.token-badge {
    background-color: #F3F4F6;
    color: #4B5563;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Audio Player */
.audio-player-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    max-width: 400px;
}

.btn-play {
    color: var(--primary-blue);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.waveform-visual {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 24px;
    flex-grow: 1;
}

.wave-bar {
    width: 3px;
    background-color: #E0E7FF;
    border-radius: 10px;
}

.wave-bar.active {
    background-color: var(--primary-blue);
}

.audio-time {
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Interactive List */
.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.checklist-item:hover {
    background-color: #F9FAFB;
}

.checklist-item.active {
    border-color: var(--primary-blue);
    background-color: #fff;
    /* White bg as per image */
    box-shadow: 0 0 0 1px var(--primary-blue);
}

.drag-dots {
    color: #D1D5DB;
    font-size: 20px;
    cursor: grab;
    display: none;
    /* Hidden by default */
}

.checklist-item:hover .drag-dots,
.checklist-item.active .drag-dots {
    display: block;
}

.custom-check {
    width: 18px;
    height: 18px;
    border: 1.5px solid #D1D5DB;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

/* .checklist-item.active .custom-check {
        background-color: var(--primary-blue);
        border-color: var(--primary-blue);
    } */

.checklist-text {
    font-size: 14px;
    color: #4B5563;
    flex-grow: 1;
}

.checklist-item.active .checklist-text {
    color: #111827;
    font-weight: 500;
}

.btn-add-item {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    cursor: pointer;
    padding: 0;
}

/* --- Floating Input Footer --- */
.input-wrapper-floating {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid #f3f4f6;
}

.helper-text {
    color: #9CA3AF;
    font-size: 14px;
    margin-bottom: 12px;
}

.chat-textarea {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-main);
    resize: none;
    min-height: 40px;
    font-family: inherit;
}

.input-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #F3F4F6;
}

.tool-group-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-library {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

.tool-icon {
    color: #9CA3AF;
    font-size: 18px;
    cursor: pointer;
}

.tool-icon:hover {
    color: #4B5563;
}

.btn-submit {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-submit:hover {
    background-color: var(--primary-blue-hover);
}

@media (max-width: 768px) {
    /* ... other mobile styles ... */

    body.sidebar-mobile-open .sidebar {
        margin-left: 0;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        /* Ensure it sits ON TOP of everything */
    }
}