/* Custom Light Sidebar Theme - High Contrast Update */
.sidebar-wrapper {
    background: #fafaf9 !important;
    box-shadow: 0 0 15px rgba(120, 113, 108, 0.08);
    border-right: 1px solid #e7e5e4;
}
.sidebar-wrapper .logo-wrapper {
    background: #fafaf9 !important;
    border-bottom: 1px solid #e7e5e4;
}
.sidebar-wrapper .logo-icon-wrapper {
    background: #fafaf9 !important;
}

/* Sidebar Links - High Contrast */
.sidebar-wrapper .sidebar-main .sidebar-links .sidebar-list .sidebar-link,
.sidebar-wrapper .sidebar-main .sidebar-links .sidebar-list .sidebar-title,
.sidebar-wrapper .sidebar-main .sidebar-links .sidebar-list .sidebar-link span,
.sidebar-wrapper .sidebar-main .sidebar-links .sidebar-list .sidebar-title span {
    color: #2b2b2b !important; /* Darker gray almost black */
    font-weight: 500 !important; /* Make text bolder */
}

/* Hover State */
.sidebar-wrapper .sidebar-main .sidebar-links .sidebar-list .sidebar-link:hover,
.sidebar-wrapper .sidebar-main .sidebar-links .sidebar-list .sidebar-title:hover,
.sidebar-wrapper .sidebar-main .sidebar-links .sidebar-list .sidebar-link:hover span,
.sidebar-wrapper .sidebar-main .sidebar-links .sidebar-list .sidebar-title:hover span {
    color: #000000 !important; /* Pure black on hover */
    font-weight: 600 !important;
}

/* Adjust icon colors */
.sidebar-wrapper svg {
    stroke: #59667a !important; /* Dark slate text color for icons */
}
.sidebar-wrapper .sidebar-main .sidebar-links .sidebar-list .sidebar-link:hover svg {
    stroke: #000 !important;
}

/* Active Highlight - Keep text/icon white inside the colored active box */
.sidebar-wrapper .sidebar-list.active .sidebar-link {
    /* Usually has a background-color from the main theme, keep text white */
    
}
.sidebar-wrapper .sidebar-list.active .sidebar-link span {
    color: #fff !important;
}
.sidebar-wrapper .sidebar-list.active .sidebar-link svg {
    stroke: #fff !important; 
}

/* Profile Section Text */
.profile-section .profile-wrapper h4 {
    color: #1f2f3e !important; /* Dark blue/black */
    font-weight: 700 !important;
} 
.profile-section .profile-wrapper span {
    color: #59667a !important; /* Subtitle slightly lighter but readable */
}
.profile-section {
    border-bottom: 1px solid #f0f0f0;
}
.profile-section svg {
    stroke: #59667a !important;
}

/* Sidebar Search - Fix Placeholder Visibility */
.sidebar-search .form-control {
    background-color: #f6f7fb !important;
    border: 1px solid #e0e0e0 !important;
    color: #2b2b2b !important; /* Input text color */
}
.sidebar-search .input-group-text {
    background-color: #f6f7fb !important;
    border: 1px solid #e0e0e0 !important;
}
.sidebar-search svg {
    stroke: #59667a !important;
}

/* Placeholder Styling - Critical for visibility */
.sidebar-search .form-control::placeholder {
    color: #666666 !important; /* Dark Gray for placeholder */
    opacity: 1 !important;
}
.sidebar-search .form-control::-webkit-input-placeholder {
    color: #666666 !important;
}
.sidebar-search .form-control::-moz-placeholder {
    color: #666666 !important;
}
.sidebar-search .form-control:-ms-input-placeholder {
    color: #666666 !important;
}

/* Back Button */
.sidebar-wrapper .back-btn i {
    color: #2b2b2b !important;
}

/* Branch Lines - Fix visibility on light background */
.sidebar-wrapper .sidebar-main .sidebar-links .sidebar-list .sidebar-submenu > li > a::after {
    border-top-color: #64748b !important;
}

/* Sidebar Search Styling - Seamless look */
.sidebar-wrapper .sidebar-search .input-group-text {
    background-color: transparent !important;
    border: none !important; /* Remove ALL internal borders */
    padding-right: 12px !important; /* Add space between icon and text */
    padding-left: 15px !important;
}

.sidebar-wrapper .sidebar-search .form-control {
    border: none !important; /* Remove ALL internal borders */
    background-color: transparent !important;
    color: #2b2b2b !important;
    box-shadow: none !important; /* Remove focus shadow if any */
}

.sidebar-wrapper .sidebar-search .input-group {
    background-color: rgba(0, 0, 0, 0.03) !important; 
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important; /* Single outer border only */
}

/* Headers like - Pinned, - General */

/* --- AI Floating Panel Styles --- */
#aiToolbar {
    position: absolute;
    width: 380px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #e1e4e8;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.ai-panel-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-menu-list {
    padding: 8px 0;
    list-style: none;
    margin: 0;
    max-height: 350px;
    overflow-y: auto;
}

.ai-menu-item {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    transition: background 0.15s;
}

.ai-menu-item:hover {
    background: #f3f4f6;
}

.ai-menu-icon {
    width: 18px;
    text-align: center;
    font-size: 16px;
}

/* Result State */
.ai-result-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #24292e;
    background: #fff;
    max-height: 250px;
    overflow-y: auto;
    border-bottom: 1px solid #f0f0f0;
}

.ai-actions-footer {
    padding: 12px 16px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-action-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ai-input-refine {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}
.ai-input-refine:focus {
    border-color: #7366ff;
    box-shadow: 0 0 0 2px rgba(115, 102, 255, 0.2);
}

.btn-ai-secondary {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-ai-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-ai-primary {
    background: linear-gradient(135deg, #7366ff 0%, #b06ab3 100%); /* Yuri Gradient */
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-left: auto;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(115, 102, 255, 0.3);
}
.btn-ai-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Processing State */
.ai-loading {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
}
.ai-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top-color: #7366ff;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
