/* allpaintcolours.co.uk — minimal tool aesthetic */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111;
    background: #fff;
    line-height: 1.5;
    font-size: 15px;
}

a {
    color: #111;
    text-decoration: underline;
}
a:hover {
    color: #555;
}

/* Layout */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */

header {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}
header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.site-title {
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}
nav a {
    margin-left: 20px;
    text-decoration: none;
    font-size: 14px;
    color: #555;
}
nav a:hover {
    color: #111;
}

/* Page header */

.page-header {
    padding: 24px 0 16px;
}
.page-header h1 {
    font-size: 22px;
    font-weight: 700;
}
.page-header p {
    color: #666;
    font-size: 14px;
    margin-top: 4px;
}

/* Colour grid (browse page) */

.colour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 2px;
}
.colour-card {
    text-decoration: none;
    display: block;
}
.colour-card .swatch {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid #eee;
}
.colour-card .info {
    padding: 4px 2px;
}
.colour-card .colour-name {
    font-size: 11px;
    font-weight: 600;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.colour-card .manufacturer {
    font-size: 10px;
    color: #888;
    display: block;
}

/* Filters (browse page) */

.filters {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 16px;
}
.filter-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 20px;
    flex-wrap: wrap;
}
.filter-group label {
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
}
.filter-group input[type="checkbox"] {
    margin: 0;
}
.filter-title {
    font-size: 12px;
    font-weight: 700;
    color: #555;
}

/* Search */

.search-box {
    position: relative;
    margin-bottom: 16px;
}
.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    font-size: 14px;
    font-family: inherit;
}
.search-box input:focus {
    outline: 2px solid #333;
    outline-offset: -1px;
}
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.search-results-dropdown.active {
    display: block;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}
.search-result-item:hover {
    background: #f8f8f8;
}
.search-result-item .mini-swatch {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border: 1px solid #eee;
}
.search-result-item .result-name {
    font-size: 13px;
    font-weight: 600;
}
.search-result-item .result-brand {
    font-size: 11px;
    color: #888;
}

/* Colour detail page */

.colour-detail {
    padding: 24px 0;
}
.colour-hero {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.colour-hero .large-swatch {
    width: 300px;
    height: 300px;
    border: 1px solid #eee;
    flex-shrink: 0;
}
.colour-hero .colour-info {
    flex: 1;
    min-width: 250px;
}
.colour-hero .colour-info h1 {
    font-size: 28px;
    margin-bottom: 4px;
}
.colour-number {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}
.colour-manufacturer {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}
.colour-price {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}
.colour-hex {
    font-size: 13px;
    color: #888;
    font-family: monospace;
    margin-bottom: 16px;
}
.sample-link {
    display: inline-block;
    padding: 8px 20px;
    background: #111;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
}
.sample-link:hover {
    background: #333;
    color: #fff;
}

/* Matches section */

.matches-section {
    margin-bottom: 30px;
}
.matches-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
}
.match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.match-card {
    border: 1px solid #eee;
    text-decoration: none;
    display: block;
}
.match-card .swatch-row {
    display: flex;
    height: 80px;
}
.match-card .swatch-main {
    width: 40%;
    height: 100%;
}
.match-card .swatch-match {
    width: 60%;
    height: 100%;
}
.match-card .match-info {
    padding: 8px;
}
.match-card .match-name {
    font-size: 13px;
    font-weight: 600;
    display: block;
}
.match-card .match-brand {
    font-size: 11px;
    color: #888;
}
.match-card .match-delta {
    font-size: 11px;
    margin-top: 4px;
}

/* Delta E badges */

.delta-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 2px;
}
.delta-badge.identical { background: #d4edda; color: #155724; }
.delta-badge.near-identical { background: #d4edda; color: #155724; }
.delta-badge.very-close { background: #fff3cd; color: #856404; }
.delta-badge.similar { background: #e2e3e5; color: #383d41; }

.match-price {
    font-size: 12px;
    margin-top: 4px;
}
.price-diff {
    color: #888;
}
.price-diff.cheaper { color: #155724; }
.price-diff.dearer { color: #856404; }

/* Cluster visualisation */

.cluster-viz {
    margin-bottom: 30px;
}
.cluster-viz h2 {
    font-size: 18px;
    margin-bottom: 12px;
}

/* Submission form */

.submission-form {
    border-top: 1px solid #eee;
    padding-top: 24px;
    margin-top: 30px;
    max-width: 400px;
}
.submission-form h3 {
    font-size: 16px;
    margin-bottom: 12px;
}
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}
.form-group select,
.form-group input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ccc;
    font-size: 14px;
    font-family: inherit;
}
.form-submit {
    padding: 8px 20px;
    background: #111;
    color: #fff;
    border: none;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.form-submit:hover {
    background: #333;
}
/* Honeypot — hidden from real users */
.hp-field {
    position: absolute;
    left: -9999px;
}

/* Rankings page */

.ranking-section {
    margin-bottom: 40px;
}
.ranking-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
}
.ranking-list {
    list-style: none;
}
.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.ranking-item .rank {
    font-size: 14px;
    font-weight: 700;
    color: #888;
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}
.ranking-item .mini-swatch {
    width: 36px;
    height: 36px;
    border: 1px solid #eee;
    flex-shrink: 0;
}
.ranking-item .ranking-info {
    flex: 1;
}
.ranking-item .ranking-name {
    font-size: 13px;
    font-weight: 600;
}
.ranking-item .ranking-brand {
    font-size: 11px;
    color: #888;
}
.ranking-item .ranking-stat {
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
}

/* Match input page */

.match-input {
    max-width: 600px;
    margin-bottom: 30px;
}
.match-input h2 {
    font-size: 16px;
    margin-bottom: 12px;
}
.input-methods {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.input-method {
    flex: 1;
    min-width: 200px;
}
.input-method h3 {
    font-size: 14px;
    margin-bottom: 8px;
}
.hex-input, .rgb-inputs input {
    padding: 6px 10px;
    border: 1px solid #ccc;
    font-size: 14px;
    font-family: inherit;
}
.rgb-inputs {
    display: flex;
    gap: 6px;
}
.rgb-inputs input {
    width: 70px;
}
.preview-swatch {
    width: 60px;
    height: 60px;
    border: 1px solid #eee;
    margin-top: 8px;
}

/* Image upload */

.upload-zone {
    border: 2px dashed #ccc;
    padding: 30px;
    text-align: center;
    font-size: 13px;
    color: #888;
    cursor: pointer;
    margin-bottom: 16px;
}
.upload-zone:hover {
    border-color: #999;
}
.palette-results {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.palette-swatch {
    width: 50px;
    height: 50px;
    border: 1px solid #eee;
    cursor: pointer;
}
.palette-swatch:hover {
    border-color: #333;
}
.palette-swatch.selected {
    border: 2px solid #111;
}

/* Footer */

footer {
    border-top: 1px solid #eee;
    padding: 20px 0;
    margin-top: 40px;
}
footer p {
    font-size: 11px;
    color: #999;
    max-width: 700px;
}

/* Responsive */

@media (max-width: 600px) {
    .colour-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    .colour-hero {
        flex-direction: column;
    }
    .colour-hero .large-swatch {
        width: 100%;
        height: 200px;
    }
    .match-grid {
        grid-template-columns: 1fr;
    }
}

/* Print */

@media print {
    header, nav, footer, .filters, .search-box,
    .submission-form, .upload-zone { display: none; }
    .colour-hero .large-swatch { width: 150px; height: 150px; }
}
