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

:root {
    /* Dark Pro Palette */
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --bg-card: #18181b;
    --bg-elevated: #1f1f23;

    /* Text Colors */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    /* Accent - Electric Blue */
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --accent-subtle: rgba(59, 130, 246, 0.1);

    /* Success */
    --success: #22c55e;

    /* Borders */
    --border: #27272a;
    --border-strong: #3f3f46;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Typography */
    --font-main: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

/* ===== HEADER ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.brand-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: var(--shadow-glow);
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pro-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    background: var(--accent);
    color: white;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.header-link:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.share-buttons {
    display: flex;
    gap: var(--space-xs);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-subtle);
}

/* ===== EDITOR SECTION ===== */
.editor-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.input-area,
.output-area {
    display: flex;
    flex-direction: column;
}

.area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.area-header label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.char-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

textarea {
    width: 100%;
    height: 280px;
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-main);
    line-height: 1.7;
    resize: vertical;
    transition: all 0.2s;
}

textarea:hover {
    border-color: var(--border-strong);
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

textarea::placeholder {
    color: var(--text-muted);
}

#outputText {
    background: var(--bg-card);
    border-color: var(--accent);
}

.output-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-sm);
}

.btn-copy {
    padding: var(--space-sm) var(--space-lg);
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    transition: all 0.2s;
}

.btn-copy:hover:not(:disabled) {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-copy:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-regenerate {
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    transition: all 0.2s;
}

.btn-regenerate:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-subtle);
}

/* ===== OPTIONS SECTION ===== */
.options-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.options-header h2 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
}

.header-buttons {
    display: flex;
    gap: var(--space-xs);
}

.btn-control {
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    transition: all 0.2s;
}

.btn-control:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-elevated);
}

.options-container {
    padding: var(--space-lg);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* Option Groups */
.option-group h3 {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border);
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Individual Options */
.option {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-sm);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

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

.option:has(input:checked) {
    background: var(--accent-subtle);
}

.option input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    margin-right: var(--space-sm);
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s;
    background: var(--bg-primary);
}

.option:hover .checkbox-custom {
    border-color: var(--accent);
}

.option:has(input:checked) .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
}

.option:has(input:checked) .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.option-content {
    display: flex;
    flex-direction: column;
}

.option-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.15s;
}

.option:has(input:checked) .option-title {
    color: var(--text-primary);
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: var(--space-2xl) 0 var(--space-lg);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: var(--space-2xl);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--success);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease-out);
    z-index: 1000;
}

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

/* ===== MOBILE COPY BAR ===== */
.mobile-copy-bar {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .editor-section {
        grid-template-columns: 1fr;
    }

    textarea {
        height: 200px;
    }

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

@media (max-width: 600px) {
    .container {
        padding: var(--space-md);
        padding-bottom: 80px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .brand-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .brand-text h1 {
        font-size: 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    textarea {
        height: 160px;
        font-size: 16px;
    }

    .options-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .header-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .btn-control {
        padding: var(--space-sm);
        text-align: center;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .option {
        min-height: 48px;
    }

    .output-actions .btn-copy {
        display: none;
    }

    .mobile-copy-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        padding: var(--space-sm) var(--space-md);
        align-items: center;
        justify-content: space-between;
        z-index: 100;
    }

    .mobile-copy-bar .char-info {
        font-family: var(--font-mono);
        font-size: 0.7rem;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        gap: 2px;
        letter-spacing: 0.05em;
    }

    .mobile-copy-bar .btn-copy-mobile {
        padding: var(--space-md) var(--space-xl);
        background: var(--accent);
        color: white;
        border: none;
        border-radius: 6px;
        font-family: var(--font-mono);
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        min-height: 44px;
        cursor: pointer;
    }

    .mobile-copy-bar .btn-copy-mobile:disabled {
        opacity: 0.3;
    }

    .toast {
        bottom: 80px;
        left: var(--space-md);
        right: var(--space-md);
        transform: translateY(20px);
        text-align: center;
    }

    .toast.show {
        transform: translateY(0);
    }
}
