/**
 * 20250128-CIJEMentor-conversation_sidebar-AL-0001.css
 * Conversation sidebar styling like ChatGPT/Claude
 */

/* =====================================================
   SIDEBAR CONTAINER - Light Blue Style
   ===================================================== */
.conversation-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background: #f0f8ff;
    border-right: 1px solid #d1e7fd;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    color: #333;
    padding-top: 90px;
    box-sizing: border-box;
}

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

/* Main content adjustment when sidebar is open */
.main-content {
    transition: margin-left 0.3s ease-in-out;
    margin-left: 0;
}

.main-content.sidebar-open {
    margin-left: 300px;
}

/* =====================================================
   SIDEBAR HEADER - Light Blue Style
   ===================================================== */
.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid #d1e7fd;
    background: #e6f3ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2c5282;
    font-size: 14px;
}

.sidebar-title i {
    color: #4299e1;
    font-size: 16px;
}

#new-conversation-btn {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #bee3f8;
    background: white;
    color: #2c5282;
    font-size: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

#new-conversation-btn:hover {
    background: #bee3f8;
    border-color: #90cdf4;
}

/* =====================================================
   SIDEBAR TABS - New Section
   ===================================================== */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #d1e7fd;
    background: #f0f8ff;
    position: relative;
    z-index: 1001;
}

.sidebar-tab {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #718096;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.sidebar-tab.active {
    color: #2c5282;
    border-bottom-color: #4299e1;
}

.sidebar-tab:hover {
    color: #2c5282;
    background: #e6f3ff;
}

/* =====================================================
   SEARCH SECTION - Light Blue Style
   ===================================================== */
.sidebar-search {
    padding: 8px 12px;
    border-bottom: 1px solid #d1e7fd;
    background: #f0f8ff;
}

.sidebar-search .form-control {
    border: 1px solid #bee3f8;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    background: white;
    color: #2d3748;
    transition: all 0.2s ease;
}

.sidebar-search .form-control::placeholder {
    color: #718096;
}

.sidebar-search .form-control:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 1px rgba(66, 153, 225, 0.3);
    outline: none;
}

.sidebar-search .btn {
    border-radius: 0 6px 6px 0;
    border: 1px solid #bee3f8;
    border-left: none;
    background: #e6f3ff;
    color: #4299e1;
}

.sidebar-search .btn:hover {
    background: #bee3f8;
    color: #2c5282;
}

/* =====================================================
   SIDEBAR CONTENT - Light Blue Style
   ===================================================== */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    background: #f0f8ff;
}

.conversations-list,
.saved-curriculum-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 0;
}

.saved-curriculum-list {
    display: none;
}

.saved-curriculum-list.active {
    display: flex;
}

/* =====================================================
   CONVERSATION ITEMS - Light Blue Style
   ===================================================== */
.conversation-item {
    display: flex;
    align-items: stretch;
    padding: 8px 12px;
    margin: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: transparent;
    position: relative;
}

.conversation-item:hover {
    background: #e6f3ff;
    border-color: #bee3f8;
}

.conversation-item.active {
    background: #bee3f8;
    border-color: #90cdf4;
}

.conversation-item.active .conversation-title {
    color: #2c5282;
    font-weight: 500;
}

.conversation-item.active .conversation-meta {
    color: #4a5568;
}

.conversation-content {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.conversation-title {
    font-weight: 400;
    font-size: 13px;
    color: #2d3748;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.conversation-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #718096;
    gap: 6px;
}

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

.last-message-date {
    font-size: 11px;
    opacity: 0.8;
}

/* =====================================================
   CONVERSATION ACTIONS
   ===================================================== */
.conversation-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.conversation-item.active .conversation-actions {
    opacity: 1;
}

.conversation-actions .btn {
    padding: 4px 6px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    color: #6c757d;
    transition: all 0.2s ease;
}

.conversation-actions .btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #212529;
}

.conversation-item.active .conversation-actions .btn {
    color: rgba(255, 255, 255, 0.8);
}

.conversation-item.active .conversation-actions .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* =====================================================
   SIDEBAR FOOTER - Light Blue Style
   ===================================================== */
.sidebar-footer {
    padding: 8px 12px;
    border-top: 1px solid #d1e7fd;
    background: #e6f3ff;
}

#toggle-archived-btn {
    color: #718096;
    font-size: 12px;
    text-decoration: none;
    padding: 4px 0;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: color 0.2s ease;
    cursor: pointer;
}

#toggle-archived-btn:hover {
    color: #2c5282;
}

#toggle-archived-btn i {
    margin-right: 6px;
}

/* =====================================================
   SIDEBAR TOGGLE BUTTON - Menu Bar Style
   ===================================================== */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #555;
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    z-index: 1001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.2);
    color: #333;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-toggle.sidebar-open {
    left: 316px;
    background: rgba(240, 248, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
}

/* Tooltip styles */
.sidebar-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.sidebar-toggle:hover::after {
    opacity: 1;
}

/* =====================================================
   EMPTY AND LOADING STATES - ChatGPT Style
   ===================================================== */
.empty-conversations,
.empty-saved-curriculum,
.loading-conversations,
.error-conversations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #718096;
}

.empty-conversations i,
.empty-saved-curriculum i,
.loading-conversations i,
.error-conversations i {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.6;
    color: #4299e1;
}

.empty-conversations p,
.empty-saved-curriculum p,
.loading-conversations span,
.error-conversations p {
    font-weight: 400;
    margin-bottom: 6px;
    color: #4a5568;
    font-size: 13px;
}

.empty-conversations small,
.empty-saved-curriculum small,
.error-conversations small {
    font-size: 11px;
    opacity: 0.7;
    color: #718096;
}

/* =====================================================
   SAVED CURRICULUM ITEMS
   ===================================================== */
.saved-curriculum-item {
    display: flex;
    align-items: stretch;
    padding: 8px 12px;
    margin: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: transparent;
    position: relative;
}

.saved-curriculum-item:hover {
    background: #e6f3ff;
    border-color: #bee3f8;
}

.saved-curriculum-item .curriculum-content {
    flex: 1;
    min-width: 0;
}

.saved-curriculum-item .curriculum-title {
    font-weight: 400;
    font-size: 13px;
    color: #2d3748;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.saved-curriculum-item .curriculum-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #718096;
    gap: 6px;
}

.saved-curriculum-item .curriculum-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.saved-curriculum-item:hover .curriculum-actions {
    opacity: 1;
}

.saved-curriculum-item .curriculum-actions .btn {
    padding: 4px 6px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    color: #718096;
    transition: all 0.2s ease;
    cursor: pointer;
}

.saved-curriculum-item .curriculum-actions .btn:hover {
    background: #bee3f8;
    color: #2c5282;
}

.loading-conversations i {
    animation: spin 1s linear infinite;
}

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

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 768px) {
    .conversation-sidebar {
        width: 280px;
    }
    
    .sidebar-toggle.sidebar-open {
        left: 300px;
    }
    
    .conversation-item {
        padding: 10px 12px;
        margin: 0 6px;
    }
    
    .conversation-title {
        font-size: 13px;
    }
    
    .conversation-meta {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .conversation-sidebar {
        width: 100vw;
        max-width: 320px;
    }
    
    .sidebar-toggle {
        top: 16px;
        left: 16px;
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
    
    .sidebar-toggle.sidebar-open {
        left: calc(100vw - 60px);
        max-width: 280px;
    }
}

/* =====================================================
   MAIN CONTENT ADJUSTMENT
   ===================================================== */
.main-content-with-sidebar {
    margin-left: 300px;
    transition: margin-left 0.3s ease-in-out;
}

.main-content-with-sidebar.sidebar-hidden {
    margin-left: 0;
}

/* =====================================================
   SCROLLBAR STYLING
   ===================================================== */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* =====================================================
   DARK MODE SUPPORT (Optional)
   ===================================================== */
@media (prefers-color-scheme: dark) {
    .conversation-sidebar {
        background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
        border-right-color: #4a5568;
        color: #e2e8f0;
    }
    
    .sidebar-header {
        background: #2d3748;
        border-bottom-color: #4a5568;
    }
    
    .sidebar-title {
        color: #e2e8f0;
    }
    
    .sidebar-search {
        background: #2d3748;
        border-bottom-color: #4a5568;
    }
    
    .sidebar-search .form-control {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .conversation-item:hover {
        background: #4a5568;
        border-color: #718096;
    }
    
    .conversation-title {
        color: #e2e8f0;
    }
    
    .conversation-meta {
        color: #a0aec0;
    }
    
    .sidebar-footer {
        background: #2d3748;
        border-top-color: #4a5568;
    }
}

/* =====================================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ===================================================== */
@media (max-width: 768px) {
    .conversation-sidebar {
        padding-top: 80px; /* Slightly less padding on mobile */
    }
} 