/* ========================================
   SIDEBAR STRUCTURE - CORRECT LAYOUT
   ======================================== */

/* Sidebar - Main Container */
.sidebar {
    width: 320px;
    background: #1e293b;
    border-right: 1px solid #334155;
    overflow: hidden; /* No scroll on main sidebar */
    transition: transform 0.3s ease;
    margin-top: 0;
    position: relative;
    z-index: 100;
    display: flex;
    flex-direction: column;
    height: 100vh; /* Full height */
}

/* Logo Section - White Background for Full Section */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 21px; /* Balanced padding */
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff; /* White background for entire logo area */
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.logo-icon {
    height: 36px; /* Slightly larger for better visibility */
    width: auto; /* Let it scale naturally */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon img {
    height: 100%;
    width: auto;
    display: block;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 16px; /* Slightly smaller */
    font-weight: 700;
    margin: 0;
    color: #0f172a; /* Dark text on white background */
}

.logo-text p {
    font-size: 11px;
    color: #64748b; /* Gray subtitle */
    margin: 0;
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.logo-text p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

/* Full logo image */
.logo-full {
    height: 32px;
    width: auto;
    object-fit: contain;
}

/* Progress Section - Fixed */
.sidebar-progress {
    background: #0f172a;
    padding: 16px 24px;
    border-bottom: 1px solid #334155;
    flex-shrink: 0; /* Don't shrink */
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 13px;
    color: #cbd5e1;
    font-weight: 500;
}

.progress-percent {
    font-size: 13px;
    font-weight: bold;
    color: #06b6d4;
}

/* Progress Bar with Animation */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #334155;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes progressPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transition: width 0.5s ease;
    animation: progressPulse 2s infinite;
    position: relative;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.progress-text {
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}

/* Breadcrumb Navigation - Fixed */
.breadcrumb-navigation {
    padding: 12px 24px;
    border-bottom: 1px solid #334155;
    background: rgba(15, 23, 42, 0.5);
    flex-shrink: 0;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.breadcrumb-item:not(.active):hover {
    background: rgba(59, 130, 246, 0.1);
    cursor: pointer;
}

.breadcrumb-separator {
    color: #64748b;
    margin: 0 4px;
    font-weight: 300;
}


/* Module Info - Fixed */
.module-info {
    padding: 16px 24px;
    border-bottom: 1px solid #334155;
    background: rgba(15, 23, 42, 0.5);
    flex-shrink: 0;
}

.module-info h2 {
    font-size: 16px;
    margin-bottom: 4px;
    color: white;
}

.module-info p {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
    margin: 0;
}

/* SCROLLABLE CONTAINER - Contains both modules and features */
.sidebar-scrollable {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Module Selector - Compact, always visible, NO SCROLL */
.module-selector {
    padding: 12px 24px;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}

.module-selector h3 {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Reset Buttons Section */
.reset-buttons-section {
    padding: 12px 24px;
    border-top: 1px solid #334155;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Hotspot List - Takes remaining space with scroll */
.hotspot-list {
    padding: 16px 24px 24px 24px;
    flex-shrink: 0;
    display: none; /* Hidden - features panel is now above screenshot */
}

.hotspot-list h3 {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Reset Progress Button - MOVED TO TOP */
.reset-progress-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #475569;
    color: #94a3b8;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    font-weight: 500;
}

.reset-progress-btn:hover {
    background: #475569;
    color: white;
    border-color: #64748b;
}

.reset-progress-btn svg {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

/* Reset All Button - אדום מסוכן */
.reset-all-progress-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    font-weight: 500;
}

.reset-all-progress-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #dc2626;
}
/* ========================================
   MODULE TREE - COMPACT & COLLAPSED
   ======================================== */

/* Module Tree Container */
.module-tree {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Tree Item */
.tree-item {
    margin: 0;
    padding: 0;
}

/* Tree Item Header - COMPACT WITH HOVER */
.tree-item-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    padding-left: 9px;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 6px;
    margin: 1px 0;
    user-select: none;
    color: #cbd5e1;
    position: relative;  /* ⬅️ הוסף */
}

.tree-item-header:hover {
    background: rgba(59, 130, 246, 0.15);  /* ⬅️ כחול שקוף */
    color: white;
    border-left: 3px solid #3b82f6;  /* ⬅️ פס כחול */
    padding-left: 9px;  /* ⬅️ פיצוי על הבורדר */
}

.tree-item-header.active {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: white;
    font-weight: 600;
    border-left: none;
}

.header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid #334155;
    padding: 16px 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);  /* ⬅️ צל */
}

/* Expand/Collapse Arrow */
.tree-arrow {
    width: 16px; /* Smaller */
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s;
    color: #94a3b8;
}

.tree-arrow.expanded {
    transform: rotate(90deg);
}

.tree-arrow.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Icon - Smaller */
.tree-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* Title */
.tree-title {
    flex: 1;
    font-size: 12px; /* Smaller */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Child Count Badge */
.tree-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);  /* ירוק בוהק */
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 40px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);  /* צל */
}

/* Recycle Icon - Reset Module Progress */
.tree-recycle-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.tree-item-header:hover .tree-recycle-icon {
    opacity: 1;
}

.tree-recycle-icon:hover {
    color: #ef4444;
    transform: rotate(180deg);
    opacity: 1;
}

.tree-item-header.active .tree-recycle-icon {
    opacity: 0.7;
    color: rgba(255, 255, 255, 0.8);
}

.tree-item-header.active:hover .tree-recycle-icon {
    opacity: 1;
    color: #ff6b6b;
}


/* Children Container - Collapsed by default */
.tree-children {
    padding-left: 16px; /* Reduced */
    display: none;
}

.tree-children.expanded {
    display: block;
}

/* Depth Indicators - COMPACT */
.tree-item.depth-1 .tree-item-header {
    padding-left: 16px; /* Reduced */
    font-size: 11px;
}

.tree-item.depth-2 .tree-item-header {
    padding-left: 32px; /* Reduced */
    font-size: 10px;
}

/* Highlight parent when child is active */
.tree-item.in-active-path > .tree-item-header {
    background: rgba(59, 130, 246, 0.1);
    border-left: 2px solid #3b82f6;
}

/* Connection Lines - Thinner */
.tree-children {
    position: relative;
}

.tree-children::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 8px;
    width: 1px;
    background: #334155;
}

.tree-item.depth-1 .tree-item-header::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 50%;
    width: 10px;
    height: 1px;
    background: #334155;
}

/* ========================================
   HOTSPOT CARDS - COMPACT
   ======================================== */

/* Hotspot Cards Container */
.hotspot-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Hotspot Card - PRIMARY NAVIGATION */
.hotspot-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 2px solid #1e293b;
    position: relative;
    overflow: hidden; /* Hidden when collapsed */
}

.hotspot-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: all 0.15s ease;
}

.hotspot-card:hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.hotspot-card:hover::before {
    background: #3b82f6;
}

.hotspot-card.active {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-color: #3b82f6;
    box-shadow: 
        0 0 0 3px rgba(59, 130, 246, 0.3),
        0 8px 24px rgba(59, 130, 246, 0.4);
    transform: translateX(6px);
    padding: 16px 18px; /* More padding when expanded */
    align-items: flex-start; /* Allow content to stack */
    overflow: hidden; /* Keep overflow hidden to maintain fixed height */
}

.hotspot-card.active::before {
    background: #60a5fa;
    width: 5px;
}

/* Expanded content layout */
.hotspot-card.active .hotspot-content {
    flex: 1;
    min-width: 0;
}

.hotspot-card.active .hotspot-title {
    margin-bottom: 8px; /* Space between title and description */
    font-size: 14px; /* Slightly larger when active */
    font-weight: 600;
    white-space: normal; /* Allow title to wrap if needed */
}

/* Hotspot Number - SMALLER */
.hotspot-number {
    width: 36px; /* Reduced from 44px */
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px; /* Reduced from 18px */
    color: white;
    flex-shrink: 0;
    margin-top: 0; /* Align to top when card expands */
    transition: all 0.15s ease;
}

/* Hotspot Content */
.hotspot-content {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word; /* Allow long words to break */
    word-wrap: break-word; /* Fallback for older browsers */
}

.hotspot-title {
    font-size: 13px; /* Reduced from 14px */
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
}

.hotspot-card.active .hotspot-title {
    white-space: normal; /* Allow wrapping when expanded */
    overflow: visible;
    text-overflow: unset;
}

.hotspot-desc {
    font-size: 11px; /* Reduced from 12px */
    color: #94a3b8;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Show 2 lines when collapsed */
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.15s ease;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* When card is active, description shows more but still limited unless expanded */
.hotspot-card.active .hotspot-desc {
    display: -webkit-box !important;
    -webkit-line-clamp: 3; /* Show 3 lines when active but not expanded */
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    line-height: 1.6;
    margin-top: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* When description is expanded via show more button */
.hotspot-desc.expanded {
    display: block !important;
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Show more button */
.show-more-btn {
    background: transparent;
    border: none;
    color: #60a5fa;
    font-size: 11px;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
    text-align: left;
    transition: color 0.15s ease;
    font-weight: 500;
}

.show-more-btn:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.hotspot-card.active .show-more-btn {
    color: #93c5fd;
    font-size: 12px;
}

/* Check Icon */
.check-icon {
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.hotspot-card .check-icon[style*="display: block"] {
    opacity: 1;
    transform: scale(1);
}

/* Hide old elements */
.hotspot-item {
    display: none !important;
}

#hotspotList > svg:not(.check-icon) {
    display: none !important;
}

/* Color Classes */
.color-blue { background: #3b82f6; }
.color-purple { background: #a855f7; }
.color-orange { background: #f97316; }
.color-green { background: #10b981; }
.color-pink { background: #ec4899; }
.color-yellow { background: #eab308; }
.color-cyan { background: #06b6d4; }
.color-indigo { background: #6366f1; }
.color-red { background: #ef4444; }

/* Reset Progress Button - COMPACT */
.reset-progress-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #475569;
    color: #94a3b8;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-weight: 500;
}

.reset-progress-btn:hover {
    background: #475569;
    color: white;
    border-color: #64748b;
}

.reset-progress-btn svg {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

/* ========================================
   SIDEBAR CARD ANIMATIONS
   ======================================== */

/* Subtle shimmer effect on unvisited cards */
.hotspot-card:not(.active):hover {
    animation: cardShimmer 1.5s ease-in-out;
}

@keyframes cardShimmer {
    0% {
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    }
    100% {
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
    }
}