/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-gradient: linear-gradient(135deg, #0f0c1b 0%, #15102a 50%, #090611 100%);
    --panel-bg: rgba(22, 17, 43, 0.45);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-border-focus: rgba(0, 242, 254, 0.4);
    
    --text-main: #f0ecfa;
    --text-muted: #a39eb9;
    
    --accent-cyan: #00f2fe;
    --accent-purple: #9b51e0;
    --accent-indigo: #4f46e5;
    
    --color-success: #059669;
    --color-success-glow: rgba(5, 150, 105, 0.2);
    --color-error: #dc2626;
    --color-warn: #d97706;
    --color-idle: #4b5563;
    
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    font-family: var(--font-sans);
    background-color: #0f0c1b;
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
}

/* Background animated glow */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-gradient);
    z-index: -2;
}

.glass-bg::after {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(155, 81, 224, 0.15) 0%, rgba(0, 242, 254, 0) 70%);
    z-index: -1;
    pointer-events: none;
    animation: rotateGlow 25s infinite linear;
}

@keyframes rotateGlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-100px, 80px) rotate(180deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

/* App Container Layout */
.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: rgba(13, 10, 26, 0.75);
    border-right: 1px solid var(--panel-border);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.brand {
    text-align: center;
    margin-bottom: 3.5rem;
}

.logo-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.4));
    margin-bottom: 0.8rem;
}

.brand h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand h2 span {
    color: var(--accent-cyan);
}

.brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.3rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex-grow: 1;
}

.nav-item {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 1rem 1.2rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-smooth);
}

.nav-item i {
    font-size: 1.1rem;
    transition: var(--transition-smooth);
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.3) 0%, rgba(155, 81, 224, 0.15) 100%);
    border-color: rgba(0, 242, 254, 0.25);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.15);
}

.nav-item.active i {
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.5));
}

.status-panel {
    border-top: 1px solid var(--panel-border);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.pulse-dot.idle {
    background-color: var(--color-idle);
    box-shadow: 0 0 8px var(--color-idle);
}

.pulse-dot.active {
    background-color: var(--color-success);
    box-shadow: 0 0 10px var(--color-success);
    animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.2); opacity: 1; }
}

/* Main Content Styling */
.main-content {
    margin-left: 280px;
    width: calc(100vw - 280px);
    min-height: 100vh;
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.main-header {
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 1.5rem;
}

.header-title h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 40%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-title p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.4rem;
}

/* Tabs Visibility */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grids */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
}

.grid-2col-unequal {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
}

/* Glass Panels / Cards */
.card {
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--accent-cyan);
}

.card-body {
    padding: 1.8rem;
}

/* Form Inputs */
.form-group {
    margin-bottom: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="url"],
select,
textarea {
    width: 100%;
    background: rgba(10, 8, 22, 0.6);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

input[type="text"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    border-color: var(--panel-border-focus);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
    background: rgba(10, 8, 22, 0.85);
}

textarea {
    resize: vertical;
}

/* Buttons */
.btn {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: var(--transition-smooth);
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
    filter: brightness(1.1);
}

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

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

.btn-success {
    background: var(--color-success);
    color: #fff;
    box-shadow: 0 4px 15px var(--color-success-glow);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
    filter: brightness(1.15);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Terminal Console */
.terminal-header {
    background: rgba(10, 8, 20, 0.4);
}

.terminal {
    height: 250px;
    background: rgba(5, 3, 12, 0.85);
    padding: 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    overflow-y: auto;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.terminal-line {
    margin-bottom: 0.4rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.terminal-line.system { color: var(--text-muted); }
.terminal-line.log { color: #38bdf8; }
.terminal-line.success { color: #34d399; }
.terminal-line.error { color: #f87171; }
.terminal-line.warning { color: #fbbf24; }

/* Table styling */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--panel-border);
}

th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-size: 0.9rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 1rem;
    background: rgba(10, 8, 22, 0.4);
}

.checkbox-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.6rem;
    max-height: 140px;
    overflow-y: auto;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 0.8rem;
    background: rgba(10, 8, 22, 0.4);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.checkbox-item:has(input:checked) {
    background: rgba(230, 126, 34, 0.25);
    border-color: rgba(230, 126, 34, 0.5);
    border-radius: 4px;
    font-weight: bold;
    color: #ff9f43;
    text-shadow: 0 0 5px rgba(230, 126, 34, 0.4);
}

.checkbox-item input[type="checkbox"] {
    accent-color: var(--accent-cyan);
    width: 15px;
    height: 15px;
}

.select-all-container {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--panel-border);
    margin-bottom: 1.2rem;
}

.toggle-text h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.toggle-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-idle);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent-cyan);
}

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

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

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

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

/* Editor Panel Close Button */
.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

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

.mt-4 { margin-top: 1.5rem; }
.p-0 { padding: 0 !important; }
.placeholder-text {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 1.5rem 0;
}

.learning-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.step-item {
    display: flex;
    gap: 1.2rem;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-indigo);
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.step-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.step-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    margin-bottom: 0.6rem;
}

.scan-results-box {
    background: var(--color-success-glow);
    border: 1px solid var(--color-success);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-top: 1.5rem;
}

.scan-results-box h4 {
    color: #34d399;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.scan-results-box ul {
    list-style: none;
    font-size: 0.85rem;
    display: flex;
    gap: 1.5rem;
}

.scan-results-box li span {
    font-weight: bold;
    color: #fff;
}

/* Estilos para inputs dentro de tablas */
.input-table {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}
.input-table:focus {
    border-color: var(--accent-cyan);
    background: rgba(0, 0, 0, 0.5);
    outline: none;
    box-shadow: 0 0 5px rgba(0, 242, 254, 0.3);
}
