/* Simple Component Types Legend Styles */

.component-legend {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-interactive);
    border: 2px solid var(--border-primary);
    border-radius: 0px;
    padding: 12px 16px;
    box-shadow: 2px 2px 0 var(--shadow-primary);
    z-index: 100;
    min-width: 180px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bg-secondary);
    cursor: pointer;
    user-select: none;
}

.legend-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
}

.legend-collapse-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    transform: rotate(-90deg);
}

.legend-collapse-btn:hover {
    color: var(--text-primary);
}

.component-legend.collapsed .legend-collapse-btn {
    transform: rotate(0deg);
}

.component-legend.collapsed .legend-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.component-legend.collapsed .legend-items {
    max-height: 0;
    opacity: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-box {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
    border: 1.5px solid var(--accent-white-20);
}

.legend-item span {
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .component-legend {
        top: 10px;
        right: 10px;
        padding: 10px 12px;
        min-width: 160px;
    }
    
    .legend-header h4 {
        font-size: 11px;
    }
    
    .legend-items {
        gap: 7px;
    }
    
    .legend-box {
        width: 20px;
        height: 14px;
    }
    
    .legend-item span {
        font-size: 11px;
    }
}

/* Canvas Credit Footer */
.canvas-credit {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--bg-interactive);
    border: 2px solid var(--border-primary);
    border-radius: 0px;
    padding: 8px 12px;
    box-shadow: 2px 2px 0 var(--shadow-primary);
    z-index: 100;
    font-family: var(--font-bios);
    font-size: 12px;
    color: var(--text-tertiary);
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.canvas-credit a {
    color: var(--cta-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.canvas-credit a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .canvas-credit {
        bottom: 10px;
        left: 10px;
        padding: 6px 10px;
        font-size: 10px;
    }
}
