/* ============================================
   Lorem Ipsum Generator Styles
   Elegant typographic dark aesthetic
============================================ */
:root {
    --bg: #0c0c18;
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.08);
    --text: #f1f5f9;
    --text-muted: #64748b;
    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.25);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 15% 20%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 50%);
}

.tool-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--accent);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #f1f5f9, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-header p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.65;
}

/* Controls Bar */
.controls-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-group strong {
    color: var(--accent);
}

/* Seg control */
.seg-control {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}

.seg-btn {
    flex: 1;
    padding: 0.45rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.seg-btn:hover {
    color: var(--text);
}

.seg-btn.active {
    background: var(--accent);
    color: #0c0c18;
    font-weight: 700;
}

/* Count row */
.count-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.count-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.count-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

input[type="range"] {
    -webkit-appearance: none;
    background: transparent;
    width: 140px;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: -6px;
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Checkboxes */
.checkbox-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.check-label input {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.check-label input:checked+.checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.check-label input:checked+.checkmark::after {
    content: '✓';
    color: #0c0c18;
    font-size: 0.7rem;
    font-weight: 900;
}

.generate-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), #ef4444);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 6px 16px var(--accent-glow);
    white-space: nowrap;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px var(--accent-glow);
}

/* Output Area */
.output-area {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 0.75rem 1.25rem;
}

.output-meta {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.output-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 7px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.action-btn:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.15);
}

.lorem-output {
    min-height: 400px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 2rem;
    color: var(--text);
    font-family: 'Lora', serif;
    font-size: 1rem;
    line-height: 1.85;
    color: #cbd5e1;
}

.lorem-output p {
    margin-bottom: 1.25em;
}

.lorem-output p:last-child {
    margin-bottom: 0;
}

.lorem-output pre {
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #94a3b8;
}

.lorem-output ul,
.lorem-output ol {
    padding-left: 1.5rem;
}

.lorem-output li {
    margin-bottom: 0.5rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 1rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state i {
    font-size: 3rem;
}

.empty-state p {
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #10b981;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 10px 15px rgba(16, 185, 129, 0.3);
    transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

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

@media (max-width:700px) {
    .controls-bar {
        flex-direction: column;
    }

    h1 {
        font-size: 2rem;
    }
}