/*
CHANGE LOG
File: /static/css/wbs_sidebar.css
Document Type: CSS Stylesheet
Purpose: Enhanced visual design for WBS sidebar (no class/functionality changes)
Main App: aburi_app.py
Blueprint / Route Context: /wbs and /wbs/sectionXX
Related Templates: wbs_master.html, partials/_wbs_sidebar.html
Related JS: /static/js/wbs_sidebar.js
Version History:
2025-11-19 v1.2 - Enhanced visual design to match main content elegance
2025-11-18 v1.1 - Added indent by WBS level, collapse behavior, and content margin
2025-11-17 v1.0 - Initial simple sidebar styling
*/

/* Base body reset with elegant typography */
body {
    margin: 0;
    font-family: "EB Garamond", "Garamond", "Times New Roman", serif;
}

/* Enhanced fixed sidebar with sophisticated gradient */
/* In your wbs_sidebar.css, update the #wbs-sidebar rule: */
#wbs-sidebar {
    width: 280px;
    background: linear-gradient(135deg, #0f3460 0%, #1a4a7a 25%, #2c5282 50%, #3182ce 100%);
    color: white;
    height: calc(100vh - 80px); /* Adjust height to account for navbar */
    position: fixed;
    left: 0;
    top: 80px; /* Start below navbar instead of top: 0 */
    padding: 0;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    font-family: "EB Garamond", "Garamond", serif;
}

/* Enhanced sidebar header */
.wbs-sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    background: linear-gradient(135deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.1) 100%);
    text-align: center;
}

.wbs-sidebar-header h3 {
    margin: 0 0 8px 0;
    color: white;
    font-size: 1.4em;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.wbs-sidebar-header p {
    margin: 0;
    color: rgba(255,255,255,0.85);
    font-size: 0.95em;
    font-style: italic;
    opacity: 0.9;
}

/* Elegant top-level section containers - no underlines, more spacing */
.wbs-parent {
    border-bottom: none; /* Remove underlines from primary menu */
    transition: all 0.3s ease;
    margin-bottom: 4px; /* Add space between sections */
}

.wbs-parent:hover {
    background: rgba(255,255,255,0.05);
}

.wbs-parent-label {
    padding: 20px 20px; /* Increased from 18px for less crowded feeling */
    cursor: pointer;
    font-weight: 500;
    font-size: 0.98rem;
    background: linear-gradient(135deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.08) 100%);
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    border-radius: 4px; /* Add subtle rounding for modern look */
    margin: 2px 4px; /* Add margins for breathing room */
}

.wbs-parent-label:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.06) 100%);
    transform: translateX(2px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

/* Refined arrow indicator - much smaller */
.wbs-parent-label::after {
    content: "▶";
    font-size: 0.6rem; /* Much smaller triangles */
    opacity: 0.6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* OPTIONAL: Uncomment the lines below to completely remove triangles */
/*
.wbs-parent-label::after {
    display: none;
}
*/

.wbs-parent.wbs-open > .wbs-parent-label::after {
    transform: rotate(90deg);
    opacity: 1;
    color: rgba(255,255,255,0.95);
}

/* Container styling (unchanged functionality) */
.wbs-children:not(.wbs-expanded) {
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.02) 100%);
}

.wbs-children:not(.wbs-expanded) {
    display: none;
}

/* Enhanced individual items with elegant typography */
.wbs-item {
    display: block;
    color: rgba(255,255,255,0.92);
    text-decoration: none !important;
    padding: 16px 24px 16px 30px; /* Double spacing */
    font-size: 0.88rem;
    cursor: pointer;
    border-bottom: none; /* Remove underlines */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.2px;
    position: relative;
}

.wbs-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
    transition: width 0.3s ease;
}

.wbs-item:hover {
    background: linear-gradient(to right, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 100%);
    color: white;
    text-decoration: none;
    transform: translateX(3px);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    border-left: 3px solid rgba(255,255,255,0.4);
}

.wbs-item:hover::before {
    width: 3px;
}

/* Enhanced active state */
.wbs-item.wbs-active {
    background: linear-gradient(to right, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.15) 100%);
    color: white;
    border-left: 4px solid rgba(255,255,255,0.8);
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.1);
}

/* Main content area styling (unchanged) */
.wbs-main-content {
    margin-left: 280px;
    min-height: 100vh;
    background: white;
}

.wbs-main-content main {
    padding: 40px;
}

/* Enhanced deeper level styling */
.wbs-item[data-wbs-level="2"] {
    padding-left: 40px;
    font-size: 0.85rem;
    opacity: 0.95;
}

.wbs-item[data-wbs-level="3"] {
    padding-left: 50px;
    font-size: 0.82rem;
    opacity: 0.9;
}

.wbs-item[data-wbs-level="4"] {
    padding-left: 60px;
    font-size: 0.8rem;
    opacity: 0.88;
}

.wbs-item[data-wbs-level="5"] {
    padding-left: 70px;
    font-size: 0.78rem;
    opacity: 0.85;
}

/* Custom scrollbar for webkit browsers */
#wbs-sidebar::-webkit-scrollbar {
    width: 6px;
}

#wbs-sidebar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

#wbs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

#wbs-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Responsive design (unchanged functionality) */
@media (max-width: 900px) {
    #wbs-sidebar {
        position: static;
        width: 100%;
        height: auto;
        box-shadow: none;
    }
    .wbs-main-content {
        margin-left: 0;
    }
}

/* Add subtle animations for modern feel */
.wbs-parent {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-5px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Focus states for accessibility */
.wbs-item:focus,
.wbs-parent-label:focus {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: -2px;
}

#wbs-sidebar a {
    text-decoration-color: #2c5282 !important;
}
