/* ============================================
   Font Pair Finder — Styles
   Theme: Dark Forest Green
   Primary: #00B894, Secondary: #55EFC4
   ============================================ */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'SF Mono', 'JetBrains Mono', monospace;

    --bg: #0B1A12;
    --bg-card: #112218;
    --bg-input: #0B1A12;
    --bg-hover: #1A3326;

    --border: rgba(0, 184, 148, 0.12);
    --border-hover: rgba(0, 184, 148, 0.28);
    --border-focus: #00B894;

    --text: #E8F5E9;
    --text-secondary: #81C784;
    --text-muted: #4A7A56;

    --primary: #00B894;
    --primary-glow: rgba(0, 184, 148, 0.2);
    --secondary: #55EFC4;
    --red: #FF7675;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.app {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.header-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #0B1A12;
    box-shadow: 0 0 20px var(--primary-glow);
}

.header-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Controls */
.controls-bar {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

.control-select {
    padding: 7px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.8rem;
}

.control-select option {
    background: var(--bg-card);
}

.control-select:focus {
    outline: none;
    border-color: var(--primary);
}

.range-slider {
    width: 100px;
    accent-color: var(--primary);
}

.size-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    min-width: 36px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* Preview Input */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.preview-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    margin-bottom: 8px;
    transition: border-color var(--transition);
}

.preview-input:last-child {
    margin-bottom: 0;
}

.preview-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.preview-input::placeholder {
    color: var(--text-muted);
}

.body-input {
    font-size: 0.78rem;
}

/* Pairings Grid */
.pairings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 14px;
}

.pairing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    animation: fadeIn 0.35s ease-out;
}

.pairing-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.pairing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.pairing-names {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--secondary);
}

.pairing-category {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-glow);
    color: var(--primary);
    font-weight: 600;
}

.preview-heading {
    margin-bottom: 8px;
    line-height: 1.3;
    word-break: break-word;
}

.preview-body {
    color: var(--text-secondary);
    line-height: 1.6;
    word-break: break-word;
}

.pairing-actions {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

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

.btn-fav {
    border-color: transparent;
}

.btn-fav.active {
    color: var(--red);
    border-color: rgba(255, 118, 117, 0.3);
}

.css-snippet {
    margin-top: 10px;
    display: none;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--primary);
    white-space: pre-wrap;
    line-height: 1.5;
    overflow-x: auto;
}

.css-snippet.visible {
    display: block;
}

.footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: 0.82rem;
    color: var(--primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    grid-column: 1 / -1;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 520px) {
    .app {
        padding: 16px 10px 32px;
    }

    .pairings-grid {
        grid-template-columns: 1fr;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
}