:root {
    --bg-color: #0d1117;
    --text-primary: #e6edf3;
    --text-secondary: #7d8590;
    --primary-color: #238636;
    --primary-hover: #2ea043;
    --glass-bg: rgba(22, 27, 34, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(1, 4, 9, 0.8);
    --input-focus-border: #58a6ff;
    --blob-1: #238636;
    --blob-2: #1f6feb;
    --danger: #f85149;
    --success: #3fb950;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
}

/* Background Blobs for Glassmorphism */
.blob-1, .blob-2 {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.4;
    animation: float 15s ease-in-out infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background-color: var(--blob-1);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background-color: var(--blob-2);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.container {
    display: flex;
    max-width: 1000px;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    gap: 40px;
    z-index: 1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 24px;
    }
}

/* Guide Panel */
.guide-panel {
    flex: 1;
    min-width: 300px;
    border-left: 1px solid var(--glass-border);
    padding-left: 40px;
}

@media (max-width: 768px) {
    .guide-panel {
        border-left: none;
        border-top: 1px solid var(--glass-border);
        padding-left: 0;
        padding-top: 24px;
    }
}

.guide-panel h2 {
    font-size: 24px;
    margin-bottom: 24px;
    background: linear-gradient(90deg, #e6edf3, #7d8590);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.step-content h3 {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 500;
}

.step-content p, .step-content code {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.step-content code {
    background: rgba(0,0,0,0.5);
    padding: 2px 6px;
    border-radius: 4px;
    color: #58a6ff;
    word-break: break-all;
}

.official-link {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px dashed var(--glass-border);
}

.official-link p {
    font-size: 14px;
    color: var(--text-secondary);
}

.official-link a {
    color: #58a6ff;
    text-decoration: none;
    font-weight: 500;
}

.official-link a:hover {
    text-decoration: underline;
}

/* Action Panel */
.action-panel {
    flex: 1.5;
    min-width: 300px;
}

.glass-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
    letter-spacing: -0.5px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.required {
    color: var(--danger);
    margin-left: 4px;
}

.helper-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.helper-text a {
    color: #58a6ff;
    text-decoration: none;
}
.helper-text a:hover {
    text-decoration: underline;
}

.field-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.field-stack textarea {
    width: 100%;
}
.btn-error-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-with-btn {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.success-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success);
    font-size: 16px;
    font-weight: bold;
}

.status-inline {
    font-size: 12px;
    margin-left: 8px;
    font-weight: 500;
}
.status-inline.error {
    color: var(--danger);
}

.input-with-btn.align-start {
    align-items: flex-start;
}

input[type="text"], textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    resize: vertical;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.status-msg {
    font-size: 12px;
    margin-top: 8px;
    min-height: 18px;
    transition: color 0.3s ease;
}

.status-msg.success { color: var(--success); }
.status-msg.error { color: var(--danger); }
.status-msg.extracted { color: var(--success); font-weight: 500; }

.url-display input {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    border: 1px dashed rgba(88, 166, 255, 0.4);
}

/* Row Align Form Group for Radio */
.row-align {
    display: flex;
    align-items: center;
    gap: 16px;
}
.row-label {
    margin-bottom: 0 !important;
}

/* Segmented Control Radio */
.radio-group-segmented {
    display: flex;
    gap: 8px;
    padding: 4px;
}

.segmented-card {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.segmented-card input[type="radio"] {
    display: none;
}

.segmented-card .text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.segmented-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.segmented-card:has(input[type="radio"]:disabled) {
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
    opacity: 0.45;
}

.segmented-card:has(input[type="radio"]:disabled):hover {
    background: rgba(255, 255, 255, 0.03);
}

.segmented-card input[type="radio"]:disabled ~ .text {
    color: rgba(230, 237, 243, 0.45);
}

.segmented-card input[type="radio"]:checked ~ .text {
    color: #58a6ff;
}

.segmented-card:has(input[type="radio"]:checked) {
    background: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.4);
}

/* Action Buttons */
.action-buttons-bottom {
    margin-top: 32px;
    margin-bottom: 24px;
    display: flex;
}

.action-buttons-bottom .btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

.btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.align-self-stretch {
    align-self: stretch;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

/* Console */
.console {
    background: #010409;
    border-radius: 12px;
    padding: 16px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    color: #8b949e;
    min-height: 80px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
}

.console p { margin-bottom: 4px; }
.console .log-info { color: #8b949e; }
.console .log-success { color: #56d364; }
.console .log-error { color: #f85149; }
.console .log-warn { color: #e3b341; }
