:root {
    --bg-dark: #0e1420;
    --bg-gradient: radial-gradient(circle at 50% 20%, #172136 0%, #0b0f19 70%);
    --card-glass: rgba(255, 255, 255, 0.04);
    --card-glass-border: rgba(255, 255, 255, 0.12);
    --card-glass-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --backdrop-blur: blur(16px);
    --primary: #10b981;
    --primary-hover: #059669;
    --accent-pill: #10b981;
    --accent-pill-text: #ffffff;
    --secondary-pill: rgba(255, 255, 255, 0.08);
    --secondary-pill-border: rgba(255, 255, 255, 0.2);
    --secondary-pill-hover: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.7);
    --input-border: rgba(255, 255, 255, 0.18);
    --input-focus-border: #10b981;
    --terminal-bg: #090d16;
    --terminal-border: rgba(255, 255, 255, 0.15);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --radius-pill: 20px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body {
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Immovable Fixed Glass Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    padding: 0;
}

.wrap-logo-badges-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 58px;
    height: 58px;
    background: rgba(16, 185, 129, 0.08);
    border: 1.5px solid rgba(16, 185, 129, 0.3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
}

.logo-icon img, .logo-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.logo-text h1 span {
    color: #10b981;
    font-weight: 600;
}

.logo-text .tagline {
    font-size: 12px;
    color: var(--text-muted);
}

.header-badges {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* Nav Links Pill Container */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--card-glass-border);
    border-radius: var(--radius-pill);
    padding: 4px 6px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-links a.active {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    font-weight: 600;
}

/* Nav Pills Bar */
.wrap-nav-tabs {
    padding: 10px 20px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
}
.wrap-nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
}

.tab-btn {
    background: var(--secondary-pill);
    border: 1px solid var(--secondary-pill-border);
    color: #e2e8f0;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-btn:hover {
    background: var(--secondary-pill-hover);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.tab-btn.active {
    background: var(--accent-pill);
    border-color: var(--accent-pill);
    color: var(--accent-pill-text);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

/* Subtabs Bar inside Master Card */
.subtab-bar {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill);
    padding: 4px;
    width: fit-content;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.subtab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 7px 18px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.subtab-btn:hover {
    color: #ffffff;
}

.subtab-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.subtab-pane {
    display: none;
}

.subtab-pane.active {
    display: block;
}

.main-content {
    margin-top: 155px;
}

/* Glassmorphism Card Container */
.card {
    background: var(--card-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--card-glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-glass-glow);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-with-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header-with-badge h2 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.card-desc {
    color: var(--text-muted);
    font-size: 14px;
}

.mode-toggle-container {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
}

.mode-label {
    font-size: 13px;
    color: var(--text-muted);
}

.mode-toggle-group {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill);
    padding: 3px;
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 600;
}

/* Forms & Inputs */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: #ffffff;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-mono);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

textarea {
    resize: vertical;
    min-height: 110px;
}

/* Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--secondary-pill);
    border: 1px solid var(--secondary-pill-border);
    color: #ffffff;
    padding: 10px 22px;
    margin: 6px 4px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--secondary-pill-hover);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
    box-shadow: none !important;
}

.btn-primary {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.btn-primary:hover {
    background: #059669;
    border-color: #059669;
}

.btn-group, .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 12px;
}

/* File Upload Dropzone & Browse Button */
.dropzone {
    background: rgba(15, 23, 42, 0.5);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

.dropzone:hover, .dropzone.drag-over {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.dropzone-icon {
    font-size: 32px;
}

.dropzone-text {
    font-size: 14px;
    color: var(--text-muted);
}

.btn-browse {
    margin-top: 4px;
    pointer-events: auto;
}

.file-info {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
}

/* Results & Terminal Drawer */
.result-container, .terminal-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.terminal-box, .result-box {
    background: var(--terminal-bg);
    border: 1px solid var(--terminal-border);
    border-radius: var(--radius-md);
    padding: 14px;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.terminal-cmd-box {
    background: var(--terminal-bg);
    border: 1px solid var(--terminal-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    color: #34d399;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 24px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 30px;
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-nav a:hover, .footer-nav a.active {
    color: #10b981;
}

.footer-nav .sep {
    color: rgba(255, 255, 255, 0.15);
    font-size: 12px;
}

.app-footer a:hover {
    color: #ffffff;
}
