:root {
    --iot-bg: #050510;
    --iot-card-bg: rgba(15, 15, 35, 0.7);
    --iot-accent: #00ffcc;
    --iot-secondary: #ffd700;
    --iot-text: #ffffff;
    --iot-text-dim: #888888;
    --iot-border: rgba(255, 255, 255, 0.1);
    --iot-glass: rgba(255, 255, 255, 0.05);
}

.iot-adv-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--iot-bg);
    color: var(--iot-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow: hidden;
}

.iot-adv-header {
    background: linear-gradient(90deg, #1a1a3a, #0a0a20);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--iot-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 10;
}

.iot-adv-tabs {
    display: flex;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--iot-border);
}

.iot-tab-btn {
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: none;
    color: var(--iot-text-dim);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.iot-tab-btn.active {
    background: var(--iot-accent);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.4);
}

.iot-adv-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    flex: 1;
    overflow: hidden;
}

.iot-workbench {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, #151530 0%, #050510 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.iot-canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.iot-sidebar {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border-left: 1px solid var(--iot-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.iot-comp-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.iot-comp-card {
    background: var(--iot-glass);
    border: 1px solid var(--iot-border);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.iot-comp-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--iot-accent);
    transform: translateX(5px);
}

.iot-comp-card.selected {
    border-color: var(--iot-accent);
    background: rgba(0, 255, 204, 0.1);
    box-shadow: inset 0 0 10px rgba(0, 255, 204, 0.1);
}

.iot-telemetry {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    gap: 1rem;
    pointer-events: none;
}

.iot-stat-box {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--iot-border);
    border-top: 3px solid var(--iot-accent);
    min-width: 140px;
}

.iot-stat-label {
    font-size: 0.65rem;
    color: var(--iot-text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}

.iot-stat-value {
    font-size: 1.4rem;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
}

/* Coding Tab Styles */
.iot-editor-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #0d0d1a;
}

.iot-editor-header {
    padding: 1rem;
    background: #1a1a2e;
    border-bottom: 1px solid var(--iot-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.iot-code-area {
    flex: 1;
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    background: #0d0d1a;
    color: #d1d1d1;
    border: none;
    resize: none;
    outline: none;
    line-height: 1.6;
}

/* Tab Content Base */
#tab-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Cloud Tab Styles */
.iot-cloud-dashboard {
    flex: 1;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: var(--iot-accent) transparent;
}

.iot-cloud-dashboard::-webkit-scrollbar {
    width: 6px;
}

.iot-cloud-dashboard::-webkit-scrollbar-thumb {
    background: var(--iot-accent);
    border-radius: 10px;
}

.iot-chart-card {
    background: var(--iot-card-bg);
    border: 1px solid var(--iot-border);
    border-radius: 16px;
    padding: 1.5rem;
    height: 350px;
    display: flex;
    flex-direction: column;
}

.iot-chart-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--iot-accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Glass Buttons */
.iot-glass-btn {
    padding: 0.8rem 1.5rem;
    background: var(--iot-glass);
    border: 1px solid var(--iot-border);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.iot-glass-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.iot-glass-btn-primary {
    background: var(--iot-accent);
    color: #000;
    border: none;
}

.iot-glass-btn-primary:hover {
    background: #00e6b8;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
}

/* Glassmorphism Overlays */
.glass-overlay {
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}
