/* 
  =========================================
  ZAN MONITOR SYSTEM - STYLESHEET
  Premium Glassmorphism & Sleek Dark Mode
  =========================================
*/

/* Variabel Desain Token */
:root {
  --font-family: 'Inter', -apple-system, sans-serif;
  --font-display: 'Orbitron', sans-serif;
  
  /* HSL Color Palette */
  --bg-color: #030712; /* Very deep dark */
  --bg-card: rgba(17, 24, 39, 0.65); /* Sleek glass fill */
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-glass-hover: rgba(255, 255, 255, 0.15);
  
  --primary-color: #06b6d4; /* Cyan */
  --primary-glow: rgba(6, 182, 212, 0.4);
  --secondary-color: #a855f7; /* Purple */
  --secondary-glow: rgba(168, 85, 247, 0.4);
  
  --text-primary: #f3f4f6; /* Off-white */
  --text-secondary: #9ca3af; /* Muted gray */
  --text-dark: #6b7280;
  
  --success-color: #10b981; /* Emerald green */
  --warning-color: #f59e0b; /* Amber */
  --danger-color: #ef4444; /* Rose red */
}

/* Base Reset & Layout */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Background Glowing Elements */
.bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.15;
}

.bg-glow-1 {
  background: var(--primary-color);
  top: -100px;
  left: -100px;
  animation: floatOrb 20s infinite ease-in-out alternate;
}

.bg-glow-2 {
  background: var(--secondary-color);
  bottom: -100px;
  right: -100px;
  animation: floatOrb 25s infinite ease-in-out alternate-reverse;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 30px) scale(1.1); }
  100% { transform: translate(-30px, -50px) scale(0.9); }
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 24px;
  color: var(--primary-color);
  text-shadow: 0 0 15px var(--primary-glow);
  animation: pulseLogo 3s infinite ease-in-out;
}

@keyframes pulseLogo {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.header-logo h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.header-logo h1 span {
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-glow);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 24px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
}

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

@keyframes pulseLed {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

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

.device-count {
  font-size: 13px;
  color: var(--text-primary);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
}

.device-count i {
  color: var(--primary-color);
  margin-right: 6px;
}

/* App Body Layout */
.app-body {
  display: flex;
  flex: 1;
  gap: 16px;
  height: calc(100vh - 120px);
}

/* Sidebar: Device List */
.sidebar {
  width: 320px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.sidebar-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 20px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-title i {
  color: var(--primary-color);
}

.device-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 150px;
  gap: 12px;
  color: var(--text-dark);
  font-size: 13px;
  text-align: center;
}

.empty-sidebar i {
  font-size: 20px;
}

/* Device Item Card */
.device-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.device-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.15);
}

.device-card.active {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

.device-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.device-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.device-status-dot.online {
  background: var(--success-color);
  box-shadow: 0 0 6px var(--success-color);
}

.device-status-dot.offline {
  background: var(--text-dark);
}

.device-card-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.device-card-info span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.device-card-info i {
  color: var(--text-dark);
  width: 14px;
}

.device-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 8px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Welcome Screen */
.welcome-screen {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.welcome-card {
  max-width: 600px;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.welcome-icon {
  font-size: 64px;
  color: var(--primary-color);
  text-shadow: 0 0 30px var(--primary-glow);
  margin-bottom: 24px;
  animation: bounceSlow 3s infinite ease-in-out;
}

@keyframes bounceSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.welcome-card h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
}

.welcome-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.instruction-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 24px;
  text-align: left;
  border-left: 4px solid var(--primary-color);
}

.instruction-box h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.instruction-box ol {
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.instruction-box li strong {
  color: var(--text-primary);
}

.ip-clipboard {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-glass);
}

.ip-clipboard code {
  font-family: monospace;
  font-size: 14px;
  color: var(--secondary-color);
  font-weight: 600;
  flex: 1;
}

.btn-copy {
  background: var(--primary-color);
  border: none;
  color: #000;
  font-weight: 600;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-copy:hover {
  opacity: 0.9;
}

/* Detail Monitor & Profile Card */
.monitor-detail {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.device-profile-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.1);
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 50px;
  height: 50px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--primary-color);
}

.profile-text h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.badge {
  background: var(--success-color);
  color: #000;
  font-weight: 700;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge.offline {
  background: var(--text-dark);
  color: var(--text-primary);
}

.profile-stats {
  display: flex;
  gap: 24px;
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
}

.stat-icon {
  font-size: 20px;
}

.battery-box .stat-icon {
  color: var(--success-color);
}

.stat-value h3 {
  font-size: 15px;
  font-weight: 700;
}

.stat-value p {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Progress Ring CSS */
.progress-ring-container {
  display: flex;
  align-items: center;
}

.progress-ring-bar {
  transition: stroke-dashoffset 0.35s;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* Navigation Tabs */
.dashboard-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 12px;
  gap: 8px;
  border-bottom: 1px solid var(--border-glass);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #000;
  background: var(--primary-color);
}

/* Tab Panes */
.tab-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tab-pane.hidden {
  display: none !important;
}

/* Explorer Navigation */
.explorer-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid var(--border-glass);
}

.btn-action {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-glass-hover);
}

.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.breadcrumb-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  font-family: monospace;
  font-size: 13px;
  overflow-x: auto;
  white-space: nowrap;
}

.breadcrumb-item {
  color: var(--text-secondary);
}

.breadcrumb-item.active {
  color: var(--primary-color);
  font-weight: 600;
}

.breadcrumb-separator {
  color: var(--text-dark);
}

/* Explorer Grid List */
.explorer-grid-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.explorer-list-header {
  display: grid;
  grid-template-columns: 3fr 1fr 1.5fr 1fr;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-glass);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.01);
}

.explorer-items-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Explorer Item Row */
.explorer-row {
  display: grid;
  grid-template-columns: 3fr 1fr 1.5fr 1fr;
  padding: 12px 24px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: background 0.2s;
}

.explorer-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.cell-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-name i {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

.cell-name i.fa-folder {
  color: #fbbf24; /* Folder amber */
}

.cell-name i.fa-file-image {
  color: #38bdf8; /* Image light blue */
}

.cell-name i.fa-file-video {
  color: #f43f5e; /* Video rose */
}

.cell-name i.fa-file-pdf {
  color: #ef4444; /* PDF red */
}

.cell-name i.fa-file-archive {
  color: #a855f7; /* Archive purple */
}

.cell-name i.fa-file-lines {
  color: #34d399; /* Text document */
}

.cell-size, .cell-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.cell-actions {
  display: flex;
  gap: 8px;
}

.btn-row-action {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-row-action:hover {
  background: var(--primary-color);
  color: #000;
  border-color: var(--primary-color);
}

/* Loading state */
.loading-explorer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 60px;
  gap: 16px;
  color: var(--text-secondary);
}

.loading-explorer i {
  font-size: 32px;
  color: var(--primary-color);
}

/* Gallery Section */
.gallery-toolbar {
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid var(--border-glass);
}

.gallery-toolbar h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.gallery-toolbar p {
  font-size: 12px;
  color: var(--text-secondary);
}

.gallery-grid {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.empty-gallery {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 250px;
  gap: 16px;
  color: var(--text-dark);
  text-align: center;
  padding: 40px;
}

.empty-gallery i {
  font-size: 40px;
}

.empty-gallery p {
  max-width: 400px;
  font-size: 13px;
  line-height: 1.5;
}

/* Gallery Item Card */
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.03);
  border-color: var(--primary-color);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.2);
}

.gallery-item img, .gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-name {
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.gallery-item-icon {
  color: var(--primary-color);
  font-size: 14px;
  margin-left: 8px;
}

/* Modal Popup Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none !important;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
}

.modal-content {
  position: relative;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--border-glass-hover);
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-glass);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
}

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

.modal-body {
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 60vh;
  overflow-y: auto;
  background: #030712;
}

.modal-body img {
  max-width: 100%;
  max-height: 50vh;
  object-fit: contain;
  border-radius: 8px;
}

.modal-body video {
  max-width: 100%;
  max-height: 50vh;
  outline: none;
  border-radius: 8px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
}

.btn-download {
  background: var(--primary-color);
  color: #000;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: all 0.2s;
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

/* Animasi Fade-In Umum */
.animate-fade-in {
  animation: fadeIn 0.4s ease;
}

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

/* Utils Utility */
.hidden {
  display: none !important;
}

/* Monitoring Features Styles */
.camera-control, .location-control {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.control-header h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.control-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.camera-actions, .location-actions {
  display: flex;
  gap: 16px;
}

.btn-primary {
  background: var(--primary-color);
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.camera-log {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 20px;
  min-height: 100px;
  font-family: monospace;
}

.location-info-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 24px;
}

.empty-text, .empty-location {
  text-align: center;
  color: var(--text-dark);
  font-size: 14px;
}

.location-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-map {
  margin-top: 16px;
  background: #4285F4; /* Google Blue */
  color: white;
  text-decoration: none;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loading-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--primary-color);
}

/* =========================================
   RESPONSIVE LAYOUT (MOBILE & TABLET)
   ========================================= */
@media (max-width: 768px) {
  body {
    overflow: auto; /* Enable native browser scrolling on mobile */
    overflow-x: hidden;
  }

  .app-container {
    padding: 8px; /* Reduce padding to save space */
    height: auto;
    min-height: 100vh;
  }

  .app-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    border-radius: 12px;
  }

  .header-status {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }

  .app-body {
    flex-direction: column;
    height: auto;
    overflow: visible; /* Let it expand */
    gap: 12px;
  }

  .sidebar {
    width: 100%;
    height: auto;
    min-height: unset;
    flex: none;
    border-radius: 12px;
  }

  .device-list {
    max-height: 250px;
    overflow-y: auto;
  }

  .main-content {
    height: auto;
    min-height: 600px;
    flex: none;
    border-radius: 12px;
    overflow: visible;
  }

  .device-profile-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
  }

  .profile-stats {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Make tabs swipeable horizontally */
  .dashboard-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    gap: 8px;
    scrollbar-width: none; /* Firefox */
  }
  
  .dashboard-tabs::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
  }

  .tab-btn {
    flex: 0 0 auto; /* Prevent shrinking */
    white-space: nowrap;
    padding: 8px 14px;
  }

  .camera-actions, .location-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-primary, .btn-secondary, .btn-danger {
    width: 100%;
    justify-content: center;
  }

  /* Hide table header on mobile */
  .explorer-list-header {
    display: none;
  }

  /* Redesign File Explorer Row for Mobile */
  .explorer-items-list {
    overflow: visible; /* Let page scroll handle it */
  }

  .explorer-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 6px;
    padding: 12px 16px;
    position: relative;
  }

  .cell-name {
    font-size: 14px;
    grid-column: 1 / -1;
    padding-right: 50px; /* Space for actions */
    white-space: normal; /* Allow text to wrap if very long */
    word-break: break-all;
  }

  .cell-size, .cell-date {
    font-size: 12px;
    color: var(--text-dark);
  }

  .cell-actions {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    padding: 4px;
    border-radius: 8px;
    box-shadow: -10px 0 15px var(--bg-card); /* Fade effect */
  }

  /* Fix Modal Sizing on Mobile */
  .modal-content {
    width: 95%;
    max-height: 90vh; /* Prevent modal from exceeding screen */
    margin: auto;
    border-radius: 12px;
  }

  .modal-body {
    padding: 16px;
    max-height: calc(90vh - 130px); /* Leave space for header & footer */
  }

  .modal-body img, .modal-body video {
    max-height: 100%;
    width: 100%;
    object-fit: contain;
  }
}

