/* Palette Library Styles */

/* Hero Section */
.palette-hero {
    text-align: center;
    padding: 60px 20px 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 40px;
}

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

.palette-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Category Filter */
.category-filter {
    margin-bottom: 40px;
}

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

.filter-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;
}

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

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

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

.search-box 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-box input:focus {
    outline: none;
    border-color: var(--primary);
}

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

/* Palette Grid */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.palette-card {
    background: var(--bg-primary);
    border-radius: 16px;
    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;
}

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

.palette-preview {
    display: flex;
    height: 120px;
}

.palette-color {
    flex: 1;
    height: 100%;
    transition: flex 0.2s ease;
}

.palette-color:hover {
    flex: 1.5;
}

.palette-info {
    padding: 20px;
}

.palette-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.palette-category {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.palette-colors-preview {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.palette-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.palette-color-swatch:hover {
    transform: scale(1.1);
}

.palette-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.palette-actions button {
    flex: 1;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-copy:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-view {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: white;
}

.btn-view:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Load More */
.load-more-container {
    text-align: center;
    padding: 20px;
}

#load-more-btn {
    padding: 12px 48px;
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 40px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    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;
}

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

.modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

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

.modal-palette-preview {
    display: flex;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-color-list {
    margin-bottom: 32px;
}

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

.color-item:hover {
    background: var(--bg-tertiary);
}

.color-swatch {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin-right: 16px;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.color-info {
    flex: 1;
}

.color-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.color-values {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

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

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

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions button {
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.category-badge.ui {
    background: #e0e7ff;
    color: #4f46e5;
}

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

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

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

/* Responsive */
@media (max-width: 768px) {
    .palette-hero {
        padding: 40px 16px 30px;
    }
    
    .palette-hero h1 {
        font-size: 2rem;
    }
    
    .palette-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-tabs {
        gap: 8px;
    }
    
    .filter-tab {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .modal-content {
        padding: 24px;
        width: 95%;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions button {
        width: 100%;
    }
}

/* 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);
}
