/* Color Chart Styles */

/* Hero Section */
.chart-hero {
    text-align: center;
    padding: 60px 20px 40px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 40px;
}

.chart-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.chart-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Controls */
.chart-controls {
    margin-bottom: 40px;
}

.category-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    justify-content: center;
}

.category-tab {
    padding: 10px 24px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.category-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.search-container {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.search-container input {
    width: 100%;
    padding: 12px 44px 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-container svg {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.color-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.color-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.color-swatch-large {
    height: 100px;
    width: 100%;
    transition: height 0.2s ease;
}

.color-card:hover .color-swatch-large {
    height: 120px;
}

.color-info {
    padding: 12px;
}

.color-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.color-hex {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Consolas', monospace;
}

.color-category {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

/* Color Panel (Sidebar) */
.color-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.color-panel.active {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 1;
}

.panel-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close:hover {
    background: var(--primary);
    color: white;
}

.panel-content {
    padding: 24px;
}

.panel-color-preview {
    width: 100%;
    height: 160px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.panel-content h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.panel-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
    font-size: 14px;
}

/* Color Formats */
.color-formats {
    margin-bottom: 32px;
}

.format-row {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s ease;
}

.format-row:hover {
    background: var(--bg-tertiary);
}

.format-label {
    width: 60px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

.format-row code {
    flex: 1;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: var(--text-primary);
    background: transparent;
    padding: 0;
}

.copy-format-btn {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.copy-format-btn:hover {
    background: var(--primary-dark);
}

/* Similar Colors */
.similar-colors h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.similar-swatch {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.similar-swatch:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge.web {
    background: #dbeafe;
    color: #2563eb;
}

.category-badge.basic {
    background: #fef3c7;
    color: #d97706;
}

.category-badge.pantone {
    background: #fce7f3;
    color: #db2777;
}

.category-badge.chinese {
    background: #d1fae5;
    color: #059669;
}

/* Responsive */
@media (max-width: 768px) {
    .chart-hero {
        padding: 40px 16px 30px;
    }
    
    .chart-hero h1 {
        font-size: 2rem;
    }
    
    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .color-swatch-large {
        height: 80px;
    }
    
    .color-card:hover .color-swatch-large {
        height: 100px;
    }
    
    .category-tabs {
        gap: 8px;
    }
    
    .category-tab {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .color-panel {
        width: 100%;
        right: -100%;
    }
    
    .similar-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Panel Overlay */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.panel-overlay.active {
    opacity: 1;
    visibility: visible;
}
