/* Production Summary */
.production-summary-content {
    max-width: 90%;
    width: 1000px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.production-summary-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
}

.summary-section {
    margin-bottom: 25px;
}

.summary-section-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tree */
.summary-tree {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    padding-left: 20px;
}

.tree-line {
    display: flex;
    align-items: center;
    padding: 6px 0;
    position: relative;
    min-height: 32px;
}

/* Level-based styling with cleaner positioning */
.tree-line.level-0 {
    background-color: rgba(88, 166, 255, 0.03);
    border-radius: 4px;
    padding: 6px 8px;
    margin-left: 0;
}

.tree-line.level-1 {
    background-color: rgba(63, 185, 80, 0.03);
    border-radius: 4px;
    padding: 6px 8px;
    margin-left: 20px;
    position: relative;
}

.tree-line.level-2 {
    background-color: rgba(248, 81, 73, 0.03);
    border-radius: 4px;
    padding: 6px 8px;
    margin-left: 40px;
    position: relative;
}

.tree-line.level-3 {
    background-color: rgba(139, 148, 158, 0.03);
    border-radius: 4px;
    padding: 6px 8px;
    margin-left: 60px;
    position: relative;
}

.tree-line.level-4 {
    background-color: rgba(88, 166, 255, 0.03);
    border-radius: 4px;
    padding: 6px 8px;
    margin-left: 80px;
    position: relative;
}

.tree-line.level-5 {
    background-color: rgba(63, 185, 80, 0.03);
    border-radius: 4px;
    padding: 6px 8px;
    margin-left: 100px;
    position: relative;
}

.tree-line.level-6 {
    background-color: rgba(248, 81, 73, 0.03);
    border-radius: 4px;
    padding: 6px 8px;
    margin-left: 120px;
    position: relative;
}

.tree-line.level-7 {
    background-color: rgba(139, 148, 158, 0.03);
    border-radius: 4px;
    padding: 6px 8px;
    margin-left: 140px;
    position: relative;
}

.tree-line.level-8 {
    background-color: rgba(88, 166, 255, 0.03);
    border-radius: 4px;
    padding: 6px 8px;
    margin-left: 160px;
    position: relative;
}

.tree-line.level-9 {
    background-color: rgba(63, 185, 80, 0.03);
    border-radius: 4px;
    padding: 6px 8px;
    margin-left: 180px;
    position: relative;
}

.tree-line.level-10 {
    background-color: rgba(248, 81, 73, 0.03);
    border-radius: 4px;
    padding: 6px 8px;
    margin-left: 200px;
    position: relative;
}

/* Improved toggle buttons with MD icons */
.tree-toggle {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: rgba(139, 148, 158, 0.9);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 1;
    border: none;
    transition: all 0.2s ease;
}

.tree-toggle:hover {
    color: var(--accent-blue);
    transform: translateY(-50%) scale(1.2);
}

.tree-toggle.collapsed::before {
    content: '\e145';
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

.tree-toggle.expanded::before {
    content: '\e15b';
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

.tree-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.tree-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.tree-name {
    flex: 0 0 auto;
    color: var(--text-primary);
    font-size: 14px;
    min-width: 50px;
}

.tree-rate {
    color: rgba(139, 148, 158, 0.7);
    font-size: 13px;
    min-width: 60px;
}

.tree-machine {
    color: var(--accent-blue);
    font-size: 12px;
    min-width: 100px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tree-machine-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.tree-transport {
    color: rgba(139, 148, 158, 0.5);
    font-size: 11px;
    min-width: 35px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.tree-transport-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

/* Crafting Details - Inline */
.tree-craft-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 3px 6px;
    background-color: rgba(48, 54, 61, 0.2);
    border-radius: 3px;
    font-size: 11px;
    color: rgba(139, 148, 158, 0.8);
}

.tree-craft-flow {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.tree-craft-item {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 1px 4px;
    background-color: rgba(48, 54, 61, 0.6);
    border-radius: 2px;
    font-size: 10px;
}

.tree-craft-icon {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

.tree-arrow {
    color: rgba(139, 148, 158, 0.4);
    font-size: 11px;
    margin: 0 2px;
}

/* Children Container */
.tree-children {
    margin-left: 20px;
    position: relative;
}

.tree-children.collapsed {
    display: none;
}

/* Shared Items */
.shared-items {
    padding: 15px;
    background-color: rgba(48, 54, 61, 0.3);
    border-radius: 6px;
    margin-top: 10px;
}

.shared-items-header {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.shared-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 2px 6px 2px 0;
    padding: 2px 6px;
    background-color: rgba(88, 166, 255, 0.1);
    border-radius: 3px;
    font-size: 12px;
}

.shared-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* Waste Section */
.waste-section {
    margin-top: 15px;
}

.waste-header {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--accent-orange);
}

.waste-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background-color: rgba(248, 81, 73, 0.03);
    border-radius: 4px;
    margin-bottom: 4px;
    min-height: 32px;
}

/* Button */
#production-summary-btn {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    font-size: 14px;
    padding: 10px;
    font-weight: bold;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .production-summary-content {
        max-width: 95%;
        width: 100%;
        max-height: 90vh;
    }
    
    .production-summary-container {
        padding: 15px;
        font-size: 13px;
    }
    
    .tree-line {
        padding: 8px 0;
        min-height: 36px;
    }
    
    .tree-content {
        gap: 6px;
    }
    
    .tree-rate {
        min-width: 50px;
        font-size: 12px;
    }
    
    .tree-machine {
        min-width: 80px;
        font-size: 11px;
    }
    
    .tree-craft-inline {
        margin-left: 8px;
        font-size: 10px;
    }
    
    .tree-line.level-1 {
        margin-left: 10px;
    }
    
    .tree-line.level-2 {
        margin-left: 20px;
    }
    
    .tree-line.level-3 {
        margin-left: 30px;
    }
    
    .tree-line.level-4 {
        margin-left: 40px;
    }
    
    .tree-line.level-5 {
        margin-left: 50px;
    }
    
    .tree-line.level-6 {
        margin-left: 60px;
    }
    
    .tree-line.level-7 {
        margin-left: 70px;
    }
    
    .tree-line.level-8 {
        margin-left: 80px;
    }
    
    .tree-line.level-9 {
        margin-left: 90px;
    }
    
    .tree-line.level-10 {
        margin-left: 100px;
    }
    
    .tree-children {
        margin-left: 10px;
    }
    
    .tree-toggle {
        left: -12px;
        width: 18px;
        height: 18px;
    }
    
    .tree-toggle.collapsed::before,
    .tree-toggle.expanded::before {
        font-size: 18px;
    }
    
    .waste-item {
        padding: 8px;
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    .production-summary-container {
        padding: 10px;
    }
    
    .tree-line.level-1 {
        margin-left: 5px;
    }
    
    .tree-line.level-2 {
        margin-left: 10px;
    }
    
    .tree-line.level-3 {
        margin-left: 15px;
    }
    
    .tree-line.level-4 {
        margin-left: 20px;
    }
    
    .tree-line.level-5 {
        margin-left: 25px;
    }
    
    .tree-line.level-6 {
        margin-left: 30px;
    }
    
    .tree-line.level-7 {
        margin-left: 35px;
    }
    
    .tree-line.level-8 {
        margin-left: 40px;
    }
    
    .tree-line.level-9 {
        margin-left: 45px;
    }
    
    .tree-line.level-10 {
        margin-left: 50px;
    }
    
    .tree-children {
        margin-left: 5px;
    }
    
    .tree-rate {
        min-width: 45px;
    }
    
    .tree-machine {
        min-width: 70px;
    }
}