/* 🎨 Color Palette Gallery Plugin - Ultra-Modern Design System */

.cpg-gallery-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    color: #0f172a;
}

/* Category Filter Bar */
.cpg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
    justify-content: center;
}

.cpg-filter-btn {
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.cpg-filter-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.cpg-filter-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

/* Grid Layout */
.cpg-palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

/* Card Container */
.cpg-palette-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cpg-palette-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.09);
    border-color: #cbd5e1;
}

/* Swatch Strip Bar */
.cpg-swatch-strip {
    display: flex;
    height: 155px;
    width: 100%;
    cursor: pointer;
    position: relative;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

.cpg-swatch-col {
    flex: 1;
    height: 100%;
    position: relative;
    transition: flex 0.35s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
}

.cpg-swatch-col:hover {
    flex: 1.6;
}

.cpg-swatch-hex {
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 3px 8px;
    border-radius: 8px;
}

.cpg-swatch-name {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.95;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 92%;
}

/* Card Header & Content */
.cpg-card-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.cpg-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cpg-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.cpg-category-badge {
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpg-card-desc {
    font-size: 14px;
    line-height: 1.5;
    color: #64748b;
    margin-bottom: 16px;
    flex-grow: 1;
}

/* Actions Toolbar & Buttons */
.cpg-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.cpg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.cpg-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.cpg-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}

.cpg-btn-secondary {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.cpg-btn-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateY(-2px);
}

/* Single Palette Detailed View Component */
.cpg-single-palette-view {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    padding: 40px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.04);
    margin-bottom: 40px;
}

.cpg-single-header {
    margin-bottom: 28px;
}

.cpg-single-title {
    font-size: 34px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.cpg-smooth-gradient-banner {
    height: 200px;
    border-radius: 22px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cpg-smooth-gradient-banner:hover {
    transform: scale(1.005);
    box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}

.cpg-hero-swatch {
    display: flex;
    height: 190px;
    border-radius: 22px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.cpg-hero-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: flex 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 14px;
}

.cpg-hero-col:hover {
    flex: 1.6;
}

.cpg-hero-hex {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 10px;
}

.cpg-hero-name {
    font-size: 13.5px;
    font-weight: 600;
    opacity: 0.95;
    margin-top: 6px;
    text-align: center;
}

/* Dynamic Colors Brief Grid */
.cpg-brief-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 20px 0;
    letter-spacing: -0.3px;
}

.cpg-color-brief-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 40px;
}

.cpg-brief-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cpg-brief-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    background: #ffffff;
    border-color: #cbd5e1;
}

.cpg-brief-color-dot {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.cpg-brief-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cpg-brief-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
}

.cpg-brief-hex {
    font-size: 13.5px;
    font-weight: 800;
    color: #2563eb;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cpg-brief-hex:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.cpg-brief-meta {
    font-size: 12px;
    color: #64748b;
    font-family: monospace, sans-serif;
}

/* Download Formats Section */
.cpg-download-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 24px 28px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.02);
}

.cpg-download-label {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.cpg-download-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Related Color Palettes & Harmonies Grid */
.cpg-related-palettes-section {
    margin-top: 45px;
    padding-top: 35px;
    border-top: 1px dashed #e2e8f0;
}

.cpg-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* Toast Notification */
.cpg-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #0f172a;
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    animation: cpgSlideUp 0.3s ease;
}

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

@media (max-width: 768px) {
    .cpg-single-palette-view {
        padding: 24px 18px;
    }
    .cpg-palette-grid,
    .cpg-related-grid {
        grid-template-columns: 1fr;
    }
    .cpg-download-box {
        flex-direction: column;
        align-items: flex-start;
    }
}
