.sidebar {
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    top: 0%;
    height: 100dvh;
    width: 260px;
    z-index: 1;
    padding-bottom: 20px;

    /* Semi-transparent background */


    /* Subtle shadow */

    animation: slideOutSidebar 0.2s ease-in-out;

    hr {
        width: 90%;
        box-shadow: 0 4px 6px rgba(var(--bg-color1), 114, 0.1);
        border-color: rgba(var(--bg-color1), 0.144);
    }
}

.sidebar-2 {
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    top: 0%;
    height: 100vh;
    width: 60px;
    z-index: 1;
    padding-top: 10px;
    padding-bottom: 20px;
    animation: slideInSidebar 0.2s ease-in-out;

}


.sidebar-2-bottom-cont {
    position: absolute;
    bottom: 1%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 1000;

    hr {
        width: 90%;
        box-shadow: 0 4px 6px rgba(var(--bg-color1), 114, 0.1);
        border-color: rgba(var(--bg-color1), 0.144);
    }
}

.sidebar-2-top-cont {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-height: 84dvh;
}

.top-cont-scroll {
    overflow-y: scroll;
}

.slogo-cont {
    top: 5px;
}


label {
    text-align: left;
    width: 90%;
    font-size: 14px;
}

.date-label {
    color: rgb(163, 161, 161);
    font-size: 14px;
}

@keyframes slideInSidebar {
    from {
        width: 260px;
    }

    to {
        width: 60px;
    }
}

@keyframes slideOutSidebar {
    from {
        width: 60px;

    }

    to {
        width: 260px;
    }
}


.sidebar-button {
    display: flex;
    width: 94%;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    align-items: center;
    justify-content: left;
    padding: 8px 8px;
    gap: 10px;
    font-size: 14px;
    height: 36px;
    white-space: nowrap;

    &:hover {
        background: rgba(94, 129, 173, 0.2);
    }

    transition: background 0.2s ease-in-out;

    animation: slideOutSidebarButton 0.2s ease-in-out;
}

.close-sidebar {
    position: absolute;
    right: 2%;
}

.sidebar-button-2 {
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    padding: 5px;
    gap: 10px;
    font-size: 14px;
    height: 40px;
    width: 40px;

    &:hover {
        background: rgba(94, 129, 173, 0.2);
    }

    transition: background 0.2s ease-in-out;
    animation: slideInSidebarButton 0.2s ease-in-out;
}

.sidebar-button-2::after {
    content: '';
    position: absolute;
    left: calc(100% + 10px);
    /* Center vertically */
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    z-index: 1000;
    min-width: max-content;
    /* Ensure tooltip doesn't shrink */
}

.sidebar-button-2:hover::after {
    content: attr(data-tooltip);
    opacity: 1;
}

.toggle-sidebar {
    display: none;
}

.sidebar-2:hover .toggle-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-2:hover .slogo-cont {
    display: none;
}


.search-chat-btn {
    position: relative;
    display: flex;
    width: 95%;
    border: none;
    cursor: pointer;
    border-radius: 20px;
    align-items: center;
    justify-content: left;
    padding: 10px 20px;
    gap: 10px;
    font-size: 14px;
    white-space: nowrap;


    background: rgba(94, 129, 173, 0.2);


    transition: background 0.2s ease-in-out;

    animation: slideOutSidebarButton 0.2s ease-in-out;

    input {
        background: none;
        border: none;
        outline: none;
    }
}

.history-panel {
    position: absolute;

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
    top: 60px;
    gap: 5px;
    width: 100%;
    height: 85dvh;



    label {
        height: 30px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: left;
        text-align: left;
        padding: 2px;
        gap: 5px;
    }
}

.history-panel-cont {
    position: relative;

    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: left;
    text-align: left;
    bottom: 0%;
    gap: 10px;
    width: 100%;
    height: 95%;
    overflow-y: scroll;

    overflow-x: hidden;
}

.history-date-group {
    position: relative;

    padding-bottom: 0px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    bottom: 0%;
    gap: 2px;
    width: 100%;
    height: auto;
    overflow: none;
}

.history-box {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: left;
    align-items: flex-start;
    text-align: left;
    border-radius: 10px;
    padding: 8px 8px;
    cursor: pointer;
    width: 94%;
    white-space: nowrap;
    font-size: 14px;
    height: 36px;

    p {
        display: flex;
        overflow-x: hidden;
        width: 98%;
        text-align: left;
    }

}

.history-box:hover {
    background: rgba(94, 129, 173, 0.2);

    p {
        width: 90%;
        text-overflow: ellipsis;
    }

    .chath-menu-btn {
        display: flex;

    }
}



.chath-menu-btn {
    position: absolute;
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 1;
    top: 0%;
    right: 0%;
    height: 100%;
    width: 30px;
    padding: 1px;
    border-radius: 5px;

}


.chath-menu {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 1;
    gap: 5px;
    right: 5%;
    top: 80%;
    height: 30px;
    padding: 5px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(var(--bg-color1), 0.1);
    /* Subtle shadow */

    width: 130px;
    height: auto;

    hr {
        width: 98%;
        box-shadow: 0 4px 6px rgba(114, 114, 114, 0.1);
        border-color: rgba(128, 128, 128, 0.144);
    }
}

.chath-menu-list {
    position: relative;
    display: flex;
    flex-direction: row;
    font-size: 12px;
    padding: 10px 15px;
    border-radius: 10px;
    width: 98%;
    gap: 10px;
}

.chath-menu-list:hover {
    background: rgba(128, 128, 128, 0.24);

    cursor: pointer;
}

.delete {
    color: #e5383b;
}

.delete:hover {
    background: #e5383b46;
}

.sidebar-dropdown-cont {
    position: relative;
    top: 0%;
    left: 5%;
    display: flex;
    flex-direction: column;
    max-height: 30vh;
    width: 90%;
    height: auto;
    align-items: flex-start;
    gap: 2px;

    hr {
        width: 98%;
        box-shadow: 0 4px 6px rgba(var(--bg-color1), 114, 0.1);
        border-color: rgba(var(--bg-color1), 0.144);
    }

    border-left: 2px solid rgba(94, 129, 173, 0.2);
}

.dropdown-list {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 15px;
    width: 90%;
    gap: 10px;
    margin-left: 5px;
    border-radius: 10px;
    height: 36px;
}

.dropdown-list:hover {
    background: rgba(94, 129, 173, 0.2);

    cursor: pointer;
}

.expand-sidebar-icon {
    position: absolute;
    right: 20px;
    display: flex;
}

.account-btn {
    position: relative;
    bottom: 0px;
    height: 50px;
    border-radius: 20px;
    text-align: left;

    span.plan {
        font-size: 10px;
        color: gray;
    }

    &:hover {
        box-shadow: none;
    }
}

.avatar {
    border-radius: 50%;
    height: 100%;
    width: 100%;

}

.profile-sidebar-cont {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    bottom: 5%;
    left: 60px;
}

@keyframes slideInSidebarButton {
    from {
        width: 95%;
    }

    to {
        width: 30px;
    }
}

@keyframes slideOutSidebarButton {
    from {
        width: 30px;
    }

    to {
        width: 95%;
    }
}



@media screen and (max-width: 1000px) {


    .sidebar-2 {
        display: none;
    }

}

@media screen and (max-width: 360px) {


    .profile-sidebar-cont {
        left: 5px;
    }

}

html.dark {

    .sidebar,
    .sidebar-2 {
        background: linear-gradient(to right, #1C273B, #191E2B);
    }

    .sidebar-button-2:hover::after {
        background: linear-gradient(to right, #D6E2FB, #E3EBFD);
        color: var(--prop-dark-bg);
    }
}

html.light {

    .sidebar,
    .sidebar-2 {
        background: linear-gradient(to right, #D6E2FB, #E3EBFD);
    }

    .sidebar-button-2:hover::after {
        background: linear-gradient(to right, #1C273B, #191E2B);
        color: var(--prop-white-bg);
    }
}
.profile-sidebar-body {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 10px;
    border-radius: 20px;
    width: min(250px, 90vw);
    max-width: 280px;
    min-width: 160px;
    height: auto;
    z-index: 1;
    bottom: 30px;
    border: 1px solid rgba(var(--bg-color1), 0.3);
    -webkit-backdrop-filter: blur(50px);
            backdrop-filter: blur(50px);


    hr {
        width: 98%;
        box-shadow: 0 4px 6px rgba(var(--bg-color1), 0.1);
        border-color: rgba(var(--bg-color1), 0.144);
    }
}

.profile-btn {
    width: 98%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    border-radius: 10px;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
    gap: 10px;
    z-index: 10;
    font-size: clamp(12px, 2.5vw, 14px);
    transition: background-color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-btn:hover {
    background: rgba(94, 129, 173, 0.2);
}

.upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #4a80ef, #6c9dff);
    box-shadow: 0 4px 12px rgba(74, 128, 239, 0.4);
    transition: all 0.25s ease;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #3d6fd6, #5b8fff);
    box-shadow: 0 6px 16px rgba(74, 128, 239, 0.5);
}

.upgrade-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(74, 128, 239, 0.3);
}

/* User Details Section */
.user-details {
    width: 98%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.2s ease;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-icon {
    color: rgba(94, 129, 173, 0.7);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    width: 100%;
}

.user-name {
    font-weight: 600;
    font-size: clamp(12px, 2vw, 12px);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

.user-email {
    font-size: clamp(10px, 2.2vw, 11px);
    color: var(--text-secondary);
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
}

.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 600;
    border-radius: 50%;
    background-color: rgba(94, 129, 173, 0.2);
    color: rgba(94, 129, 173, 1);
    font-size: clamp(12px, 2.5vw, 14px);
    transition: all 0.2s ease;
}

.logout-btn {
    width: 98%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    border-radius: 10px;
    text-align: left;
    padding: 10px;
    cursor: pointer;
    gap: 10px;
    z-index: 10;
    font-size: clamp(12px, 2.5vw, 14px);
    color: #e5383b;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn:hover {
    background: #e5383bb0;
    color: white;
}

.logout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.15s ease-out;
}

.logout-modal-content {
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideIn 0.2s ease-out;
    border: 1px solid var(--border-color, #e5e7eb);
}

.logout-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.logout-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.logout-modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.logout-modal-close-btn:hover:not(:disabled) {
    background-color: var(--bg-color1);
}

.logout-modal-close-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.logout-modal-body {
    padding: 20px 24px;
}

.logout-modal-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.logout-modal-actions {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
    justify-content: flex-end;
}

.logout-modal-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    min-width: 80px;
    justify-content: center;
}

.logout-cancel-btn {
    background-color: transparent;
    border-color: var(--border-color, #e5e7eb);
}

.logout-cancel-btn:hover:not(:disabled) {
    background-color: white;
    color: rgba(var(--bg-color1));
}

.logout-confirm-btn {
    background-color: #dc2626;
    color: white;
    border-color: #dc2626;
}

.logout-confirm-btn:hover:not(:disabled) {
    background-color: #b91c1c;
    border-color: #b91c1c;
}

.logout-modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner for loading state */
.logout-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

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

/* Dark theme */
html.dark {

    /* .profile-sidebar-body {
        background: linear-gradient(to right, #1C273B, #191E2B);
        box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.25),
            0 4px 10px rgba(0, 0, 0, 0.1),
            inset 0 1px 1px rgba(255, 255, 255, 0.05);
    } */
    .logout-modal-content {
        background: linear-gradient(to right, #1C273B, #191E2B);
        box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.25),
            0 4px 10px rgba(0, 0, 0, 0.1),
            inset 0 1px 1px rgba(255, 255, 255, 0.05);
    }

    .user-avatar {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .avatar-icon {
        color: rgba(255, 255, 255, 0.6);
    }

    .user-name {
        color: rgba(255, 255, 255, 0.95);
    }

    .user-email {
        color: rgba(255, 255, 255, 0.7);
    }

    .avatar-initials {
        background-color: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.9);
    }
}

/* Light theme */
html.light {

    /* .profile-sidebar-body {
        background: linear-gradient(to right, #D6E2FB, #E3EBFD);
        box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.1),
            0 4px 12px rgba(0, 0, 0, 0.06),
            inset 0 2px 4px rgba(255, 255, 255, 0.6);
    } */
    .logout-modal-content {
        background: linear-gradient(to right, #D6E2FB, #E3EBFD);
        box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.1),
            0 4px 12px rgba(0, 0, 0, 0.06),
            inset 0 2px 4px rgba(255, 255, 255, 0.6);
    }

    .user-avatar {
        background: rgba(94, 129, 173, 0.08);
        border-color: rgba(94, 129, 173, 0.15);
    }

    .avatar-icon {
        color: rgba(94, 129, 173, 0.8);
    }

    .user-name {
        color: rgba(28, 39, 59, 0.95);
    }

    .user-email {
        color: rgba(28, 39, 59, 0.7);
    }

    .avatar-initials {
        background-color: rgba(94, 129, 173, 0.15);
        color: rgba(94, 129, 173, 0.9);
    }
}

/* Tablet breakpoint */
@media screen and (max-width: 768px) {
    .profile-sidebar-body {
        padding: 12px;
        border-radius: 16px;
        gap: 8px;
    }

    .profile-btn,
    .logout-btn {
        gap: 12px;
        border-radius: 12px;
    }

    .user-details {
        padding: 10px 0;
    }
}

/* Mobile breakpoint */
@media screen and (max-width: 480px) {

    .profile-btn,
    .logout-btn {
        border-radius: 10px;
        font-size: clamp(14px, 3vw, 16px);
    }


    .logout-btn {
        padding: 15px 12px;
    }

}

/* Extra small screens */
@media screen and (max-width: 320px) {
    .profile-sidebar-body {
        border-radius: 10px;
    }

    .profile-btn,
    .logout-btn {
        font-size: 14px;
    }
}

/* Landscape orientation adjustments */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .profile-sidebar-body {
        top: 10px;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        padding: 8px;
        gap: 4px;
    }

    .profile-btn,
    .logout-btn {
        padding: 8px 10px;
        gap: 8px;
    }

    .user-details {
        gap: 4px;
        padding: 4px 0;
    }

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

    .user-name {
        font-size: 13px;
    }

    .user-email {
        font-size: 11px;
    }

    .avatar-initials {
        font-size: 14px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .profile-sidebar-body {
        box-shadow:
            0 4px 10px rgba(0, 0, 0, 0.15),
            0 2px 5px rgba(0, 0, 0, 0.05),
            inset 0 1px 1px rgba(255, 255, 255, 0.1);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {

    .profile-btn,
    .logout-btn {
        min-height: 44px;
        /* iOS accessibility guideline */
        padding: 12px 15px;
    }

    .profile-btn:active {
        background: rgba(94, 129, 173, 0.3);
        transform: scale(0.98);
    }

    .logout-btn:active {
        background: #e5383bb0;
        color: white;
        transform: scale(0.98);
    }

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

}
