/* ===== Sidebar Styles - Conversation History ===== */

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.88);
    border-right: 1px solid rgba(74, 144, 226, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease;
    z-index: 1200;
    box-shadow: 2px 0 16px rgba(70, 130, 200, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding-bottom: 40px;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: width;
}

.sidebar.collapsed {
    width: 0;
    border-right: none;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(74, 144, 226, 0.12);
    background: transparent;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    background: transparent;
}

.conversation-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--brown-dark);
}

.conversation-item:hover {
    background: #F0F7FF;
    border-color: rgba(74, 144, 226, 0.2);
}

.conversation-item.active {
    background: #E8F4FD;
    border-color: var(--blue);
}

.conversation-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brown-dark);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-meta {
    font-size: 0.85rem;
    color: var(--brown-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-delete {
    padding: 0.25rem 0.5rem;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.6rem;
    opacity: 0;
    transition: all 0.15s ease;
    font-weight: 600;
}

.conversation-item:hover .conversation-delete {
    opacity: 1;
}

.conversation-delete:hover {
    background: #dc2626;
    color: white;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(74, 144, 226, 0.12);
    text-align: center;
    font-size: 0.6rem;
    color: var(--brown-light);
    background: transparent;
}

/* Toggle sidebar button */
.toggle-sidebar-button {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateZ(0);
    background: linear-gradient(180deg, var(--orange-light) 0%, var(--orange) 100%);
    color: white;
    border: none;
    border-radius: 0 12px 12px 0;
    padding: 1rem 0.5rem;
    cursor: pointer;
    z-index: 1100;
    transition: left 0.3s ease;
    font-size: 1.2rem;
    box-shadow: 4px 0 12px rgba(74, 144, 226, 0.3);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* When sidebar is expanded, button follows */
.sidebar:not(.collapsed)~.toggle-sidebar-button {
    left: 280px;
}

.toggle-sidebar-button:hover {
    transform: translateY(-50%) translateZ(0) translateX(2px);
    box-shadow: 6px 0 16px rgba(74, 144, 226, 0.4);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(92, 64, 51, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .sidebar { padding-bottom: 34px; }
}

@media (max-width: 375px) {
    .sidebar { padding-bottom: 30px; }
}
