/* ============================================
   GitHub Profile README Generator — Styles
   Theme: Dark mode + Emerald Green palette
   ============================================ */

:root {
    --primary: #00B894;
    --primary-hover: #00D4A8;
    --primary-dim: rgba(0, 184, 148, 0.15);
    --secondary: #55EFC4;
    --accent: #FDCB6E;
    --bg: #0A1A14;
    --bg-card: rgba(16, 40, 30, 0.6);
    --bg-hover: rgba(0, 184, 148, 0.08);
    --bg-input: rgba(10, 26, 20, 0.8);
    --surface: rgba(20, 50, 38, 0.5);
    --border: rgba(0, 184, 148, 0.12);
    --border-focus: rgba(0, 184, 148, 0.5);
    --text: #E8F5F0;
    --text-secondary: #8FBFAE;
    --text-dim: #5A8A78;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --transition: 250ms ease;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --glass: blur(16px) saturate(180%);
}

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

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

body::before {
    content: '';
    position: fixed;
    top: -30%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(0, 184, 148, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: rgba(10, 26, 20, 0.85);
    backdrop-filter: var(--glass);
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.logo h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #00D4A8);
    color: #0A1A14;
    box-shadow: 0 2px 12px rgba(0, 184, 148, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 184, 148, 0.45);
}

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

.btn-secondary:hover {
    background: rgba(0, 184, 148, 0.2);
    border-color: var(--primary);
}

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

/* Layout */
.app-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Editor Panel */
.editor-panel {
    padding: 16px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: var(--glass);
}

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

.card-header h2 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Inputs */
input[type="text"],
textarea,
.select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    transition: border-color var(--transition);
}

input[type="text"]:focus,
textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-dim);
}

textarea {
    resize: vertical;
    min-height: 48px;
}

.select {
    cursor: pointer;
}

.field-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-row label {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Badges */
.badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge-btn {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.badge-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-hover);
}

.badge-btn.active {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
}

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

.checkbox-label input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    background: var(--bg-input);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0A1A14;
    font-size: 0.72rem;
    font-weight: 700;
}

/* Preview Panel */
.preview-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
}

.tab {
    padding: 10px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

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

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

.preview-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    background: #0d1117;
    color: #c9d1d9;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.preview-content h1 {
    font-size: 1.8em;
    margin-bottom: 8px;
    color: #c9d1d9;
    border-bottom: 1px solid #21262d;
    padding-bottom: 8px;
}

.preview-content h2 {
    font-size: 1.4em;
    margin: 16px 0 8px;
    color: #c9d1d9;
    border-bottom: 1px solid #21262d;
    padding-bottom: 6px;
}

.preview-content h3 {
    font-size: 1.15em;
    margin: 12px 0 6px;
    color: #c9d1d9;
}

.preview-content p {
    margin: 8px 0;
}

.preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.preview-content a {
    color: #58a6ff;
    text-decoration: none;
}

.preview-content a:hover {
    text-decoration: underline;
}

.markdown-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    background: var(--bg-card);
    border: none;
    margin: 0;
}

.markdown-content code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--secondary);
    white-space: pre-wrap;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    background: var(--primary);
    color: #0A1A14;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity 300ms ease, transform 300ms ease;
    z-index: 300;
    pointer-events: none;
}

.toast[hidden] {
    display: block;
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 184, 148, 0.2);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 900px) {
    .app-main {
        grid-template-columns: 1fr;
    }

    .editor-panel {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: none;
    }

    .preview-panel {
        min-height: 400px;
    }

    .preview-content,
    .markdown-content {
        max-height: none;
    }
}

@media (max-width: 540px) {
    .app-header {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }
}