/* mechanic.stream — Frutiger Aero Dashboard */

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

:root {
    --bg-light: #E8F4F8;
    --purple-primary: #6B46C1;
    --teal-accent: #38B2AC;
    --gray-mid: #4A5568;
    --red-alert: #E53E3E;
    --white: #FFFFFF;
    --deep-navy: #1A2B3C;
    --lavender-soft: #D4B8F0;
    --ice-blue: #B8E6F0;
    --bg-gradient-end: #FFFFFF;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-gradient-end) 100%);
    color: var(--deep-navy);
}

/* Floating organic blobs */
.blob {
    position: fixed;
    border-radius: 50%;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    filter: blur(40px);
    animation: blobDrift 20s ease-in-out infinite, blobFadeIn 0.8s ease-out 0.2s forwards;
}

.blob-1 {
    width: 350px;
    height: 350px;
    background: var(--ice-blue);
    top: -50px;
    right: 15%;
    animation-delay: 0s;
}

.blob-2 {
    width: 280px;
    height: 280px;
    background: var(--lavender-soft);
    bottom: 10%;
    left: 20%;
    animation-delay: 5s;
}

.blob-3 {
    width: 200px;
    height: 200px;
    background: var(--ice-blue);
    top: 40%;
    right: 5%;
    animation-delay: 10s;
}

.blob-4 {
    width: 320px;
    height: 320px;
    background: var(--lavender-soft);
    top: 60%;
    left: 50%;
    animation-delay: 15s;
}

@keyframes blobDrift {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -20px); }
    50% { transform: translate(-20px, 30px); }
    75% { transform: translate(20px, 20px); }
}

@keyframes blobFadeIn {
    to { opacity: 0.2; }
}

/* Sidebar */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    transform: translateX(-280px);
    animation: sidebarSlideIn 0.4s ease-out 0.5s forwards;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
}

@keyframes sidebarSlideIn {
    to { transform: translateX(0); }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(107, 70, 193, 0.15);
}

.brand-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--deep-navy);
    letter-spacing: -0.01em;
}

.brand-dot {
    color: var(--teal-accent);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.nav-section-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--gray-mid);
    margin-bottom: 12px;
    margin-top: 16px;
    text-transform: uppercase;
}

.channel-list, .category-list {
    list-style: none;
    margin-bottom: 16px;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--deep-navy);
}

.channel-item:hover {
    background: rgba(107, 70, 193, 0.08);
    transform: translateX(2px);
}

.channel-item.active {
    background: rgba(107, 70, 193, 0.12);
    border-left: 3px solid var(--purple-primary);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red-alert);
    flex-shrink: 0;
    animation: livePulse 2s ease-in-out infinite;
}

.live-dot.offline {
    background: var(--gray-mid);
    opacity: 0.4;
    animation: none;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.channel-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.viewer-count {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 400;
    color: var(--gray-mid);
    opacity: 0.7;
}

.category-item {
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-mid);
    transition: background 0.2s ease, color 0.2s ease;
}

.category-item:hover {
    background: rgba(56, 178, 172, 0.1);
    color: var(--deep-navy);
}

.sidebar-status {
    padding-top: 16px;
    border-top: 1px solid rgba(107, 70, 193, 0.15);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--teal-accent);
    box-shadow: 0 0 6px rgba(56, 178, 172, 0.5);
}

.status-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--deep-navy);
}

.status-uptime {
    font-size: 11px;
    color: var(--gray-mid);
    margin-left: 16px;
}

/* Main Content */
#main-content {
    margin-left: 280px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: mainFadeIn 0.5s ease-out 0.7s forwards;
}

@keyframes mainFadeIn {
    to { opacity: 1; }
}

/* Top Bar */
#top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(107, 70, 193, 0.15);
    border-radius: 12px;
    padding: 10px 16px;
    width: 360px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-container:focus-within {
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.search-icon {
    flex-shrink: 0;
    opacity: 0.6;
}

.search-input {
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--deep-navy);
    width: 100%;
}

.search-input::placeholder {
    color: var(--gray-mid);
    opacity: 0.6;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-notify {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}

.btn-notify:hover {
    background: rgba(255, 255, 255, 0.9);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--purple-primary), var(--teal-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

/* Content Area */
#content-area {
    flex: 1;
    display: flex;
    padding: 20px 28px;
    gap: 20px;
    overflow: hidden;
}

#video-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* Video Viewport */
#video-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--deep-navy);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(26, 43, 60, 0.15);
}

.video-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 5;
    background: var(--deep-navy);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(56, 178, 172, 0.2);
    border-top-color: var(--teal-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--white);
    letter-spacing: 0.05em;
}

.video-content {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.video-content.visible {
    opacity: 1;
}

.video-workshop {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #0D1117 0%, #1A2B3C 50%, #2D3748 100%);
    overflow: hidden;
}

.workbench {
    position: absolute;
    bottom: 20%;
    left: 10%;
    right: 10%;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(56, 178, 172, 0.3), transparent);
    border-radius: 2px;
}

.tool {
    position: absolute;
    background: rgba(56, 178, 172, 0.15);
    border: 1px solid rgba(56, 178, 172, 0.3);
    border-radius: 4px;
}

.tool-1 {
    width: 60px;
    height: 8px;
    bottom: 22%;
    left: 25%;
    transform: rotate(-15deg);
}

.tool-2 {
    width: 45px;
    height: 6px;
    bottom: 24%;
    left: 50%;
    transform: rotate(5deg);
}

.tool-3 {
    width: 30px;
    height: 30px;
    bottom: 25%;
    right: 25%;
    border-radius: 50%;
    background: rgba(107, 70, 193, 0.1);
    border-color: rgba(107, 70, 193, 0.3);
}

.gear {
    position: absolute;
    animation: gearSpin 15s linear infinite;
}

.gear-1 {
    width: 60px;
    height: 60px;
    top: 30%;
    left: 35%;
}

.gear-2 {
    width: 45px;
    height: 45px;
    top: 35%;
    left: 50%;
    animation-direction: reverse;
    animation-duration: 12s;
}

@keyframes gearSpin {
    to { transform: rotate(360deg); }
}

.video-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3;
}

.live-badge {
    background: var(--red-alert);
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    animation: livePulse 2s ease-in-out infinite;
}

.video-title {
    color: var(--white);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 15px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    z-index: 3;
}

.control-left, .control-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
}

.time-display {
    color: var(--white);
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    font-weight: 400;
    opacity: 0.9;
}

/* Thumbnail Strip */
#thumbnail-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

#thumbnail-strip::-webkit-scrollbar {
    height: 4px;
}

#thumbnail-strip::-webkit-scrollbar-track {
    background: rgba(107, 70, 193, 0.05);
    border-radius: 2px;
}

#thumbnail-strip::-webkit-scrollbar-thumb {
    background: rgba(107, 70, 193, 0.2);
    border-radius: 2px;
}

.thumbnail {
    flex-shrink: 0;
    width: 160px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.thumbnail:hover {
    transform: translateY(-2px);
}

.thumbnail.active .thumb-preview {
    border: 2px solid var(--purple-primary);
    box-shadow: 0 2px 12px rgba(107, 70, 193, 0.2);
}

.thumb-preview {
    width: 160px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.thumb-preview svg {
    width: 100%;
    height: 100%;
}

.thumb-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--deep-navy);
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumb-live {
    font-size: 10px;
    font-weight: 600;
    color: var(--red-alert);
    letter-spacing: 0.05em;
}

.thumb-live.offline {
    color: var(--gray-mid);
    opacity: 0.5;
}

/* Meta Panel */
#meta-panel {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.meta-tabs {
    display: flex;
    border-bottom: 1px solid rgba(107, 70, 193, 0.1);
}

.meta-tab {
    flex: 1;
    padding: 14px 8px;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-mid);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    border-bottom: 2px solid transparent;
}

.meta-tab:hover {
    color: var(--deep-navy);
}

.meta-tab.active {
    color: var(--purple-primary);
    border-bottom-color: var(--purple-primary);
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tab-content::-webkit-scrollbar {
    width: 4px;
}

.tab-content::-webkit-scrollbar-thumb {
    background: rgba(107, 70, 193, 0.2);
    border-radius: 2px;
}

/* Stream Info Cards */
.stream-info-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.stream-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--deep-navy);
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.stream-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.meta-item {
    font-size: 13px;
    color: var(--gray-mid);
}

.meta-label {
    font-weight: 600;
    color: var(--deep-navy);
}

.stream-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(107, 70, 193, 0.1);
    color: var(--purple-primary);
}

.card-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--deep-navy);
    margin-bottom: 12px;
}

/* Operation Steps */
.operation-detail {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.operation-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.operation-step.active {
    background: rgba(56, 178, 172, 0.1);
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(107, 70, 193, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--purple-primary);
    flex-shrink: 0;
}

.operation-step.active .step-num {
    background: var(--teal-accent);
    color: var(--white);
}

.step-name {
    font-size: 13px;
    color: var(--deep-navy);
    font-weight: 500;
}

/* Equipment List */
.equipment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.equipment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--deep-navy);
}

.eq-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.eq-status.on {
    background: var(--teal-accent);
    box-shadow: 0 0 6px rgba(56, 178, 172, 0.5);
}

.eq-status.standby {
    background: #ECC94B;
    box-shadow: 0 0 6px rgba(236, 201, 75, 0.5);
}

.eq-name {
    font-weight: 500;
}

/* Chat */
#tab-chat.active {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(107, 70, 193, 0.2);
    border-radius: 2px;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-user {
    font-size: 12px;
    font-weight: 600;
    color: var(--purple-primary);
}

.chat-text {
    font-size: 13px;
    color: var(--deep-navy);
    line-height: 1.4;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(107, 70, 193, 0.1);
}

.chat-input {
    flex: 1;
    border: 1px solid rgba(107, 70, 193, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.7);
    outline: none;
    color: var(--deep-navy);
    transition: border-color 0.2s ease;
}

.chat-input:focus {
    border-color: var(--purple-primary);
}

.chat-send-btn {
    background: var(--purple-primary);
    color: var(--white);
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-send-btn:hover {
    background: #553C9A;
}

/* Tool Feed */
.tool-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-entry {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(107, 70, 193, 0.06);
}

.tool-time {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 400;
    color: var(--teal-accent);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tool-action {
    font-size: 13px;
    color: var(--deep-navy);
    line-height: 1.4;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1200px) {
    #meta-panel {
        width: 280px;
    }
}

@media (max-width: 1000px) {
    #sidebar {
        width: 240px;
    }
    #main-content {
        margin-left: 240px;
    }
    #meta-panel {
        width: 240px;
    }
}
