/* =========================================================
   Color Format Converter — color-converter.css
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; }

.cc-tool-wrapper {
    padding: 10px 0 60px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1a1a2e;
    background: #f8f9fc;
    min-height: 70vh;
}

/* ── Hero ────────────────────────────────────────────── */
.cc-hero {
    text-align: center;
    margin-bottom: 10px;
}

.cc-hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #111 0%, #444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cc-hero p {
    font-size: 1.1rem;
    color: #666;
    max-width: 620px;
    margin: 0 auto;
}

/* ── Generic Card ────────────────────────────────────── */
.cc-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    margin-bottom: 18px;
}

.cc-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #999;
    margin-bottom: 14px;
}

.cc-card-hint {
    font-size: 0.83rem;
    color: #888;
    margin-top: -8px;
    margin-bottom: 14px;
}

/* ── Main Input ──────────────────────────────────────── */
.cc-input-card { padding-bottom: 18px; }

.cc-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cc-main-input {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 13px 16px;
    font-size: 1rem;
    font-family: 'Inter', monospace;
    font-weight: 500;
    color: #111;
    outline: none;
    transition: border-color 0.2s;
    background: #fafafa;
}

.cc-main-input:focus {
    border-color: #6366f1;
    background: #fff;
}

.cc-color-picker {
    width: 50px;
    height: 48px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 3px;
    cursor: pointer;
    background: #fff;
    flex-shrink: 0;
}

.cc-error {
    margin-top: 8px;
    font-size: 0.82rem;
    color: #ef4444;
    font-weight: 500;
}

/* ── Swatch Bar ──────────────────────────────────────── */
.cc-swatch-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.cc-swatch {
    width: 90px;
    height: 90px;
    border-radius: 14px;
    background: #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    flex-shrink: 0;
    transition: background 0.25s ease;
}

.cc-swatch-label {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.cc-swatch-named {
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}

/* ── Format Output Grid ──────────────────────────────── */
.cc-formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.cc-format-card {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cc-format-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 14px rgba(99,102,241,0.1);
}

.cc-format-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
}

.cc-format-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    padding-right: 28px;
}

.cc-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    font-size: 0.85rem;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.cc-copy-btn:hover {
    color: #6366f1;
    background: #eef2ff;
}

.cc-copy-btn.copied {
    color: #22c55e;
}

/* ── Sliders ─────────────────────────────────────────── */
.cc-slider-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.cc-slider-row:last-child { margin-bottom: 0; }

.cc-slider-row label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
    min-width: 130px;
    white-space: nowrap;
}

.cc-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

.cc-slider-hue {
    background: linear-gradient(to right,
        hsl(0,100%,50%), hsl(30,100%,50%), hsl(60,100%,50%),
        hsl(90,100%,50%), hsl(120,100%,50%), hsl(150,100%,50%),
        hsl(180,100%,50%), hsl(210,100%,50%), hsl(240,100%,50%),
        hsl(270,100%,50%), hsl(300,100%,50%), hsl(330,100%,50%), hsl(360,100%,50%));
}

.cc-slider-sat {
    background: linear-gradient(to right, #ccc, #6366f1);
}

.cc-slider-lit {
    background: linear-gradient(to right, #000, #888, #fff);
}

.cc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 2.5px solid #6366f1;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.15s;
}

.cc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* ── WCAG Contrast Checker ───────────────────────────── */
.cc-contrast-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.cc-contrast-field {
    flex: 1;
}

.cc-contrast-field label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    display: block;
    margin-bottom: 6px;
}

.cc-contrast-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s;
}

.cc-contrast-input-wrap:focus-within {
    border-color: #6366f1;
}

.cc-mini-swatch {
    width: 36px;
    height: 36px;
    display: block;
    flex-shrink: 0;
    background: #000;
    transition: background 0.2s;
}

.cc-contrast-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: #111;
    min-width: 0;
}

.cc-mini-picker {
    width: 34px;
    height: 34px;
    border: none;
    padding: 2px;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}

.cc-contrast-preview {
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
    font-size: 0.95rem;
    font-weight: 500;
    background: #ffffff;
    color: #000000;
    border: 1.5px solid #e5e7eb;
    transition: background 0.25s, color 0.25s;
    min-height: 54px;
    display: flex;
    align-items: center;
}

.cc-contrast-result {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.cc-ratio-display {
    font-size: 0.9rem;
    color: #444;
    font-weight: 600;
}

.cc-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cc-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.cc-badge-pass {
    background: #dcfce7;
    color: #16a34a;
}

.cc-badge-fail {
    background: #fee2e2;
    color: #dc2626;
}

.cc-btn-use-color {
    width: 100%;
    padding: 10px;
    border: 1.5px dashed #d1d5db;
    border-radius: 9px;
    background: none;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6366f1;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.cc-btn-use-color:hover {
    background: #eef2ff;
    border-color: #6366f1;
}

/* ── Quick Presets ───────────────────────────────────── */
.cc-presets-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.cc-preset {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 9px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.cc-preset:hover {
    transform: scale(1.18);
    border-color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

/* ── Toast ───────────────────────────────────────────── */
.cc-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -44%) scale(0.88);
    background: #111;
    color: #fff;
    padding: 13px 22px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 99999;
    box-shadow: 0 8px 30px rgba(0,0,0,0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    max-width: 90vw;
}

.cc-toast i { color: #4ade80; flex-shrink: 0; }
.cc-toast--visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ── SEO Section ─────────────────────────────────────── */
.cc-seo-section {
    padding: 40px 0 20px;
    border-top: 1px solid #e5e7eb;
}

.cc-seo-section h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 3px solid #6366f1;
    display: inline-block;
}

.cc-seo-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 8px;
    padding-left: 12px;
    border-left: 4px solid #6366f1;
}

.cc-seo-section p, .cc-seo-section li {
    font-size: 0.93rem;
    color: #555;
    line-height: 1.75;
}

.cc-seo-section code {
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.88rem;
    color: #6366f1;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 576px) {
    .cc-hero h1 { font-size: 1.9rem; }
    .cc-contrast-inputs { flex-direction: column; }
    .cc-formats-grid { grid-template-columns: 1fr 1fr; }
    .cc-presets-grid { grid-template-columns: repeat(6, 1fr); }
    .cc-swatch { width: 70px; height: 70px; }
    .cc-swatch-label { font-size: 1.1rem; }
}
