/**
 * Enhanced Left Sidebar CSS - Clean Implementation
 * Supports always-visible icons that disappear on hover
 */

/* System State Classes */
.sidebar-system .left-sidebar {
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-system .sidebar-floating-toggle {
    display: none !important;
}

/* Icon Preview System */
.sidebar-icon-preview {
    position: fixed;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: all;
}

.preview-icon {
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(239,68,68,0.5);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 24px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    transform-origin: center;
}

.preview-icon:hover {
    transform: scale(1.1);
    border-color: rgba(239,68,68,0.8);
    box-shadow: 0 12px 30px rgba(239,68,68,0.3);
    color: #f87171;
}

.preview-icon:focus {
    outline: 2px solid rgba(239,68,68,0.6);
    outline-offset: 4px;
}

.icon-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(239,68,68,0.2), transparent);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.preview-icon:hover .icon-background {
    opacity: 1;
}

.icon-tooltip {
    position: absolute;
    left: calc(100% + 20px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(239,68,68,0.3);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    pointer-events: none;
}

.preview-icon:hover .icon-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(10px);
}

/* Edge Indicator */
.sidebar-edge-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 3px;
    height: 100vh;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(239,68,68,0.4) 20%, 
        rgba(239,68,68,0.6) 80%, 
        transparent 100%);
    z-index: 999;
    opacity: 0.8;
    transition: all 0.3s ease;
}

/* Hover Zone */
.sidebar-hover-zone {
    position: fixed;
    top: 0;
    left: 0;
    width: 100px;
    height: 100vh;
    z-index: 1001;
    background: transparent;
    cursor: pointer;
}

/* Animations */
@keyframes iconPulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    }
    50% {
        box-shadow: 0 8px 25px rgba(239,68,68,0.2), 0 0 0 4px rgba(239,68,68,0.1);
    }
}

.preview-icon:not(.user-discovered) {
    animation: iconPulse 4s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar-icon-preview {
        left: 10px;
        gap: 15px;
    }
    
    .preview-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .sidebar-hover-zone {
        width: 80px;
    }
}

@media (max-width: 480px) {
    .sidebar-icon-preview {
        left: 8px;
        gap: 12px;
    }
    
    .preview-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .sidebar-hover-zone {
        width: 70px;
    }
    
    .icon-tooltip {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* High DPI Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .preview-icon {
        backdrop-filter: blur(15px);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .preview-icon,
    .sidebar-icon-preview,
    .sidebar-edge-indicator {
        transition: none;
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .preview-icon {
        background: rgba(0,0,0,0.9);
        border-color: rgba(239,68,68,0.6);
    }
    
    .icon-tooltip {
        background: rgba(0,0,0,0.98);
        border-color: rgba(239,68,68,0.4);
    }
}
