/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base styles */
body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.8;
    color: #1a1a1a;
    background-color: #fafafa;
}

html {
    overflow-x: clip;
}


/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1rem;
}


/* Palette grid */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

@media (min-width: 768px) {
    .palette-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .palette-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Palette card */
.palette-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.palette-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #1a1a1a;
}

/* Color preview */
.color-preview {
    display: flex;
    height: 100px;
}

.color-swatch {
    flex: 1;
    cursor: pointer;
    position: relative;
    transition: flex 0.3s ease;
}

.color-swatch:hover {
    flex: 1.5;
}

.color-swatch::after {
    content: attr(data-color);
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.color-swatch:hover::after {
    opacity: 1;
}

.color-swatch.copied::after {
    content: 'Copied!';
    background: #10b981;
}

/* Palette content */
.palette-content {
    padding: 1.5rem;
}

/* Palette header */
.palette-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.palette-title {
    font-size: 1.25rem;
    color: #1a1a1a;
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}

.palette-category {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Palette description */
.palette-description {
    color: #666;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Color list */
.color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.color-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    background-color: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.color-chip:hover {
    background-color: #e8e8e8;
    border-color: #ccc;
}

.color-chip.copied {
    background-color: #d1fae5;
    border-color: #10b981;
}

.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.color-hex {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #333;
}

/* Code section */
.code-section {
    margin-top: 1rem;
}

.code-block .property {
    color: #a6e22e;
}

.code-block .value {
    color: #e6db74;
}

.code-block .comment {
    color: #75715e;
}

/* Utility classes */
.text-center {
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .palette-grid {
        grid-template-columns: 1fr;
    }
    
    .color-preview {
        height: 80px;
    }
    
    .nav-link {
        margin: 0 0.5rem;
        font-size: 0.8rem;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
}


.format-toggle {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.format-btn {
    padding: 0.5rem 0.875rem;
    border: none;
    background: #fff;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
    color: #888;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.format-btn + .format-btn {
    border-left: 1px solid #e0e0e0;
}

.format-btn.active {
    background-color: #1a1a1a;
    color: #fff;
}

.format-btn:hover:not(.active) {
    background-color: #f5f5f5;
    color: #333;
}


.palette-count {
    font-size: 0.75rem;
    color: #bbb;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Palette actions (category + favorite btn) */
.palette-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}


/* Filter state */
.palette-card.hidden {
    display: none;
}

.category-section.all-hidden {
    display: none;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-size: 0.9rem;
    display: none;
}

.no-results.visible {
    display: block;
}
