:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --border-color: #2a2a3a;
    --border-hover: #3a3a4a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.4);
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.4);
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -200px;
    opacity: 0.15;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
    bottom: -150px;
    left: -150px;
    opacity: 0.12;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo svg {
    width: 48px;
    height: 48px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Options Panel */
.options-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.options-panel h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.options-panel h2 svg {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

.options-grid {
    display: grid;
    gap: 1rem;
}

/* Option Card */
.option-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.option-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.option-card.disabled {
    opacity: 0.4 !important;
    filter: grayscale(50%);
}

.option-card.disabled:hover {
    border-color: var(--border-color);
    background: var(--bg-secondary);
}

.option-card.disabled input {
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

/* Number input group in option card (port-style) */
.option-input-group {
    flex-shrink: 0;
    text-align: center;
}

.option-input-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.option-input-group input {
    width: 100px;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    text-align: center;
    transition: all 0.2s ease;
}

.option-input-group input:hover {
    border-color: var(--border-hover);
}

.option-input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.option-input-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Port input inside option card - don't stretch */
.option-card .port-input-group {
    flex: 0;
    max-width: none;
}

.option-card .port-input-group input {
    width: 100px;
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.toggle-label {
    cursor: pointer;
    flex: 1;
}

.option-title {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.option-desc {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 28px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle input:checked + .toggle-slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background: white;
}

.toggle input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Port Section */
.port-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.port-section h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.port-section h3 svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.port-inputs {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: center;
}

.port-input-group {
    flex: 1;
    max-width: 200px;
}

.port-input-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.port-input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.port-input-group input:hover {
    border-color: var(--border-hover);
}

.port-input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.port-separator {
    color: var(--text-muted);
    padding-top: 1.5rem;
}

.port-separator svg {
    width: 24px;
    height: 24px;
}

/* Compile Section */
.compile-section {
    text-align: center;
    padding: 2rem 0;
}

.compile-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.compile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.compile-btn:active {
    transform: translateY(0);
}

.compile-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.compile-btn svg {
    width: 24px;
    height: 24px;
}

.compile-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Status */
.status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status.hidden {
    display: none;
}

.status.loading {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.status.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.status.loading .status-icon {
    border: 2px solid var(--accent-primary);
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

.status.success .status-icon {
    background: var(--success);
}

.status.error .status-icon {
    background: var(--error);
}

/* Download Section */
.download-section {
    margin-top: 1.5rem;
}

.download-section.hidden {
    display: none;
}

.download-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--success);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 20px var(--success-glow);
}

.download-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
}

.download-icon svg {
    width: 24px;
    height: 24px;
    color: var(--success);
}

.download-info {
    flex: 1;
    text-align: left;
}

.download-filename {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: var(--text-primary);
}

.download-desc {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.download-btn {
    padding: 0.75rem 1.5rem;
    background: var(--success);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: #0d9669;
    transform: translateY(-1px);
}

/* Direct Link Section */
.direct-link-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(16, 185, 129, 0.3);
}

.direct-link-section label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.link-input-group {
    display: flex;
    gap: 0.5rem;
}

.link-input-group input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.copy-btn {
    padding: 0.6rem 0.75rem;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.copy-btn svg {
    width: 18px;
    height: 18px;
}

/* Info Section */
.info-section {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.info-card {
    display: flex;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.info-card svg {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.info-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-card code {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-primary);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

footer p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    .logo h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .options-panel {
        padding: 1.25rem;
    }
    
    .port-inputs {
        flex-direction: column;
        gap: 1rem;
    }
    
    .port-input-group {
        max-width: 100%;
        width: 100%;
    }
    
    .port-separator {
        transform: rotate(90deg);
        padding: 0;
    }
    
    .download-card {
        flex-direction: column;
        text-align: center;
    }
    
    .download-info {
        text-align: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-card {
    animation: fadeIn 0.3s ease forwards;
}

.option-card:nth-child(1) { animation-delay: 0.05s; }
.option-card:nth-child(2) { animation-delay: 0.1s; }
.option-card:nth-child(3) { animation-delay: 0.15s; }
.option-card:nth-child(4) { animation-delay: 0.2s; }
.option-card:nth-child(5) { animation-delay: 0.25s; }
