/* =====================================================
   Color Palette Accessibility — styles.css
   Amber Gold dark mode
   ===================================================== */

:root {
    --primary: #F39C12;
    --secondary: #FFEAA7;
    --accent: #00CEC9;
    --bg: #1A150A;
    --surface: #231B0C;
    --surface2: #2E230F;
    --border: rgba(243, 156, 18, 0.18);
    --text: #F5EDD5;
    --text-muted: #7A6A40;
    --pass: #00B894;
    --fail: #D63031;
    --radius: 12px;
    --tr: 0.2s ease;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 30% 0%, rgba(243, 156, 18, 0.07) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.hidden {
    display: none !important;
}

.glass-card {
    background: rgba(35, 27, 12, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(26, 21, 10, 0.9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
}

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 11px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    background: rgba(243, 156, 18, 0.12);
    border: 1px solid rgba(243, 156, 18, 0.25);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-title {
    font-size: 1rem;
    font-weight: 700;
}

.logo-sub {
    font-size: 0.62rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.header-actions {
    display: flex;
    gap: 7px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 7px 12px;
    cursor: pointer;
    transition: all var(--tr);
}

.btn-ghost:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Main */
.main {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
    position: relative;
    z-index: 1;
}

/* Input Panel */
.input-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(46, 35, 15, 0.5);
}

.panel-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.btn-add {
    background: rgba(243, 156, 18, 0.1);
    border: 1px dashed rgba(243, 156, 18, 0.3);
    border-radius: 7px;
    color: var(--primary);
    font-size: 0.78rem;
    padding: 5px 11px;
    cursor: pointer;
    transition: all var(--tr);
}

.btn-add:hover {
    background: rgba(243, 156, 18, 0.18);
}

.color-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 8px 10px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.color-swatch-input {
    position: relative;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.color-swatch-input input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.color-swatch-preview {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.color-hex-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
}

.color-hex-field:focus {
    color: var(--primary);
}

.color-label-field {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    width: 60px;
}

.color-del {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color var(--tr);
    padding: 3px;
}

.color-del:hover {
    color: var(--fail);
}

.wcag-controls {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wcag-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.wcag-btn-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.wcag-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 4px 10px;
    cursor: pointer;
    transition: all var(--tr);
}

.wcag-btn.active,
.wcag-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(243, 156, 18, 0.08);
}

.palette-stats {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.stat-chip {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.stat-chip span {
    color: var(--text);
    font-weight: 600;
}

.stat-chip.pass {
    border-color: rgba(0, 184, 148, 0.25);
}

.stat-chip.pass span {
    color: var(--pass);
}

.stat-chip.fail {
    border-color: rgba(214, 48, 49, 0.25);
}

.stat-chip.fail span {
    color: var(--fail);
}

/* Matrix */
.matrix-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.matrix-card {
    overflow: auto;
}

.matrix-placeholder {
    padding: 50px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.matrix-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 14px;
    opacity: 0.4;
}

.matrix-wrap {
    overflow-x: auto;
}

.matrix-table {
    display: inline-grid;
    gap: 3px;
    padding: 14px;
}

.matrix-header-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    background: var(--surface2);
    border-radius: 6px;
    padding: 5px 6px;
    white-space: nowrap;
}

.matrix-cell {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    position: relative;
    transition: transform var(--tr);
}

.matrix-cell:hover {
    transform: scale(1.08);
    z-index: 10;
}

.matrix-cell.pass {
    background: rgba(0, 184, 148, 0.12);
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.matrix-cell.fail {
    background: rgba(214, 48, 49, 0.1);
    border: 1px solid rgba(214, 48, 49, 0.25);
}

.matrix-cell.same {
    background: var(--surface2);
    border: 1px solid var(--border);
    opacity: 0.4;
}

.matrix-ratio {
    font-size: 0.7rem;
    font-weight: 700;
}

.matrix-verdict {
    font-size: 0.55rem;
    opacity: 0.8;
}

/* Suggestions */
.suggestions-card {
    overflow: hidden;
}

.sugg-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.suggestions-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.sugg-empty {
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 8px;
}

.sugg-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.2s ease;
}

.sugg-pair {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.sugg-dot {
    width: 22px;
    height: 22px;
    border-radius: 5px;
}

.sugg-text {
    flex: 1;
}

.sugg-name {
    font-size: 0.78rem;
    font-weight: 600;
}

.sugg-detail {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.sugg-alt {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono';
    color: var(--accent);
    margin-top: 2px;
}

@media (max-width: 960px) {
    .main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .main {
        padding: 14px;
    }
}