:root {
    --bg: #030705;
    --bg-card: rgba(8, 14, 10, 0.6);
    --bg-elevated: #0e1811;
    --border: rgba(34, 197, 94, 0.12);
    --border-hover: rgba(34, 197, 94, 0.3);
    --text: #e2f0e7;
    --text-muted: #62826d;
    --accent: #22c55e;
    --accent-cyan: #06b6d4;
    --accent-grad: linear-gradient(135deg, #22c55e 0%, #06b6d4 100%);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 16px;
    --glow-green: rgba(34, 197, 94, 0.2);
    --glow-cyan: rgba(6, 182, 212, 0.15);
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Background Orbs */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
}

.orb-green {
    width: 500px;
    height: 500px;
    background: rgba(34, 197, 94, 0.08);
    top: -150px;
    right: -100px;
}

.orb-cyan {
    width: 400px;
    height: 400px;
    background: rgba(6, 182, 212, 0.06);
    bottom: -100px;
    left: -50px;
}

/* App Layout */
.app-container {
    width: 100%;
    max-width: 1200px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

header {
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 36px;
    filter: drop-shadow(0 0 10px var(--glow-green));
}

header h1 {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1px;
    color: #fff;
    text-transform: uppercase;
}

header h1 span {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 400;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 32px;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphism Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: border-color 0.3s;
}

.card:hover {
    border-color: var(--border-hover);
}

.card h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    letter-spacing: -0.5px;
}

/* Inputs & Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

.input-with-icon {
    display: flex;
    align-items: center;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 16px;
}

.input-with-icon input {
    padding-left: 36px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    background: rgba(14, 24, 17, 0.5);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #fff;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
    background: rgba(14, 24, 17, 0.8);
}

/* Guide Accordion */
.btn-text {
    background: none;
    border: none;
    color: var(--accent-cyan);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    align-self: flex-start;
    padding: 4px 0;
    transition: opacity 0.2s;
}

.btn-text:hover {
    opacity: 0.8;
}

.guide-box {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(6, 182, 212, 0.03);
    border-radius: 10px;
    padding: 0 16px;
    border: 0 solid transparent;
}

.guide-box.active {
    max-height: 500px;
    padding: 16px;
    border: 1px dashed rgba(6, 182, 212, 0.2);
    margin-top: 8px;
}

.guide-box ol {
    margin-left: 20px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
}

.guide-box ol li {
    margin-bottom: 8px;
}

.guide-box a {
    color: var(--accent-cyan);
    text-decoration: underline;
}

.warning-text {
    font-size: 11px;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 12px;
}

/* Checkboxes */
.options-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.options-group h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

.checkbox-container {
    display: block;
    position: relative;
    padding-left: 32px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    color: var(--text);
    line-height: 20px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background: rgba(14, 24, 17, 0.5);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--accent);
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--accent-grad);
    border-color: transparent;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Buttons */
.btn {
    padding: 14px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

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

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

.btn-primary {
    background: var(--accent-grad);
    color: #000;
    box-shadow: 0 4px 15px var(--glow-green);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.btn-secondary {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid var(--border);
    color: var(--accent);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--accent);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ff8080;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: #fff;
}

.control-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

/* Status Panel Styling */
.status-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(14, 24, 17, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.status-label {
    color: var(--text-muted);
    font-weight: 500;
}

.value-highlight {
    font-weight: 700;
    color: #fff;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-inactive {
    background: rgba(255, 255, 255, 0.08);
    color: #a0aec0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.status-starting {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent);
    border: 1px solid var(--border);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.15);
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ff8080;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Console Logs Window */
.console-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #010402;
    border: 1px solid var(--border);
    border-radius: 12px;
    min-height: 250px;
    overflow: hidden;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(14, 24, 17, 0.8);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--text-muted);
}

.btn-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-clear:hover {
    color: #fff;
}

.console-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
}

.log-line {
    word-break: break-all;
}

.log-error {
    color: #ff8080;
}

.log-success {
    color: #86efac;
}

.text-muted {
    color: var(--text-muted);
}

/* Iframe mode overrides for seamless integration */
body.in-iframe {
    background: transparent !important;
    padding: 0 !important;
    min-height: auto !important;
}
body.in-iframe .ambient-orb {
    display: none !important;
}
body.in-iframe header {
    display: none !important;
}
body.in-iframe .app-container {
    padding: 0 !important;
    gap: 0 !important;
}
body.in-iframe #backLinkContainer {
    display: none !important;
}

/* Custom Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    transition: .3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: rgba(34, 197, 94, 0.15);
    border-color: var(--accent);
}
input:checked + .slider:before {
    transform: translateX(20px);
    background-color: var(--accent);
}

/* Custom Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    transition: .3s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: rgba(34, 197, 94, 0.15);
    border-color: var(--accent);
}
input:checked + .slider:before {
    transform: translateX(20px);
    background-color: var(--accent);
}


