:root {
    --text-main: #FFFFFF;
    --bg-main: #0F172A;
    --panel-bg: rgba(255, 255, 255, 0.1);
    --panel-border: rgba(255, 255, 255, 0.2);
    --pass-color: #10B981;
    --fail-color: #EF4444;
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.app-container {
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.8;
}

.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease, background 0.3s ease;
}

/* Color Inputs */
.color-inputs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.color-picker-wrap {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    gap: 0.75rem;
    transition: border-color 0.2s;
}

.color-picker-wrap:focus-within {
    border-color: rgba(255, 255, 255, 0.5);
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
}
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50%;
}

input[type="text"] {
    background: transparent;
    border: none;
    color: inherit;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.1rem;
    font-weight: 600;
    width: 100%;
    text-transform: uppercase;
    outline: none;
}

#swapColorsBtn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: inherit;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1.5rem;
}

#swapColorsBtn:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(180deg);
}

/* Results Panel */
.results-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ratio-display {
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1.5rem;
}

.ratio-label {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.ratio-value {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    margin: 0.5rem 0;
    letter-spacing: -0.03em;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.pass { background: rgba(16, 185, 129, 0.2); color: #34D399; }
.status-badge.fail { background: rgba(239, 68, 68, 0.2); color: #F87171; }
.status-badge.warn { background: rgba(245, 158, 11, 0.2); color: #FBBF24; }

/* Themes for Pass/Fail */
.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge.pass { background: var(--pass-color); color: white; }
.badge.fail { background: var(--fail-color); color: white; }

.compliance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.compliance-card {
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.cc-header {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.cc-header small { opacity: 0.7; font-weight: 400; }

.cc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.9;
}
.cc-row:last-child { margin-bottom: 0; }

.suggester-action {
    text-align: center;
    margin-top: 0.5rem;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.suggestion-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

.hidden { display: none; }

/* Previews Panel */
.previews-panel h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.preview-toggles {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.preview-toggles select {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
    color: inherit;
    padding: 0.5rem;
    border-radius: 6px;
    font-family: inherit;
}

.preview-sandbox {
    padding: 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(128,128,128,0.2);
}

.preview-text h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.preview-text p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.preview-ui {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.preview-card {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    border: 2px solid;
    font-weight: 600;
}

/* Light Mode Overrides for Panels */
.app-container.light-panels .glass-panel {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.app-container.light-panels .color-picker-wrap {
    background: rgba(255,255,255,0.5);
    border-color: rgba(0,0,0,0.1);
}

.app-container.light-panels input[type="text"] { color: inherit; }
.app-container.light-panels .compliance-card { background: rgba(255,255,255,0.5); border-color: rgba(0,0,0,0.05); }
.app-container.light-panels .cc-header { border-bottom-color: rgba(0,0,0,0.1); }
.app-container.light-panels .ratio-display { border-bottom-color: rgba(0,0,0,0.1); }
.app-container.light-panels #swapColorsBtn { border-color: rgba(0,0,0,0.2); background: transparent; }

@media (max-width: 640px) {
    .color-inputs {
        flex-direction: column;
    }
    #swapColorsBtn {
        margin-top: 0;
        transform: rotate(90deg);
    }
    #swapColorsBtn:hover {
        transform: rotate(270deg);
    }
}
