/* =====================================================
   README Badge Generator — style.css
   Dark gradient with colorful badge accents
   ===================================================== */

:root {
    --bg: #0D1117;
    --surface: #161B22;
    --surface2: #21262D;
    --border: rgba(255, 255, 255, 0.08);
    --text: #E6EDF3;
    --text-muted: #7D8590;
    --primary: #238636;
    --radius: 12px;
    --tr: 0.18s ease;
}

[data-theme="light"] {
    --bg: #F6F8FA;
    --surface: #FFFFFF;
    --surface2: #F0F2F5;
    --border: rgba(0, 0, 0, 0.09);
    --text: #1F2328;
    --text-muted: #656D76;
}

*,
*::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 10% 0%, rgba(35, 134, 54, 0.06) 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: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.85em;
}

[data-theme="light"] code {
    background: rgba(0, 0, 0, 0.06);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

[data-theme="light"] .header {
    background: rgba(246, 248, 250, 0.9);
}

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

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

.logo-badge-row {
    display: flex;
    gap: 4px;
}

.mini-badge {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.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: 6px;
    align-items: center;
}

.btn-primary {
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    transition: box-shadow var(--tr), transform var(--tr);
}

.btn-primary:hover {
    box-shadow: 0 0 14px rgba(35, 134, 54, 0.4);
    transform: translateY(-1px);
}

.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: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 18px;
    position: relative;
    z-index: 1;
}

/* Input */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 66px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.input-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.hint-text {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.pkg-editor {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    padding: 12px 14px;
    resize: none;
    min-height: 280px;
    width: 100%;
    tab-size: 2;
}

.pkg-editor::placeholder {
    color: var(--text-muted);
}

/* Options */
.options-card {
    padding: 14px;
}

.options-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.opt-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

.opt-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: 0.78rem;
    padding: 6px 8px;
    outline: none;
    cursor: pointer;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.toggle-label input {
    display: none;
}

.toggle-pill {
    width: 36px;
    height: 20px;
    background: var(--surface2);
    border-radius: 10px;
    border: 1px solid var(--border);
    position: relative;
    transition: background var(--tr);
}

.toggle-pill::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all var(--tr);
}

.toggle-label input:checked+.toggle-pill {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-label input:checked+.toggle-pill::after {
    left: 19px;
    background: white;
}

.color-input-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.color-picker-sm {
    width: 30px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
    background: none;
}

.color-hex-input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 4px 8px;
    outline: none;
    width: 80px;
}

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

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

.placeholder-card {
    padding: 60px 20px;
    text-align: center;
}

.placeholder-emoji {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.placeholder-text {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.placeholder-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

strong {
    font-weight: 700;
    color: var(--text);
}

/* Preview */
.preview-card {
    overflow: hidden;
}

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

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

.btn-copy-all {
    background: rgba(35, 134, 54, 0.15);
    border: 1px solid rgba(35, 134, 54, 0.25);
    border-radius: 7px;
    color: #4AC26B;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    transition: all var(--tr);
}

.btn-copy-all:hover {
    background: rgba(35, 134, 54, 0.25);
}

.badge-preview {
    padding: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 60px;
}

.badge-preview img {
    height: 24px;
    border-radius: 3px;
    transition: transform var(--tr);
}

.badge-preview img:hover {
    transform: scale(1.06);
}

/* Categories */
.categories-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: fadeIn 0.25s ease;
}

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

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

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

.cat-title {
    font-size: 0.78rem;
    font-weight: 700;
}

.cat-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.badge-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface2);
    border-radius: 8px;
    padding: 8px 10px;
}

.badge-row img {
    height: 22px;
    flex-shrink: 0;
    border-radius: 3px;
}

.badge-info {
    flex: 1;
}

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

.badge-md {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

.btn-sm {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.68rem;
    padding: 4px 9px;
    cursor: pointer;
    transition: all var(--tr);
}

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

/* Markdown output */
.markdown-card {
    overflow: hidden;
}

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

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

.markdown-output {
    padding: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #7EE787;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

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

    .input-section {
        position: static;
        max-height: none;
    }
}

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

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