/* ============================================================
   Fake Data Generator Pro — Styles
   Developer tool dark mode, database admin aesthetic
   ============================================================ */

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

:root {
    --primary: #00CEC9;
    --primary-light: #55EFC4;
    --secondary: #636E72;
    --accent: #6C5CE7;
    --bg: #0D1117;
    --bg-elevated: #161B22;
    --bg-surface: #21262D;
    --bg-card: #1C2128;
    --bg-hover: #2D333B;
    --text-primary: #E6EDF3;
    --text-secondary: #8B949E;
    --text-muted: #484F58;
    --border: #30363D;
    --success: #2EA043;
    --warning: #D29922;
    --danger: #F85149;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-pill: 50px;
    --shadow: 0 4px 16px rgba(0, 0, 0, .4);
    --transition: 200ms ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    font-size: 16px;
}

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

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

.header {
    text-align: center;
    padding: 32px 0 24px;
}

.header-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    color: var(--text-secondary);
    font-size: .9rem;
    margin-top: 4px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:hover {
    background: var(--bg-hover);
}

.btn:active {
    transform: scale(.97);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    font-weight: 700;
}

.btn-primary:hover {
    opacity: .9;
}

.btn-sm {
    padding: 6px 12px;
    font-size: .8rem;
}

.btn-danger {
    background: rgba(248, 81, 73, .1);
    border-color: var(--danger);
    color: var(--danger);
}

/* --- Schema Builder --- */
.schema-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.schema-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.schema-title {
    font-weight: 700;
    font-size: .95rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.field-row:last-child {
    border-bottom: none;
}

.field-input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .85rem;
    outline: none;
}

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

select.field-input {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238B949E'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

.btn-remove-field {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color var(--transition);
}

.btn-remove-field:hover {
    color: var(--danger);
}

/* --- Controls --- */
.controls-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.count-input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: .9rem;
    text-align: center;
    outline: none;
}

.count-label {
    font-size: .85rem;
    color: var(--text-secondary);
}

/* --- Output --- */
.output-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.output-tabs {
    display: flex;
    gap: 0;
}

.output-tab {
    padding: 8px 14px;
    border: none;
    background: none;
    font-family: var(--font);
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
}

.output-tab:hover {
    color: var(--text-primary);
}

.output-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.output-body {
    max-height: 400px;
    overflow: auto;
    padding: 16px;
}

.output-code {
    font-family: var(--font-mono);
    font-size: .8rem;
    line-height: 1.7;
    white-space: pre;
    color: var(--text-primary);
}

.output-actions {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: .85rem;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
    z-index: 200;
}

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

@media (max-width: 768px) {
    .field-row {
        grid-template-columns: 1fr;
    }

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

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}