/* SimoScan - CSS Stylesheet */
/* Design Tokens & Root Variables */
:root {
    --bg-darkest: #07090e;
    --bg-dark: #0f131a;
    --bg-card: rgba(23, 29, 39, 0.6);
    --bg-card-hover: rgba(33, 41, 54, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(6, 182, 212, 0.15);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.4);
    --blue: #3b82f6;
    --blue-glow: rgba(59, 130, 246, 0.4);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.4);
    --gold: #fbbf24;
    --gold-glow: rgba(251, 191, 36, 0.4);
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.4);
    
    --glass-blur: blur(12px);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global Settings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

body {
    background-color: var(--bg-darkest);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 40%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Dashboard Container (Grid: Left Panel, Center Phone, Right Panel) */
.dashboard-container {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    height: 100vh;
    padding: 16px;
    gap: 16px;
}

/* Aside & Panel Structures */
aside, .data-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Brand Logo */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.brand h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.brand h2 span {
    font-size: 12px;
    font-weight: 400;
    color: var(--cyan);
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-glow);
    margin-left: 4px;
}
.glow-icon {
    font-size: 24px;
    color: var(--cyan);
    filter: drop-shadow(0 0 8px var(--cyan-glow));
    animation: iconPulse 2s infinite ease-in-out;
}

@keyframes iconPulse {
    0%, 100% { filter: drop-shadow(0 0 4px var(--cyan-glow)); }
    50% { filter: drop-shadow(0 0 12px var(--cyan-glow)); }
}

/* Sections */
.control-section, .panel-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.control-section h3, .panel-section h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}
.control-section h3 i, .panel-section h3 i {
    color: var(--cyan);
}
.section-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group select, .form-group input[type="text"] {
    background: rgba(10, 14, 22, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: var(--transition-smooth);
}
.form-group select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 10px var(--border-glow);
}

/* Range Input styling */
.range-group label {
    display: flex;
    justify-content: space-between;
}
.range-group label span {
    color: var(--gold);
    font-weight: bold;
}
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cyan);
    cursor: pointer;
    box-shadow: 0 0 8px var(--cyan-glow);
    transition: var(--transition-smooth);
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Anomaly Selector buttons */
.anomaly-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.btn-anomaly {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    transition: var(--transition-smooth);
}
.btn-anomaly:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}
.btn-anomaly.active {
    background: rgba(6, 182, 212, 0.08);
    border-color: var(--cyan);
    color: var(--text-primary);
    box-shadow: inset 0 0 8px rgba(6, 182, 212, 0.1);
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dot.blue { background-color: var(--blue); box-shadow: 0 0 8px var(--blue-glow); }
.dot.red { background-color: var(--red); box-shadow: 0 0 8px var(--red-glow); }
.dot.gold { background-color: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }

/* Buttons */
.btn {
    background: var(--cyan);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--cyan-glow);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

/* Status Alert Card */
.status-card {
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: 12px;
    padding: 14px;
    margin-top: auto;
}
.status-card h4 {
    font-size: 13px;
    color: var(--gold);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.status-card p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* PHONE WRAPPER & SMARTPHONE CONTAINER */
.phone-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.smartphone {
    width: 380px;
    height: 780px;
    background: #000;
    border: 10px solid #1e293b;
    border-radius: 45px;
    position: relative;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(6, 182, 212, 0.15);
    overflow: hidden;
}

.smartphone::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 25px;
    background: #1e293b;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 999;
}

/* Phone Internal Screen */
.phone-screen {
    width: 100%;
    height: 100%;
    background: #0a0d14;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Phone Status Bar */
.status-bar {
    height: 40px;
    background: #080a0f;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    z-index: 99;
}
.status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}
.status-icons i {
    font-size: 12px;
}
.status-icons span {
    display: flex;
    align-items: center;
}
.text-muted {
    color: var(--text-muted) !important;
}

/* App Header */
.app-header {
    background: #0d111b;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.app-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    font-size: 16px;
}
.app-header h1 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.app-header .subtitle {
    font-size: 10px;
    color: var(--text-secondary);
}
.btn-icon {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--cyan);
}

/* App Content Area */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 75px; /* space for nav */
}

/* Connection status banner */
.connection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition-smooth);
}
.connection-bar.disconnected {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}
.connection-bar.connected {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}
.btn-connect-pill {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-connect-pill:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Tabs */
.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border-color);
}
.tab-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-smooth);
}
.tab-btn.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--cyan);
}

/* Tab panes */
.tab-pane {
    display: none;
    flex-direction: column;
    gap: 14px;
}
.tab-pane.active {
    display: flex;
}

/* Grid Card */
.grid-card {
    background: rgba(13, 17, 27, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}
.coordinate-label {
    color: var(--text-secondary);
}
.coordinate-label strong {
    color: var(--cyan);
}
.direction-indicator {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Scan Grid Area */
.scan-grid-container {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.8s ease;
}

.scan-grid-container.is-3d {
    transform: perspective(1000px) rotateX(55deg) rotateZ(-40deg);
    transform-style: preserve-3d;
    box-shadow: -30px 40px 50px rgba(0, 0, 0, 0.9);
    border: none;
    background: transparent;
    overflow: visible;
}
.scan-grid-container.is-3d .scan-grid {
    transform-style: preserve-3d;
}
.scan-grid-container.is-3d .grid-cell {
    transform-style: preserve-3d;
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: transform 0.6s ease, background-color 0.4s ease;
}
.scan-grid-container.is-3d .radar-sweep {
    display: none;
}

.scan-grid {
    display: grid;
    width: 100%;
    height: 100%;
    padding: 6px;
    gap: 2px;
}

/* Grid Cells */
.grid-cell {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 2px;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
    position: relative;
}
.grid-cell.scanned {
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.grid-cell.active-cell {
    background: var(--cyan) !important;
    box-shadow: 0 0 10px var(--cyan);
    z-index: 10;
}

/* Radar Sweep effect overlay */
.radar-sweep {
    position: absolute;
    width: 100%;
    height: 4px;
    background: linear-gradient(to bottom, transparent, var(--cyan-glow), transparent);
    top: -10px;
    left: 0;
    pointer-events: none;
    opacity: 0;
}
.radar-sweep.active {
    animation: sweep 2.5s infinite linear;
    opacity: 1;
}

@keyframes sweep {
    0% { top: 0%; }
    100% { top: 100%; }
}

/* Grid scale bar */
.color-scale {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    color: var(--text-muted);
    padding: 0 4px;
}
.scale-bar {
    flex: 1;
    height: 6px;
    background: linear-gradient(to right, var(--red), var(--blue), var(--green), var(--gold));
    border-radius: 3px;
    margin: 0 8px;
}

/* Oscilloscope */
.oscilloscope-card {
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 2px;
    box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.1);
}
.osc-header {
    font-size: 9px;
    color: var(--cyan);
    text-transform: uppercase;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
}
#oscCanvas {
    width: 100%;
    background: rgba(6, 182, 212, 0.05);
    border-radius: 4px;
}

/* Stats box row */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.stat-box {
    background: rgba(13, 17, 27, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.stat-value {
    font-size: 18px;
    font-weight: 700;
    margin: 4px 0;
    color: var(--text-primary);
}
.text-gold {
    color: var(--gold) !important;
}
.stat-desc {
    font-size: 9px;
    color: var(--text-muted);
}

/* Action buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 90px;
    gap: 10px;
    margin-top: auto;
}
.btn-action {
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}
.btn-action.start {
    background: var(--cyan);
    color: #000;
}
.btn-action.start:disabled {
    background: rgba(6, 182, 212, 0.2);
    color: rgba(0, 0, 0, 0.4);
    cursor: not-allowed;
}
.btn-action.reset {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-action.reset:disabled {
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.02);
    cursor: not-allowed;
}

/* TAB 2: Analysis page styling */
.analysis-card {
    background: rgba(13, 17, 27, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.analysis-card h3 {
    font-size: 14px;
}

/* Graph area */
.chart-container {
    height: 180px;
    display: flex;
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    padding: 10px;
    position: relative;
}
.chart-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
    margin-right: 6px;
}
.chart-area {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 100%;
}
.chart-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}
.chart-bar {
    flex: 1;
    background-color: var(--cyan);
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    transition: height 0.5s ease;
    position: relative;
}
.chart-bar.anomaly-water { background-color: var(--blue); }
.chart-bar.anomaly-cavity { background-color: var(--red); }
.chart-bar.anomaly-metal { background-color: var(--gold); }
.chart-bar.soil-normal { background-color: rgba(255,255,255,0.06); }

.depth-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
}

/* AI Report card */
.report-card {
    background: rgba(6, 182, 212, 0.03);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 14px;
}
.report-card h4 {
    font-size: 12px;
    color: var(--cyan);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.report-card p {
    font-size: 11px;
    line-height: 1.4;
}
.anomaly-item-report {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.anomaly-item-report span {
    font-size: 11px;
    font-weight: 600;
}

/* Phone Nav Bar */
.app-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: #0d111b;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 99;
}
.nav-item {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}
.nav-item i {
    font-size: 18px;
}
.nav-item span {
    font-size: 9px;
    font-weight: 600;
}
.nav-item.active {
    color: var(--cyan);
}

/* RIGHT PANEL: TELEMETRY & HISTORY */
.telemetry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.tel-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tel-item .label {
    font-size: 10px;
    color: var(--text-muted);
}
.tel-item .value {
    font-size: 14px;
    font-weight: 600;
}
.text-success { color: var(--green) !important; }
.text-warning { color: var(--gold) !important; }

/* Scan history list */
.scan-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}
.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
    cursor: pointer;
}
.history-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--cyan);
}
.history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.history-info .name {
    font-size: 12px;
    font-weight: 600;
}
.history-info .date {
    font-size: 10px;
    color: var(--text-muted);
}
.history-icon-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.1);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}
.empty-history {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

/* Terminal Console styling */
.terminal-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.terminal {
    flex: 1;
    background: #05070a;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    font-family: 'Space Grotesk', monospace;
    font-size: 11px;
    color: #34d399;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
}
.term-line {
    line-height: 1.4;
    word-break: break-all;
}
.term-line.system { color: #60a5fa; }
.term-line.info { color: #94a3b8; }
.term-line.error { color: #f87171; }

/* MODALS */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}
.modal.active {
    opacity: 1;
    pointer-events: all;
}
.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: translateY(20px);
    transition: var(--transition-smooth);
}
.modal.active .modal-content {
    transform: translateY(0);
}
.modal-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-header h3 i {
    color: var(--cyan);
}
.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}
.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.modal-body p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Device list in BLE modal */
.device-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.device-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.device-item:hover {
    background: rgba(6, 182, 212, 0.08);
    border-color: var(--cyan);
}
.device-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.device-info .name {
    font-size: 13px;
    font-weight: 600;
}
.device-info .mac {
    font-size: 10px;
    color: var(--text-muted);
}
.device-item .rssi {
    font-size: 12px;
    color: var(--text-secondary);
}

.scanning-loader {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

/* Responsive adjustment */
@media (max-width: 1100px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        height: auto;
        overflow-y: auto;
    }
    aside, .data-panel {
        height: auto;
        max-height: none;
    }
    .smartphone {
        margin: 20px auto;
    }
}
