/* ==========================================================================
   BulutDrive - Microsoft OneDrive Fluent Design System & Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Light Theme (Default) */
  --bg-primary: #f3f3f3;
  --bg-surface: #ffffff;
  --bg-subtle: #f9f9fb;
  --bg-hover: #f0f2f5;
  --bg-active: #e5e8ec;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --text-primary: #1b1a19;
  --text-secondary: #5f5e5c;
  --text-muted: #8a8886;
  --text-inverse: #ffffff;

  --accent: #0078d4;
  --accent-hover: #106ebe;
  --accent-active: #005a9e;
  --accent-light: #e6f2fb;
  --accent-glow: rgba(0, 120, 212, 0.25);

  --danger: #d13438;
  --danger-light: #fde7e9;
  --warning: #ffaa44;
  --warning-light: #fff4ce;
  --success: #107c10;
  --success-light: #dff6dd;

  --border: #e1dfdd;
  --border-subtle: #edebe9;
  --border-strong: #8a8886;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.14);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.2);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --font-main: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --header-height: 54px;
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 64px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='dark'] {
  --bg-primary: #121212;
  --bg-surface: #1e1e1e;
  --bg-subtle: #252525;
  --bg-hover: #2d2d2d;
  --bg-active: #383838;
  --bg-glass: rgba(30, 30, 30, 0.85);

  --text-primary: #f3f2f1;
  --text-secondary: #adadad;
  --text-muted: #797775;
  --text-inverse: #1b1a19;

  --accent: #2b88d8;
  --accent-hover: #4ba0ea;
  --accent-active: #1975c5;
  --accent-light: #162d42;
  --accent-glow: rgba(43, 136, 216, 0.3);

  --border: #333333;
  --border-subtle: #292929;
  --border-strong: #4f4f4f;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ==========================================================================
   Layout Architecture & Header
   ========================================================================== */

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* Top App Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  user-select: none;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 230px;
  flex-shrink: 0;
}

.mobile-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.app-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0078d4, #00b4d8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  /* box-shadow removed */
}

.app-logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.header-search {
  flex: 1;
  max-width: 580px;
  margin: 0 20px;
}

.search-box {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 38px;
  background: var(--bg-primary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-full);
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  transition: var(--transition);
}

.search-box input:focus {
  background: var(--bg-surface);
  border-color: var(--accent);
  /* box-shadow removed */
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-menu-wrapper {
  position: relative;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
}

.user-profile-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0078d4, #00b4d8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.user-name {
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   App Body & Sidebar
   ========================================================================== */

.app-body {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
  position: relative;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  flex-shrink: 0;
  overflow-y: auto;
  user-select: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.sidebar-nav .nav-item i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  color: var(--accent);
  transition: transform 0.15s ease;
}

.sidebar-nav .nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-nav .nav-item:hover i {
  transform: scale(1.1);
}

.sidebar-nav .nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}

.sidebar-storage {
  padding: 14px;
  background: var(--bg-subtle);
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-top: 14px;
}

.storage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.progress-bar-container {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.storage-details {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* ==========================================================================
   Main Content Area (Drive Explorer)
   ========================================================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
  position: relative;
}

/* Command Bar (Action Bar) */
.command-bar {
  height: 48px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.command-bar-left, .command-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.cmd-btn:hover {
  background: var(--bg-hover);
}

.cmd-btn.primary {
  background: var(--accent);
  color: white;
}

.cmd-btn.primary:hover {
  background: var(--accent-hover);
}

.cmd-btn.danger {
  color: var(--danger);
}

.cmd-btn.danger:hover {
  background: var(--danger-light);
}

.cmd-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  /* box-shadow removed */
  min-width: 180px;
  padding: 4px;
  z-index: 100;
  display: none;
  /* backdrop-filter removed for mobile perf */
}

.dropdown-menu.show {
  display: block;
  animation: dropdownFade 0.15s ease-out;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item i {
  font-size: 15px;
  width: 18px;
  color: var(--accent);
}

.dropdown-item.danger-item i {
  color: var(--danger);
}

.dropdown-item.danger-item:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* Breadcrumbs Bar */
.breadcrumbs-bar {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  user-select: none;
}

.crumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.crumb-item:hover {
  background: var(--bg-active);
  color: var(--text-primary);
}

.crumb-item.current {
  color: var(--text-primary);
  font-weight: 600;
  cursor: default;
}

.crumb-separator {
  color: var(--text-muted);
  font-size: 12px;
}

/* Explorer Canvas / View Area */
.explorer-container {
  flex: 1;
  padding: 0 20px 20px 20px;
  overflow-y: auto;
  position: relative;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60%;
  color: var(--text-muted);
  text-align: center;
  user-select: none;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  color: var(--border-strong);
  opacity: 0.7;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 13px;
  max-width: 320px;
  margin-bottom: 16px;
}

/* Drag & Drop Window Overlay */
.drop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 120, 212, 0.08);
  /* backdrop-filter removed for mobile perf */
  border: 3px dashed var(--accent);
  border-radius: var(--radius-lg);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 200;
  pointer-events: none;
}

.drop-overlay.active {
  display: flex;
}

.drop-overlay-icon {
  font-size: 56px;
  color: var(--accent);
  animation: bounce 1s infinite alternate ease-in-out;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.drop-overlay-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 12px;
}

/* ==========================================================================
   Grid & List File View Layouts
   ========================================================================== */

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 12px 0 8px 0;
}

/* GRID VIEW */
.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  -webkit-overflow-scrolling: touch;
}

.file-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.file-card:hover {
  border-color: var(--accent);
  /* box-shadow removed */
  transform: translateY(-2px);
}

.file-card.selected {
  background: var(--accent-light);
  border-color: var(--accent);
  /* box-shadow removed */
}

.file-preview-box {
  height: 110px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
}

.file-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-icon-large {
  font-size: 48px;
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-actions-hover {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  gap: 4px;
}

.file-card:hover .file-actions-hover,
.file-card.selected .file-actions-hover {
  display: flex;
}

.action-chip {
  width: 26px;
  height: 26px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  /* box-shadow removed */
  transition: var(--transition);
}

.action-chip:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.action-chip.fav.active {
  color: #ffaa00;
}

/* LIST VIEW */
.list-view {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.list-header {
  display: grid;
  grid-template-columns: 36px 1fr 140px 140px 80px;
  padding: 10px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  user-select: none;
}

.list-row {
  display: grid;
  grid-template-columns: 36px 1fr 140px 140px 80px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.list-row:last-child {
  border-bottom: none;
}

.list-row:hover {
  background: var(--bg-hover);
}

.list-row.selected {
  background: var(--accent-light);
}

.list-col-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-col-icon {
  font-size: 20px;
}

.list-col-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* File Type Colors */
.icon-folder { color: #f8d775; }
.icon-image { color: #00a4ef; }
.icon-video { color: #e81123; }
.icon-audio { color: #8e44ad; }
.icon-pdf { color: #ea4335; }
.icon-doc { color: #0078d4; }
.icon-sheet { color: #107c10; }
.icon-code { color: #008080; }
.icon-zip { color: #f39c12; }
.icon-default { color: #7f8c8d; }

/* ==========================================================================
   Context Menu (Right Click)
   ========================================================================== */

.context-menu {
  position: fixed;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  /* box-shadow removed */
  padding: 6px;
  min-width: 200px;
  z-index: 1000;
  display: none;
  /* backdrop-filter removed for mobile perf */
}

.context-menu.show {
  display: block;
}

/* ==========================================================================
   Modals (Share, Preview, Create Folder, Rename)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  /* backdrop-filter removed for mobile perf */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  /* box-shadow removed */
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.show .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 14px 20px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input, .form-select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  /* box-shadow removed */
}

/* Preview Modal Specifics */
.preview-modal-card {
  max-width: 90vw;
  width: 1080px;
  height: 85vh;
  display: flex;
  flex-direction: column;
}

.preview-modal-body {
  flex: 1;
  background: #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.preview-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-code-box {
  width: 100%;
  height: 100%;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 16px;
  overflow: auto;
  white-space: pre;
}

/* ==========================================================================
   BulutDrive Pro Video Player UI
   ========================================================================== */
.pro-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
}

.pro-video-element {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  outline: none;
}

.pro-video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.3) 70%, transparent);
  padding: 16px 20px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 50;
}

.pro-video-container:hover .pro-video-controls,
.pro-video-container.controls-visible .pro-video-controls {
  opacity: 1;
}

/* Seek Bar */
.pro-seek-bar-wrapper {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  transition: height 0.15s ease;
}

.pro-seek-bar-wrapper:hover {
  height: 10px;
}

.pro-seek-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  width: 0%;
  pointer-events: none;
}

.pro-seek-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  width: 0%;
  pointer-events: none;
}

.pro-seek-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  /* box-shadow removed */
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease;
  pointer-events: none;
}

.pro-seek-bar-wrapper:hover .pro-seek-handle {
  transform: translate(-50%, -50%) scale(1);
}

/* Control Buttons Row */
.pro-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}

.pro-controls-left, .pro-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pro-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.pro-btn:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.pro-time-display {
  font-size: 12px;
  font-weight: 500;
  color: #e1dfdd;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.pro-speed-select {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
}

.pro-speed-select option {
  background: #201f1e;
  color: #ffffff;
}

/* ==========================================================================
   Upload Manager Drawer (Bottom Right)
   ========================================================================== */

.upload-manager {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 340px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  /* box-shadow removed */
  z-index: 600;
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.upload-manager.show {
  display: flex;
}

.upload-manager-header {
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13px;
}

.upload-manager-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.upload-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.upload-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: var(--bg-surface);
  border-left: 4px solid var(--accent);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  /* box-shadow removed */
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  min-width: 260px;
  animation: slideIn 0.2s ease-out;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   OneDrive Mobile App Experience (Bottom Bar, FAB, Bottom Sheets)
   ========================================================================== */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  z-index: 500;
  padding: 0 8px;
  /* box-shadow removed */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-nav-items {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: space-around;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  user-select: none;
}

.mobile-nav-btn i {
  font-size: 20px;
}

.mobile-nav-btn.active {
  color: var(--accent);
}

.mobile-nav-btn.active i {
  transform: scale(1.1);
}

/* OneDrive Mobile Floating Action Button (FAB) */
.mobile-fab-btn {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0078d4, #00b4d8);
  color: #ffffff;
  border: none;
  /* box-shadow removed */
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  z-index: 450;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-fab-btn:active {
  transform: scale(0.92);
}

/* Mobile FAB Popup Sheet */
.fab-sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  /* backdrop-filter removed for mobile perf */
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.fab-sheet-backdrop.show {
  display: block;
  opacity: 1;
}

.fab-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-surface);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 36px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.fab-sheet-backdrop.show .fab-sheet {
  transform: translateY(0);
}

.fab-sheet-header {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  text-align: center;
}

.fab-sheet-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.fab-sheet-item:hover, .fab-sheet-item:active {
  background: var(--accent-light);
  color: var(--accent);
}

.fab-sheet-item i {
  font-size: 22px;
  color: var(--accent);
}

/* Android TV & Smart TV D-Pad Focus Box */
.file-card.tv-focused, .list-row.tv-focused {
  outline: 3.5px solid var(--accent) !important;
  /* box-shadow removed */
  transform: scale(1.05) !important;
  z-index: 10;
}

/* Mobile Action 3-dots Button */
.mobile-dots-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.15s ease;
}

.mobile-dots-btn:active {
  background: var(--bg-hover);
  color: var(--accent);
}

/* Responsive adjustments for Native OneDrive Mobile Experience */
@media (max-width: 768px) {
  body {
    padding-bottom: 70px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .app-sidebar, .sidebar {
    display: none !important;
  }

  .filter-chips-bar::-webkit-scrollbar {
    display: none !important;
    height: 0 !important;
  }

  .mobile-bottom-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    height: 56px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    /* box-shadow removed */
    z-index: 500;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-nav-items {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    max-width: 20%;
    height: 100%;
    padding: 2px 0;
    white-space: nowrap;
  }

  .mobile-nav-btn span {
    font-size: 10px;
    line-height: 1;
  }

  .mobile-nav-btn i {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.15s ease;
  }

  .mobile-nav-btn.active {
    color: var(--accent);
  }

  .mobile-nav-btn.active i {
    transform: scale(1.15);
  }

  .mobile-fab-btn {
    display: flex !important;
  }

  .mobile-dots-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .file-actions-hover {
    display: none !important;
  }

  .grid-view {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 10px !important;
    padding-top: 6px !important;
  }

  .file-card {
    height: auto !important;
    min-height: 110px !important;
    padding: 8px !important;
    position: relative;
    background: var(--bg-surface) !important;
  }

  .file-preview-box {
    height: 75px !important;
    margin-bottom: 6px !important;
  }

  .file-name {
    font-size: 11px !important;
  }

  .file-meta {
    font-size: 10px !important;
  }

  .file-card .mobile-dots-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255,255,255,0.7);
    /* backdrop-filter removed for mobile perf */
    width: 24px;
    height: 24px;
    /* box-shadow removed */
  }

  [data-theme='dark'] .file-card .mobile-dots-btn {
    background: rgba(40,40,40,0.7);
  }

  .header-left {
    width: auto;
  }

  .header-center {
    display: none;
  }

  .command-bar {
    padding: 6px 12px;
  }

  .explorer-container {
    padding: 0 10px 80px 10px;
  }

  .preview-modal-card {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
  }
}

/* ==========================================================================
   PRO ENHANCEMENTS: Pull-To-Refresh, Floating Audio & Code Line Numbers
   ========================================================================== */

/* Pull to Refresh Indicator */
.pull-to-refresh-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 0;
  overflow: hidden;
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.pull-to-refresh-indicator.visible {
  display: flex;
  height: 46px;
}

/* Floating Mini Audio Bar */
.floating-mini-audio {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  /* box-shadow removed */
  border-radius: 50px;
  padding: 8px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  /* backdrop-filter removed for mobile perf */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.floating-mini-audio.active {
  display: flex;
}
@media (max-width: 768px) {
  .floating-mini-audio {
    bottom: 74px;
    right: 12px;
    left: 12px;
    border-radius: 16px;
  }
}

/* Code Editor with Line Numbers */
.code-editor-container {
  display: flex;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  height: 480px;
}
.code-line-numbers {
  padding: 14px 10px;
  background: #181818;
  color: #6e7681;
  text-align: right;
  user-select: none;
  font-size: 12px;
  min-width: 40px;
  border-right: 1px solid #2d2d2d;
  overflow: hidden;
}
.code-editor-area {
  flex: 1;
  background: transparent;
  color: inherit;
  border: none;
  outline: none;
  padding: 14px;
  resize: none;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: pre;
  overflow: auto;
}

/* ==========================================================================
   INSPECTOR INFO PANEL, FOLDER COLOR PALETTE & SEARCH HIGHLIGHT
   ========================================================================== */

/* Right Info Inspector Panel */
.info-panel {
  position: fixed;
  top: 48px;
  right: -340px;
  width: 320px;
  height: calc(100vh - 48px);
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  /* box-shadow removed */
  z-index: 900;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
}
.info-panel.show {
  right: 0;
}
@media (max-width: 768px) {
  .info-panel {
    top: 0;
    width: 100vw;
    right: -100vw;
    height: 100vh;
    z-index: 1100;
  }
}
.info-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.info-panel-preview {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
}
.info-panel-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.info-label {
  color: var(--text-muted);
}
.info-val {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Folder Color Dots & Picker */
.folder-color-palette {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
}
.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.color-dot:hover {
  transform: scale(1.25);
  border-color: #fff;
}

/* Search Term Highlight */
mark.search-highlight {
  background: #ffeb3b;
  color: #000;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 700;
}
[data-theme='dark'] mark.search-highlight {
  background: #fbc02d;
  color: #000;
}

/* ==========================================================================
   PINNED ITEMS, MULTI-SEGMENT STORAGE METER & PERSONAL VAULT
   ========================================================================== */

/* Pinned Item Badge */
.pinned-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 120, 212, 0.15);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 5;
}

/* Multi-Segment Storage Progress Bar */
.storage-multi-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-hover);
  margin: 8px 0;
  width: 100%;
}
.storage-segment {
  height: 100%;
  transition: width 0.4s ease;
}
.seg-images { background: #0078d4; }
.seg-videos { background: #8764b8; }
.seg-docs { background: #d83b01; }
.seg-audio { background: #107c41; }
.seg-others { background: #ffb900; }

/* Vault PIN Keypad */
.vault-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 240px;
  margin: 16px auto;
}
.keypad-btn {
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.keypad-btn:active {
  background: var(--accent);
  color: #fff;
  transform: scale(0.92);
}
.pin-dots-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  transition: background 0.15s ease;
}
.pin-dot.filled {
  background: var(--accent);
}

/* File Tags & Notes */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.tag-pill .tag-del-btn {
  cursor: pointer;
  opacity: 0.7;
}
.tag-pill .tag-del-btn:hover {
  opacity: 1;
}
.info-notes-area {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 8px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  min-height: 60px;
}
.info-notes-area:focus {
  border-color: var(--accent);
}

@media print {
  body * {
    visibility: hidden;
  }
  #previewModal, #previewModal *, #previewContentContainer, #previewContentContainer * {
    visibility: visible;
  }
  #previewModal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 999999;
  }
  .modal-header, .icon-btn, .modal-close {
    display: none !important;
  }
}
