/* ==========================================
   JS Obfuscator Free — Stylesheet
   Same design system as all other converters
   ========================================== */

/* ==========================================
   Design Tokens
   ========================================== */
:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    --blue-50:  #eff6ff;  --blue-100: #dbeafe;  --blue-200: #bfdbfe;
    --blue-300: #93c5fd;  --blue-400: #60a5fa;  --blue-500: #3b82f6;
    --blue-600: #2563eb;  --blue-700: #1d4ed8;  --blue-800: #1e40af;
    --blue-900: #1e3a8a;
    --gray-50:  #f8fafc;  --gray-100: #f1f5f9;  --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;  --gray-400: #94a3b8;  --gray-500: #64748b;
    --gray-600: #475569;  --gray-700: #334155;  --gray-800: #1e293b;
    --gray-900: #0f172a;
    --green-600: #16a34a;
    --red-600: #dc2626;
    --orange-500: #f97316;
    --amber-500: #f59e0b;
    --radius-sm: 6px;  --radius-md: 8px;  --radius-lg: 12px;
    --radius-xl: 16px; --radius-2xl: 24px; --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
}

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

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.gradient-text {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   Header
   ========================================== */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--gray-100);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
}

.logo-text { color: var(--gray-800); }

.header-nav {
    display: flex;
    gap: 28px;
    font-size: 0.88rem;
    font-weight: 500;
}

.header-nav a {
    color: var(--gray-500);
    transition: color var(--transition);
}

.header-nav a:hover { color: var(--blue-600); }

/* ==========================================
   Hero
   ========================================== */
.hero {
    padding: 80px 0 40px;
    text-align: center;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--gray-900);
    letter-spacing: -0.025em;
}

.hero-subtitle {
    margin-top: 16px;
    font-size: 1.12rem;
    color: var(--gray-500);
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================
   Obfuscator Section
   ========================================== */
.obfuscator-section {
    padding: 20px 0 60px;
}

.obfuscator-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-2xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

/* Preset Selector */
.preset-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 10px 24px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 8px;
}

.preset-btn:hover {
    border-color: var(--blue-300);
    background: var(--blue-50);
    color: var(--blue-600);
}

.preset-btn.active {
    background: var(--blue-600);
    color: #fff;
    border-color: var(--blue-600);
}

.preset-btn .preset-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.preset-dot.low    { background: var(--green-600); }
.preset-dot.medium { background: var(--amber-500); }
.preset-dot.high   { background: var(--orange-500); }
.preset-dot.max    { background: var(--red-600); }
.preset-dot.custom { background: var(--blue-500); }

/* Editor Panels */
.editor-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.editor-panel {
    display: flex;
    flex-direction: column;
}

.editor-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--gray-800);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.editor-panel-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-300);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.editor-panel-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.editor-panel-badge.js { background: #fef3c7; color: #92400e; }
.editor-panel-badge.obf { background: #fee2e2; color: #991b1b; }

.editor-textarea {
    width: 100%;
    min-height: 340px;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.65;
    color: #e2e8f0;
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    resize: vertical;
    outline: none;
    tab-size: 2;
    transition: border-color var(--transition);
}

.editor-textarea:focus {
    border-color: var(--blue-500);
}

.editor-textarea::placeholder {
    color: var(--gray-600);
}

/* Upload hint */
.upload-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-top: 6px;
}

/* Action Buttons Row */
.actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.actions-row .stats-text {
    font-size: 0.82rem;
    color: var(--gray-400);
    margin-left: auto;
}

/* Status / Error Message */
.status-message {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    display: none;
}

.status-message.success {
    display: block;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ==========================================
   Options Panel
   ========================================== */
.options-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--gray-600);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.options-toggle-btn:hover {
    background: var(--blue-50);
    border-color: var(--blue-300);
    color: var(--blue-600);
}

.options-toggle-btn .chevron {
    transition: transform var(--transition);
    font-size: 0.7rem;
}

.options-toggle-btn.open .chevron {
    transform: rotate(180deg);
}

.options-panel {
    display: none;
    margin-top: 20px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    background: var(--gray-50);
    overflow: hidden;
}

.options-panel.open {
    display: block;
}

.options-group {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.options-group:last-child { border-bottom: none; }

.options-group-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-800);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-group-title .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue-500);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 28px;
}

/* Switch / Toggle */
.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.option-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--gray-600);
}

.option-label .option-hint {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gray-400);
    margin-top: 1px;
}

.toggle-switch {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    background: var(--gray-300);
    cursor: pointer;
    transition: background var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--transition);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--blue-600);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* Select option */
.option-select {
    padding: 7px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    min-width: 140px;
}

.option-select:focus { border-color: var(--blue-400); }

/* Range / Slider option */
.option-range-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-range {
    width: 100px;
    accent-color: var(--blue-600);
    cursor: pointer;
}

.option-range-val {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--blue-600);
    min-width: 32px;
    text-align: right;
}

/* Text input option */
.option-input {
    padding: 7px 12px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    outline: none;
    width: 140px;
    transition: border-color var(--transition);
}

.option-input:focus { border-color: var(--blue-400); }

/* ==========================================
   Features Section
   ========================================== */
.features-section {
    padding: 60px 0 80px;
    text-align: center;
}

.features-section h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.section-subtitle {
    margin-top: 10px;
    color: var(--gray-500);
    font-size: 1.05rem;
    margin-bottom: 40px;
}

.features-illustration {
    max-width: 680px;
    margin: 36px auto 48px;
}

.features-illustration svg {
    width: 100%;
    height: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    text-align: left;
}

.feature-card {
    padding: 28px 24px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    border-top: 1px solid var(--gray-100);
    padding: 32px 0;
    text-align: center;
}

.footer-inner p {
    font-size: 0.85rem;
    color: var(--gray-400);
}

.footer-sub {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--gray-300);
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--blue-600);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-700);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline {
    background: #fff;
    color: var(--blue-600);
    border: 1px solid var(--blue-200);
}

.btn-outline:hover {
    background: var(--blue-50);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-500);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-success {
    background: var(--green-600);
    color: #fff;
}

.btn-success:hover {
    background: #15803d;
    box-shadow: var(--shadow-md);
}

/* ==========================================
   Loading Overlay
   ========================================== */
.loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .obfuscator-card { padding: 20px; }
    .editor-panels { grid-template-columns: 1fr; }
    .editor-textarea { min-height: 220px; }
    .features-grid { grid-template-columns: 1fr; }
    .options-grid { grid-template-columns: 1fr; }
    .preset-row { gap: 8px; }
    .preset-btn { padding: 8px 16px; font-size: 0.82rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .obfuscator-card { padding: 14px; }
    .editor-textarea { font-size: 0.78rem; min-height: 180px; }
    .header-nav { gap: 16px; font-size: 0.82rem; }
    .actions-row { flex-direction: column; }
    .actions-row .stats-text { margin-left: 0; }
}
