/* ==========================================
   EasyAnnotate Petroleum AI - Core Design System
   Tailored for Nanjing Yicai Petroleum Technology Co., Ltd.
   Technical Support by Jiangsu Yunliang Big Data Co., Ltd.
   Premium Dark-Tech Aesthetic (Worth Millions of RMB)
   ========================================== */

:root {
    --bg-main: #040811;
    --bg-panel: rgba(10, 18, 36, 0.75);
    --bg-panel-hover: rgba(16, 28, 54, 0.9);
    --bg-header: #060b16;
    --border-color: rgba(0, 240, 255, 0.15);
    --border-hover: rgba(0, 240, 255, 0.4);
    
    --primary: #00f0ff;
    --primary-glow: rgba(0, 240, 255, 0.35);
    --secondary: #b5179e;
    --secondary-glow: rgba(181, 23, 158, 0.35);
    --tertiary: #7209b7;
    
    --text-primary: #f2f7fc;
    --text-secondary: #a5bccc;
    --text-muted: #5c758c;
    
    --success: #390099;
    --success-glow: rgba(57, 0, 153, 0.2);
    --success-neon: #00f5d4;
    --warning: #ffb703;
    --warning-glow: rgba(255, 183, 3, 0.2);
    --danger: #ff0054;
    --danger-glow: rgba(255, 0, 84, 0.2);
    
    --font-main: 'Outfit', 'Inter', 'Segoe UI', -apple-system, sans-serif;
    --glass-blur: blur(16px);
    --card-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    --neon-shadow: 0 0 20px var(--primary-glow);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(181, 23, 158, 0.08) 0px, transparent 40%),
        radial-gradient(at 50% 0%, rgba(0, 240, 255, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(10, 18, 36, 0.95) 0px, var(--bg-main) 100%);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    pointer-events: none;
}

.glass-panel:hover {
    border-color: var(--border-hover);
    box-shadow: 0 16px 50px 0 rgba(0, 240, 255, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

/* Typography & General Utilities */
h1, h2, h3, h4, h5 {
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(120deg, #fff 40%, #c4d9ec 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-neon);
    display: inline-block;
    box-shadow: 0 0 10px var(--success-neon);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 245, 212, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 245, 212, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 245, 212, 0); }
}

/* Interactive Elements */
.glow-button {
    background: linear-gradient(135deg, var(--secondary) 0%, rgba(181, 23, 158, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-size: 13px;
}

.glow-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(181, 23, 158, 0.45), 0 0 8px rgba(255,255,255,0.1);
    background: linear-gradient(135deg, var(--secondary) 0%, rgba(181, 23, 158, 0.85) 100%);
    border-color: rgba(255,255,255,0.25);
}

.glow-button:active {
    transform: translateY(0);
}

.glow-button-primary {
    background: linear-gradient(135deg, var(--primary) 0%, rgba(0, 240, 255, 0.6) 100%);
    color: #040811;
    font-weight: 600;
    border-color: rgba(0, 240, 255, 0.2);
}

.glow-button-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.45);
    background: linear-gradient(135deg, var(--primary) 0%, rgba(0, 240, 255, 0.95) 100%);
    border-color: rgba(0, 240, 255, 0.4);
}

/* ==========================================
   Login Layout
   ========================================== */
#login-container {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #0e1e38 0%, #03060c 100%);
    transition: opacity 0.6s, transform 0.6s ease;
}

#login-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

#login-container.hide {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.login-card-wrap {
    width: 480px;
    padding: 48px;
    border-radius: 28px;
    background: rgba(8, 15, 28, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.2);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 50px rgba(0, 240, 255, 0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 10;
    backdrop-filter: blur(20px);
}

.login-card-wrap::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.login-brand {
    margin-bottom: 36px;
}

.login-brand .logo-icon {
    font-size: 52px;
    color: var(--primary);
    text-shadow: var(--neon-shadow);
    margin-bottom: 16px;
    display: inline-block;
    animation: float 5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.login-brand h2 {
    font-size: 26px;
    margin-bottom: 8px;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 0.05em;
}

.login-support-badge {
    margin: 16px 0 24px 0;
    background: rgba(0, 240, 255, 0.05);
    border: 1px dashed rgba(0, 240, 255, 0.2);
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.form-field {
    margin-bottom: 22px;
    text-align: left;
    position: relative;
}

.form-field label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrap {
    position: relative;
}

.input-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.3s;
}

.input-wrap input, .input-wrap select {
    width: 100%;
    padding: 15px 16px 15px 46px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.input-wrap select option {
    background: #080f1c;
    color: #fff;
}

.input-wrap input:focus, .input-wrap select:focus {
    border-color: var(--primary);
    background: rgba(0, 240, 255, 0.03);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.input-wrap input:focus + i {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(0,240,255,0.5);
}

.login-error-msg {
    color: var(--danger);
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 500;
}

/* ==========================================
   Main Portal Layout
   ========================================== */
#main-portal {
    display: none;
    height: 100vh;
    flex-direction: column;
}

#main-portal.show {
    display: flex;
}

/* Header */
.app-header {
    height: 70px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-brand i {
    font-size: 26px;
    color: var(--primary);
    text-shadow: var(--neon-shadow);
}

.header-brand h1 {
    font-size: 20px;
    font-weight: 700;
}

.header-brand .brand-logo-txt {
    display: flex;
    flex-direction: column;
}

.header-brand .brand-support {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.header-nav {
    display: flex;
    gap: 8px;
}

.nav-tab-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.nav-tab-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.nav-tab-link.active {
    color: #040811;
    background: linear-gradient(135deg, var(--primary) 0%, #0099ff 100%);
    font-weight: 600;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.45);
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
}

.header-profile .profile-details {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.user-tag {
    background: rgba(0, 240, 255, 0.08);
    color: var(--primary);
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
}

.user-tag.yunliang {
    background: rgba(181, 23, 158, 0.1);
    color: #ff66e5;
    border: 1px solid rgba(181, 23, 158, 0.25);
}

.logout-icon {
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.logout-icon:hover {
    color: var(--danger);
    transform: scale(1.1);
}

/* Footer */
.app-footer {
    height: 40px;
    background: #03050a;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Body / Container */
.portal-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

.tab-page {
    display: none;
    animation: tabFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* ==========================================
   Executive Dashboard Tab
   ========================================== */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 28px;
}

.kpi-card {
    padding: 26px;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    opacity: 0.3;
}

.kpi-card.purple::after { background: var(--secondary); }
.kpi-card.green::after { background: var(--success-neon); }
.kpi-card.amber::after { background: var(--warning); }

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 18px;
    background: rgba(0, 240, 255, 0.08);
    color: var(--primary);
    border: 1px solid rgba(0, 240, 255, 0.18);
}

.kpi-card.purple .kpi-icon { background: rgba(181, 23, 158, 0.08); color: var(--secondary); border-color: rgba(181, 23, 158, 0.18); }
.kpi-card.green .kpi-icon { background: rgba(0, 245, 212, 0.08); color: var(--success-neon); border-color: rgba(0, 245, 212, 0.18); }
.kpi-card.amber .kpi-icon { background: rgba(255, 183, 3, 0.08); color: var(--warning); border-color: rgba(255, 183, 3, 0.18); }

.kpi-value {
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    font-family: monospace;
}

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

.kpi-trend {
    position: absolute;
    top: 26px;
    right: 26px;
    font-size: 12px;
    font-weight: 600;
}

.kpi-trend.up { color: var(--success-neon); }
.kpi-trend.down { color: var(--danger); }

/* Dashboard Grids */
.dashboard-grid-main {
    display: grid;
    grid-template-columns: 2.1fr 1fr;
    gap: 28px;
    margin-bottom: 28px;
}

.dashboard-grid-sub {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 28px;
    margin-bottom: 28px;
}

/* Panels styling */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
}

.panel-title i {
    color: var(--primary);
    text-shadow: var(--neon-shadow);
}

/* Progress Tracker */
.progress-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.progress-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Live Activity Logs */
.activity-logs {
    height: 280px;
    overflow-y: auto;
    padding-right: 8px;
}

.log-row {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    gap: 14px;
    font-size: 12px;
    align-items: flex-start;
    animation: logSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.log-row:last-child {
    border-bottom: none;
}

@keyframes logSlideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

.log-time {
    color: var(--text-muted);
    font-family: monospace;
    white-space: nowrap;
    background: rgba(255,255,255,0.02);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.04);
}

.log-msg {
    color: var(--text-secondary);
    line-height: 1.5;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

th {
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    color: var(--text-secondary);
    font-weight: 600;
}

td {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

tr:hover td {
    background: rgba(0, 240, 255, 0.02);
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-done { background: rgba(0, 245, 212, 0.1); color: var(--success-neon); border: 1px solid rgba(0, 245, 212, 0.25); }
.badge-work { background: rgba(0, 240, 255, 0.1); color: var(--primary); border: 1px solid rgba(0, 240, 255, 0.25); }
.badge-wait { background: rgba(255, 183, 3, 0.1); color: var(--warning); border: 1px solid rgba(255, 183, 3, 0.25); }

/* ==========================================
   Multi-Dimensional Annotation Studio (3-COLUMN INTERACTIVE SIDEBARS)
   ========================================== */
.studio-layout {
    display: grid;
    grid-template-columns: 250px 1fr 380px;
    gap: 24px;
}

/* LEFT SIDEBAR: Directory Tree Styles */
.studio-tree-panel {
    background: rgba(10, 18, 36, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tree-header {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 12px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-container {
    flex: 1;
    overflow-y: auto;
    font-size: 12.5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tree-folder {
    margin-bottom: 4px;
}

.tree-folder-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.tree-folder-title:hover {
    background: rgba(255,255,255,0.03);
}

.tree-folder-items {
    padding-left: 18px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s;
}

.tree-folder-items.hidden {
    display: none;
}

.tree-file-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.tree-file-title:hover {
    background: rgba(0, 240, 255, 0.04);
    color: #fff;
}

.tree-file-title.active {
    background: rgba(0, 240, 255, 0.08);
    color: var(--primary);
    font-weight: 600;
    border: 1px solid rgba(0, 240, 255, 0.15);
}

/* Canvas Toolbar */
.canvas-toolbar {
    display: flex;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.tool-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    font-size: 13px;
}

.tool-btn:hover {
    background: rgba(255,255,255,0.04);
    color: #fff;
}

.tool-btn.active {
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 0 10px rgba(181, 23, 158, 0.4);
}

/* Workflow Consensus & Avatars Panel */
.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.step-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 10px;
    font-size: 12px;
}

.step-row.done {
    border-color: rgba(0,245,212,0.15);
}

.step-row.active {
    border-color: var(--border-hover);
    background: rgba(0,240,255,0.02);
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
}

.step-row.done .step-num {
    background: rgba(0,245,212,0.1);
    border-color: var(--success-neon);
    color: var(--success-neon);
}

.step-row.active .step-num {
    background: rgba(0,240,255,0.1);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.step-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.expert-avatars-row {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.avatar-tag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5c758c;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.avatar-tag.online {
    border-color: var(--success-neon);
    background: #00f5d4;
    color: #040811;
}

/* ==========================================
   3D Seismic Volume Layout (NEW STYLE)
   ========================================== */
.volume-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 28px;
}

.volume-3d-viewport {
    height: 500px;
    background: #03060c;
    border-radius: 16px;
    border: 1px dashed rgba(0, 240, 255, 0.2);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.9);
}

/* Reservoir Physical evaluation Layout */
.reservoir-grid-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 28px;
}

/* ==========================================
   Visualizer Container
   ========================================== */
.visualizer-container {
    height: 440px;
    background: rgba(3, 5, 10, 0.95);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.visualizer-header {
    height: 46px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.02);
}

.visualizer-canvas-container {
    height: calc(100% - 46px);
    width: 100%;
    position: relative;
    cursor: crosshair;
}

.visualizer-grid-lines {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(0, 240, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.interactive-anno-box {
    position: absolute;
    border: 2px dashed var(--primary);
    background: rgba(0, 240, 255, 0.08);
    border-radius: 4px;
    cursor: move;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.interactive-anno-box .box-label {
    position: absolute;
    top: -24px;
    left: -2px;
    background: var(--primary);
    color: #040811;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.tag-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.tag-button {
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-button:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.tag-button.active {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.15), 0 0 12px rgba(0, 240, 255, 0.15);
}

/* Wave adjuster section */
.wave-adjuster-panel {
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
}

.wave-slider-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.wave-slider-row:last-child {
    margin-bottom: 0;
}

.wave-slider-row label {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.wave-slider-row input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.1);
    outline: none;
}

.wave-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    cursor: pointer;
}

/* ==========================================
   Borehole Strata Component
   ========================================== */
.strata-visualizer-card {
    background: rgba(2, 5, 10, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 20px;
    height: 100%;
}

.strata-column-container {
    display: flex;
    gap: 16px;
    margin-top: 14px;
    height: 280px;
    position: relative;
}

.strata-column {
    width: 60px;
    height: 100%;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.strata-layer {
    width: 100%;
    transition: flex 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 1px 2px #000;
    position: relative;
    border-bottom: 1px dashed rgba(255,255,255,0.15);
}

.strata-layer:last-child {
    border-bottom: none;
}

.strata-depth-marker {
    position: absolute;
    left: -4px;
    width: 68px;
    height: 2px;
    background: #ff0054;
    box-shadow: 0 0 8px #ff0054;
    z-index: 10;
    transition: top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.strata-depth-marker::after {
    content: '';
    position: absolute;
    right: -6px; top: -4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #ff0054;
    box-shadow: 0 0 10px #ff0054;
}

.strata-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-right: 4px;
}

.strata-detail-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    transition: all 0.3s;
}

.strata-detail-item.active {
    background: rgba(0, 240, 255, 0.04);
    border-color: rgba(0, 240, 255, 0.25);
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.05);
}

.strata-detail-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 4px;
}

/* Rock Textures (Simulated in CSS) */
.layer-sandstone {
    background: repeating-linear-gradient(45deg, #e9c46a, #e9c46a 5px, #f4a261 5px, #f4a261 10px);
}
.layer-shale {
    background: repeating-linear-gradient(0deg, #2a9d8f, #2a9d8f 4px, #264653 4px, #264653 8px);
}
.layer-carbonate {
    background: radial-gradient(circle, #e76f51 20%, transparent 20%), #f4a261;
    background-size: 8px 8px;
}
.layer-coal {
    background: #111;
}

/* ==========================================
   Quality Assurance Center
   ========================================== */
.qa-split-viewer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.qa-card-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 14px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-weight: 600;
    font-size: 14px;
}

.qa-card-body {
    padding: 22px;
}

/* ==========================================
   Model Asset Hub
   ========================================== */
.model-orchestrator-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
}

.hardware-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    margin-bottom: 14px;
    transition: border-color 0.3s;
}

.hardware-card:hover {
    border-color: rgba(0, 240, 255, 0.2);
}

.hardware-icon {
    font-size: 26px;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

.hardware-details {
    flex: 1;
}

.hardware-metrics {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ==========================================
   Dialog / Modal System
   ========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(2, 4, 8, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal-content-wrap {
    width: 800px;
    background: #080f1d;
    border: 1px solid var(--border-hover);
    box-shadow: 0 35px 80px rgba(0,0,0,0.85), 0 0 40px rgba(0, 240, 255, 0.15);
    border-radius: 24px;
    overflow: hidden;
    animation: modalShow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalShow {
    from { opacity: 0; transform: scale(0.92) translateY(24px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title-bar {
    padding: 22px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: var(--danger);
}

.modal-body-content {
    padding: 28px;
    max-height: 520px;
    overflow-y: auto;
}

.modal-footer-bar {
    padding: 18px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    background: rgba(0,0,0,0.15);
}

/* SEG-Y Hex Inspector layout styles */
.segy-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.segy-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.segy-hex-view {
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.5;
    background: #03060c;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 14px;
    color: var(--success-neon);
    height: 240px;
    overflow-y: auto;
}

.segy-meta-view {
    font-size: 12px;
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 14px;
    color: var(--text-secondary);
    height: 240px;
    overflow-y: auto;
}

.segy-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.04);
}

.segy-meta-row:last-child {
    border-bottom: none;
}

.segy-meta-row strong {
    color: #fff;
}

/* Neural Network Layers Grid & Cards */
.network-layers-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
}
.layer-node-card {
    flex: 1;
    min-width: 130px;
    background: rgba(8, 15, 29, 0.6);
    border: 1px solid rgba(0, 240, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}
.layer-node-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
    transform: translateY(-2px);
}
.node-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}
.node-details {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-family: monospace;
}
.layer-node-arrow {
    color: var(--primary);
    opacity: 0.5;
    font-size: 14px;
    animation: pulseArrow 2s infinite ease-in-out;
}
@keyframes pulseArrow {
    0%, 100% { transform: scale(1) translateX(0); opacity: 0.4; }
    50% { transform: scale(1.1) translateX(4px); opacity: 0.9; }
}

/* Feature Map Channel Scanner */
.feature-map-container {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    margin-top: 12px;
}
.feature-channel-box {
    aspect-ratio: 1;
    background: #02050a;
    border: 1px solid rgba(0, 240, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}
.feature-channel-box canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.45;
}
.feature-channel-box:hover canvas {
    opacity: 0.85;
}
.feature-channel-label {
    position: relative;
    z-index: 10;
    font-size: 8px;
    color: var(--text-muted);
    font-family: monospace;
    background: rgba(2, 5, 10, 0.85);
    padding: 1px 3px;
    border-radius: 3px;
    align-self: flex-start;
}
.feature-channel-val {
    position: relative;
    z-index: 10;
    font-size: 8px;
    color: var(--success-neon);
    font-family: monospace;
    background: rgba(2, 5, 10, 0.85);
    padding: 1px 3px;
    border-radius: 3px;
    align-self: flex-end;
}

/* Model Registry Grid & Cards */
.model-registry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.model-registry-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.model-registry-card:hover {
    border-color: rgba(0, 240, 255, 0.15);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
}
.model-reg-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(0, 240, 255, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.08) inset;
}
.model-reg-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 14px 0 8px 0;
}
.model-reg-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 14px;
    height: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.model-reg-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
    padding-top: 12px;
    margin-bottom: 16px;
}
.model-reg-meta-grid i {
    width: 14px;
    margin-right: 4px;
}
.model-reg-actions {
    display: flex;
    gap: 10px;
}
.model-reg-actions button {
    flex: 1;
    font-size: 11px;
    padding: 8px 0;
    justify-content: center;
}

/* ==========================================
   Responsive Rules
   ========================================== */
@media (max-width: 1400px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .model-registry-grid { grid-template-columns: 1fr; }
    .feature-map-container { grid-template-columns: repeat(4, 1fr); }
    .dashboard-grid-main, .dashboard-grid-sub, .studio-layout, .model-orchestrator-layout, .qa-split-viewer, .volume-layout, .reservoir-grid-layout {
        grid-template-columns: 1fr;
    }
}
