:root {
    --bg-dark: #0b0f19;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-hover-border: rgba(255, 255, 255, 0.12);
    
    --primary: #4facfe;
    --primary-end: #00f2fe;
    --primary-glow: rgba(79, 172, 254, 0.3);
    
    --success: #00ff87;
    --success-end: #60efff;
    --success-glow: rgba(0, 255, 135, 0.25);
    
    --warn: #f5af19;
    --error: #ff5e62;
    --error-glow: rgba(255, 94, 98, 0.25);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #020617;
    
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Blur Orbs */
.bg-blur-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.12;
    pointer-events: none;
    animation: float 20s infinite alternate ease-in-out;
}

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

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--primary-end);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: purple;
    top: 30%;
    left: 60%;
    animation-delay: -10s;
}

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

/* Main Container */
.app-container {
    width: 100%;
    max-width: 1280px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-radius: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-dark);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.brand h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #b4c6ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-indicator.online {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 135, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(0, 255, 135, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 135, 0); }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 1.5rem;
}

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

/* Glass Panels */
.panel {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.panel-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

/* Form Styles */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

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

.input-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background: rgba(0, 0, 0, 0.35);
}

.toggle-password-btn {
    position: absolute;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.toggle-password-btn:hover {
    color: var(--text-main);
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Options / Toggle switches */
.options-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.01);
    padding: 1rem;
    border: 1px solid var(--card-border);
    border-radius: 16px;
}

.toggle-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.toggle-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Switch UI */
.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;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: var(--text-main);
    transition: .3s;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary), var(--primary-end));
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.1rem 2rem;
    border-radius: 14px;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-end));
    color: var(--text-dark);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--primary-glow);
}

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

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-end));
    color: var(--text-dark);
    box-shadow: 0 4px 20px var(--success-glow);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--success-glow);
}

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

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

.btn-pulse {
    animation: btn-pulse-anim 2s infinite;
}

@keyframes btn-pulse-anim {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 135, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(0, 255, 135, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 135, 0); }
}

/* Right Column Layout */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 500px;
}

/* Progress Panel */
.progress-panel {
    padding: 1.5rem 1.75rem;
}

#progressSpinner {
    animation: spin 2.5s linear infinite;
    display: none;
}

#progressSpinner.active {
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.steps-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.step-line {
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    z-index: 2;
    width: 18%;
    text-align: center;
    position: relative;
}

.step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.step-dot i {
    display: none;
}

.step-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.step-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.step-desc {
    font-size: 0.65rem;
    color: rgba(148, 163, 184, 0.7);
    line-height: 1.2;
}

/* Step States */
.step-item.active .step-dot {
    border-color: var(--primary);
    background: rgba(79, 172, 254, 0.1);
    color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    animation: pulse-blue 1.5s infinite alternate;
}

.step-item.active .step-title {
    color: var(--primary);
}

.step-item.success .step-dot {
    border-color: var(--success);
    background: rgba(0, 255, 135, 0.1);
    color: var(--success);
}

.step-item.success .step-dot i {
    display: inline-block;
}

.step-item.success .step-title {
    color: var(--success);
}

.step-item.failed .step-dot {
    border-color: var(--error);
    background: rgba(255, 94, 98, 0.1);
    color: var(--error);
}

.step-item.failed .step-title {
    color: var(--error);
}

@keyframes pulse-blue {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); box-shadow: 0 0 16px rgba(79, 172, 254, 0.5); }
}

@media (max-width: 768px) {
    .steps-container {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
        padding-left: 1rem;
    }
    
    .step-line {
        left: 27px;
        top: 20px;
        bottom: 20px;
        width: 2px;
        height: auto;
    }

    .step-item {
        flex-direction: row;
        width: 100%;
        text-align: left;
        gap: 1rem;
    }
    
    .step-dot {
        flex-shrink: 0;
    }
}

/* Terminal View */
.terminal-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
    margin-bottom: 0.75rem;
}

.terminal-header .panel-title {
    margin: 0;
}

.icon-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: var(--transition);
}

.icon-action-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.terminal-body {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-y: auto;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.console-row {
    display: flex;
    gap: 0.75rem;
    word-break: break-all;
}

.console-row .timestamp {
    color: #4b5563;
    flex-shrink: 0;
}

.console-row .prefix {
    font-weight: 500;
    flex-shrink: 0;
}

.console-row.system-msg {
    color: #38bdf8;
}

.console-row.info-msg {
    color: #94a3b8;
}

.console-row.success-msg {
    color: var(--success);
}

.console-row.warn-msg {
    color: var(--warn);
}

.console-row.error-msg {
    color: var(--error);
}

.console-row.done-msg {
    color: #a78bfa;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(167, 139, 250, 0.4);
}

/* Custom Scrollbar */
.terminal-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal Overlay styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

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

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    max-width: 480px;
    width: 90%;
    padding: 2.5rem;
    border-radius: 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), var(--success-end));
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 8px 30px var(--success-glow);
    margin-bottom: 0.5rem;
}

.modal-content h3 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-details {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

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

.detail-value {
    font-weight: 600;
}

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

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.5rem;
}

.modal-actions .btn {
    width: 100%;
}

/* Animations */
.animate-zoom {
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Browser Preview Styles */
.browser-preview-panel {
    padding: 1.5rem 1.75rem;
}

.browser-preview-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.browser-screenshot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    border-radius: 12px;
}

.browser-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.browser-placeholder i {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px var(--primary-glow));
}

.browser-placeholder p {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Progress Stats Container & Premium Controls */
.progress-stats-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 1.25rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar-wrapper {
    flex-grow: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-end));
    box-shadow: 0 0 8px var(--primary-glow);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-percent {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 35px;
    text-align: right;
}

.controls-wrapper {
    display: flex;
    justify-content: stretch;
}

.btn-control {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-pause {
    background: rgba(245, 175, 25, 0.1);
    color: var(--warn);
    border: 1px solid rgba(245, 175, 25, 0.25);
    box-shadow: 0 4px 15px rgba(245, 175, 25, 0.05);
}

.btn-pause:hover:not(:disabled) {
    background: rgba(245, 175, 25, 0.2);
    box-shadow: 0 4px 20px rgba(245, 175, 25, 0.15);
    transform: translateY(-1px);
}

.btn-resume {
    background: rgba(0, 255, 135, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 255, 135, 0.25);
    box-shadow: 0 4px 15px rgba(0, 255, 135, 0.05);
}

.btn-resume:hover:not(:disabled) {
    background: rgba(0, 255, 135, 0.2);
    box-shadow: 0 4px 20px rgba(0, 255, 135, 0.15);
    transform: translateY(-1px);
}

.btn-control:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
