:root {
    /* Modern Color System */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #ec4899;
    --accent-glow: rgba(236, 72, 153, 0.4);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border: rgba(148, 163, 184, 0.2);
    --border-hover: rgba(148, 163, 184, 0.4);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.2);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-display);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 24px;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Animated Background Orbs */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    bottom: -200px;
    right: -200px;
    animation-delay: -7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -100px) scale(1.1); }
    66% { transform: translate(-80px, 80px) scale(0.9); }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    padding: 48px;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
    animation: fadeIn 0.8s ease-out 0.2s both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5); }
}

.header-badge svg {
    width: 20px;
    height: 20px;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Feature Pills */
.feature-pills {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-base);
    cursor: pointer;
}

.pill svg {
    width: 16px;
    height: 16px;
}

.pill.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.pill.coming-soon {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--border);
    position: relative;
}

.soon-tag {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent);
    color: white;
    font-size: 0.625rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 2px 10px var(--accent-glow);
}

/* Input Section */
.input-section {
    margin-bottom: 48px;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

.text-input-wrapper {
    margin-bottom: 32px;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.label-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.label-with-icon svg {
    color: var(--primary-light);
}

.label-with-icon label {
    font-weight: 600;
    font-size: 1.125rem;
}

.sample-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-display);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.sample-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.2), transparent);
    transition: left 0.5s;
}

.sample-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.sample-btn:hover::before {
    left: 100%;
}

.sample-btn:active {
    transform: translateY(0);
}

.sample-btn svg {
    width: 16px;
    height: 16px;
}

/* Text Input Container */
.text-input-container {
    display: flex;
    gap: 20px;
    transition: all var(--transition-slow);
}

.text-input-container.with-sample .textarea-wrapper {
    flex: 0 0 55%;
}

.textarea-wrapper {
    position: relative;
    width: 100%;
}

textarea {
    width: 100%;
    padding: 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: var(--font-mono);
    resize: vertical;
    transition: all var(--transition-base);
    line-height: 1.7;
    min-height: 200px;
}

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

textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 8px 30px rgba(0, 0, 0, 0.2);
}

.textarea-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.6), transparent);
    pointer-events: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    opacity: 0;
    transition: opacity var(--transition-base);
}

textarea:focus + .textarea-gradient {
    opacity: 1;
}

/* Sample Panel */
.sample-panel {
    flex: 0 0 42%;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sample-panel.hidden {
    display: none;
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
}

.panel-header svg {
    color: var(--primary-light);
}

.sample-content {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    overflow-y: auto;
    margin-bottom: 16px;
    max-height: 280px;
    line-height: 1.7;
    border: 1px solid var(--border);
}

.sample-content::-webkit-scrollbar {
    width: 6px;
}

.sample-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 3px;
}

.sample-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-display);
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}

.copy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.copy-btn:hover::before {
    left: 100%;
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

/* Word Count */
.word-count {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.word-count svg {
    width: 16px;
    height: 16px;
    color: var(--primary-light);
}

.word-count .divider {
    color: var(--border);
}

.word-count .max-words {
    color: var(--text-muted);
}

/* Controls */
.controls {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.controls-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.controls-header svg {
    color: var(--primary-light);
}

.help-tooltip {
    position: relative;
    cursor: help;
    color: var(--text-muted);
    transition: color var(--transition-base);
}

.help-tooltip:hover {
    color: var(--primary-light);
}

.help-tooltip svg {
    width: 18px;
    height: 18px;
}

.tooltip-text {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.95);
    color: var(--text-primary);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.help-tooltip:hover .tooltip-text {
    opacity: 1;
}

/* Strategy Hint (AI-like) */
.strategy-hint {
    margin-top: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    display: flex;
    gap: 12px;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

.hint-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    color: white;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(99, 102, 241, 0.5); }
    50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.8); }
}

.hint-content {
    flex: 1;
}

.hint-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
}

.hint-text strong {
    color: var(--primary-light);
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.hint-text.hidden {
    display: none;
}

/* AI Insight Card */
.ai-insight-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    position: relative;
    animation: slideInDown 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.insight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.insight-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-light);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.insight-badge svg {
    width: 16px;
    height: 16px;
    animation: pulse 2s ease-in-out infinite;
}

.insight-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.insight-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.insight-close svg {
    width: 16px;
    height: 16px;
}

.insight-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin: 0;
}

/* Context Tips */
.context-tips {
    display: flex;
    gap: 20px;
    padding: 12px 20px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    flex-wrap: wrap;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
}

.tip-item svg {
    color: var(--success);
    flex-shrink: 0;
}

/* Overlap Control Wrapper */
.overlap-control-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.mini-tooltip {
    position: relative;
    display: flex;
    align-items: center;
    cursor: help;
    color: var(--text-muted);
    transition: color var(--transition-base);
}

.mini-tooltip:hover {
    color: var(--primary-light);
}

.mini-tooltip svg {
    width: 14px;
    height: 14px;
}

.mini-tooltip-text {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    width: 280px;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.98);
    color: var(--text-primary);
    font-size: 0.8125rem;
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: 100;
}

.mini-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(15, 23, 42, 0.98);
}

.mini-tooltip:hover .mini-tooltip-text {
    opacity: 1;
}

.control-group {
    margin-bottom: 24px;
}

.control-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.label-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    font-size: 0.6875rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.select-wrapper {
    position: relative;
}

select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: var(--font-display);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
}

.select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    transition: all var(--transition-base);
}

select:hover {
    border-color: var(--border-hover);
    background: rgba(15, 23, 42, 0.8);
}

select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

select:focus + .select-arrow {
    color: var(--primary-light);
    transform: translateY(-50%) rotate(180deg);
}

input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: var(--font-mono);
    font-weight: 500;
    transition: all var(--transition-base);
}

input[type="number"]:hover {
    border-color: var(--border-hover);
    background: rgba(15, 23, 42, 0.8);
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.params-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.param-group {
    display: flex;
    flex-direction: column;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.0625rem;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20%, 100% { left: 200%; }
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5), var(--shadow-glow);
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:active {
    transform: translateY(-1px);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Results Section */
.results-section {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.6s ease-out;
}

.results-section.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

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

.results-title svg {
    color: var(--primary-light);
}

.results-title h2 {
    color: var(--text-primary);
    font-size: 1.875rem;
    font-weight: 800;
}

.results-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
}

.toggle-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    transition: all var(--transition-base);
    border: 1px solid var(--border);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 50%;
    transition: all var(--transition-base);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

input[type="checkbox"]:checked + .toggle-slider::before {
    left: 25px;
}

.toggle-label:hover .toggle-slider {
    border-color: var(--border-hover);
}

.toggle-text {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Chunk Count Badge */
.chunk-count {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9375rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    animation: countPulse 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes countPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.chunk-count svg {
    width: 18px;
    height: 18px;
}

/* Visualization */
.visualization-wrapper {
    margin-bottom: 24px;
}

.viz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
}

.viz-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;
}

.viz-title svg {
    color: var(--primary-light);
}

.viz-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-style: italic;
}

.viz-hint svg {
    width: 16px;
    height: 16px;
}

.visualization-container {
    background: rgba(15, 23, 42, 0.6);
    padding: 28px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border: 1px solid var(--border);
    line-height: 2;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    min-height: 200px;
    position: relative;
    color: var(--text-secondary);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.chunk-highlight {
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 3px 6px;
    margin: 0 2px;
    border-radius: 6px;
    position: relative;
    display: inline;
    font-weight: 500;
}

.chunk-highlight:hover {
    filter: brightness(1.2);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.chunk-highlight.active {
    filter: brightness(1.3);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
    z-index: 20;
    transform: scale(1.03);
}

/* Chunk Info Panel */
.chunk-info-panel {
    background: rgba(15, 23, 42, 0.4);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.chunk-info-panel .panel-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.chunk-info-panel h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
}

.chunk-info-panel svg {
    color: var(--primary-light);
}

#chunkInfo {
    color: var(--text-secondary);
    line-height: 1.8;
}

#chunkInfo p {
    margin-bottom: 12px;
}

#chunkInfo strong {
    color: var(--text-primary);
    font-weight: 600;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9375rem;
    font-style: italic;
}

/* Overlap Indicator */
.overlap-indicator {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        rgba(255, 255, 255, 0.1) 4px,
        rgba(255, 255, 255, 0.1) 8px
    );
}

/* Welcome Tooltip */
.welcome-tooltip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.welcome-tooltip::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: -1;
}

.welcome-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

.welcome-content h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.welcome-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

.welcome-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.welcome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5);
}

.welcome-btn svg {
    width: 16px;
    height: 16px;
}

.raglab-footer {
  margin-top: 4rem;
  padding: 2.2rem 1.5rem;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.6),
    rgba(2, 6, 23, 0.9)
  );
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-left {
  max-width: 360px;
}

.footer-logo {
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: #e0e7ff;
  letter-spacing: 0.4px;
}

.footer-desc {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #94a3b8;
}

.footer-center {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: #a5b4fc;
  opacity: 0.9;
}

.footer-separator {
  opacity: 0.4;
}

.footer-right {
  text-align: right;
  font-size: 0.8rem;
  color: #94a3b8;
}

.footer-meta {
  display: block;
}

.footer-year {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
  .footer-inner {
    text-align: center;
    justify-content: center;
  }

  .footer-right {
    text-align: center;
  }
}

/* Chunk Color Palette */
.chunk-color-0 { background-color: rgba(239, 68, 68, 0.4); }
.chunk-color-1 { background-color: rgba(59, 130, 246, 0.4); }
.chunk-color-2 { background-color: rgba(16, 185, 129, 0.4); }
.chunk-color-3 { background-color: rgba(245, 158, 11, 0.4); }
.chunk-color-4 { background-color: rgba(236, 72, 153, 0.4); }
.chunk-color-5 { background-color: rgba(139, 92, 246, 0.4); }
.chunk-color-6 { background-color: rgba(6, 182, 212, 0.4); }
.chunk-color-7 { background-color: rgba(251, 146, 60, 0.4); }
.chunk-color-8 { background-color: rgba(168, 85, 247, 0.4); }
.chunk-color-9 { background-color: rgba(34, 197, 94, 0.4); }

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 32px;
    }
    
    h1 {
        font-size: 2.25rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 24px;
    }
    
    h1 {
        font-size: 1.875rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .text-input-container.with-sample {
        flex-direction: column;
    }
    
    .text-input-container.with-sample .textarea-wrapper {
        flex: 1;
    }
    
    .params-container {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .viz-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .feature-pills {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .generate-btn {
        font-size: 1rem;
        padding: 16px 24px;
    }
}
