/* PWA Manifest Generator — styles.css — Forest Moss theme */

:root {
    --bg: #0A1A0D;
    --bg2: #0D1F10;
    --surface: #132217;
    --surface2: #1A2E1E;
    --border: #243D28;
    --primary: #22C55E;
    --primary2: #86EFAC;
    --accent: #A3E635;
    --text: #DCF5E4;
    --muted: #4F7A58;
    --warn: #FBBF24;
    --danger: #F87171;
    --radius: 12px;
}

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

html {
    height: 100%;
}

body {
    background: var(--bg);
    background-image: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(34, 197, 94, 0.08) 0%, transparent 60%);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    height: 100%;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ── Header ──────────────────────────────────────────── */
.app-header {
    background: rgba(10, 26, 13, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

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

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

.app-header h1 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.header-sub {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 3px;
}

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

/* ── App body ────────────────────────────────────────── */
.app-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 0;
    min-height: 0;
    overflow: hidden;
}

/* ── Form col ────────────────────────────────────────── */
.form-col {
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-right: 1px solid var(--border);
}

/* ── Section ─────────────────────────────────────────── */
.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary2);
    margin-bottom: 2px;
}

/* ── Field ───────────────────────────────────────────── */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.field-input,
.field-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.78rem;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    font-family: 'Inter', sans-serif;
}

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

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

.field-ta {
    resize: vertical;
    min-height: 56px;
}

.field-hint {
    font-size: 0.62rem;
    color: var(--muted);
}

.field-hint-inline {
    font-size: 0.62rem;
    color: var(--muted);
    font-weight: 400;
}

.tag-req {
    color: var(--danger);
    font-size: 0.6rem;
    margin-left: 4px;
}

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

/* ── Color ───────────────────────────────────────────── */
.color-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    background: none;
}

.color-txt {
    flex: 1;
}

/* ── Icon Preview ────────────────────────────────────── */
.icon-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.icon-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.icon-swatch img {
    border-radius: 6px;
    border: 1px solid var(--border);
    object-fit: cover;
    display: block;
}

.icon-swatch .icon-size {
    font-size: 0.58rem;
    color: var(--muted);
}

.icon-placeholder {
    color: var(--muted);
    font-size: 0.75rem;
    padding: 10px 0;
}

/* ── Shortcuts / Screenshots ─────────────────────────── */
.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.shortcut-row .field-input {
    flex: 1;
}

.remove-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    flex-shrink: 0;
}

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

.full-width {
    width: 100%;
    margin-top: 4px;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.18s;
    white-space: nowrap;
}

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

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

.btn-primary:hover {
    background: #16A34A;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

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

.btn-sm {
    padding: 5px 10px;
    font-size: 0.72rem;
    border-radius: 6px;
}

.btn-icon {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

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

/* ── Output col ──────────────────────────────────────── */
.output-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg2);
}

/* ── Install preview ─────────────────────────────────── */
.install-preview {
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.install-card {
    background: #fff;
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 6px;
}

.install-icon-wrap {}

.sim-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    font-weight: 700;
    color: #fff;
    background-size: cover;
    background-position: center;
}

.install-info {
    flex: 1;
}

.sim-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #111;
}

.sim-url {
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
}

.install-chip {
    background: #1a73e8;
    color: #fff;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.homescreen-row {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.homescreen-icon-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sim-hs-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
}

.sim-hs-label {
    font-size: 0.68rem;
    color: var(--muted);
    max-width: 70px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ── JSON Panel ──────────────────────────────────────── */
.json-panel {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.json-panel-header {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--surface);
}

.json-output {
    flex: 1;
    overflow: auto;
    padding: 14px;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Validation ──────────────────────────────────────── */
.validation-wrap {
    padding: 6px 10px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.val-item {
    font-size: 0.7rem;
    padding: 4px 0;
    display: flex;
    gap: 5px;
    align-items: baseline;
}

.val-error {
    color: var(--danger);
}

.val-warn {
    color: var(--warn);
}

.val-ok {
    color: var(--primary);
}

/* ── Toast ───────────────────────────────────────────── */
#toast-wrap {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toast {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.8rem;
    color: var(--text);
    animation: slide-in 0.2s ease;
    max-width: 260px;
}

.toast.success {
    border-color: rgba(34, 197, 94, 0.4);
    color: var(--primary2);
}

.toast.error {
    border-color: rgba(248, 113, 113, 0.4);
    color: var(--danger);
}

@keyframes slide-in {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
    .app {
        overflow: auto;
        height: auto;
    }

    .app-body {
        grid-template-columns: 1fr;
    }

    .output-col {
        max-height: 500px;
    }
}