/* ==========================================================================
   FluxDrive Storage Web Application Stylesheet
   Official OVHcloud Enterprise Manager Theme: Pure White & Royal Blue (#0050d7)
   Font: Source Sans 3 (Official OVHcloud Typography)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  /* OVHcloud Signature Palette */
  --ovh-blue: #0050d7;
  --ovh-blue-hover: #003da6;
  --ovh-blue-active: #002d72;
  --ovh-blue-tint: #ebf3ff;
  --ovh-blue-tint-border: #cce0ff;
  --ovh-navy: #00185e;
  --ovh-navy-dark: #000e38;

  /* Surfaces & Canvas */
  --ovh-bg: #f5f7fa;
  --ovh-card-bg: #ffffff;
  --ovh-border: #dbe0ea;
  --ovh-border-subtle: #edf1f7;
  --ovh-border-focus: #0050d7;

  /* Typography */
  --ovh-font: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ovh-text-title: #1a2233;
  --ovh-text-body: #374151;
  --ovh-text-muted: #5b677a;
  --ovh-text-light: #8c9ba5;

  /* Status & Alerts */
  --ovh-green: #0d8240;
  --ovh-green-bg: #edf8f2;
  --ovh-green-border: #bce3cc;
  --ovh-red: #dc2626;
  --ovh-red-bg: #fef2f2;
  --ovh-red-border: #fecaca;
  --ovh-amber: #d97706;
  --ovh-amber-bg: #fffbeb;
  --ovh-amber-border: #fde68a;

  /* Radius & Shadows */
  --ovh-radius-sm: 4px;
  --ovh-radius: 6px;
  --ovh-radius-lg: 8px;
  --ovh-shadow-sm: 0 1px 2px rgba(0, 24, 94, 0.04);
  --ovh-shadow: 0 1px 3px rgba(0, 24, 94, 0.05), 0 4px 16px rgba(0, 24, 94, 0.04);
  --ovh-shadow-lg: 0 10px 25px rgba(0, 24, 94, 0.08), 0 2px 6px rgba(0, 24, 94, 0.04);
  --ovh-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--ovh-font);
  background-color: var(--ovh-bg);
  color: var(--ovh-text-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Screen 1 & Screen 2: Authentication Wrapper & Cards (Setup / Login)
   ========================================================================== */
.storage-login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  background-color: var(--ovh-bg);
}

.storage-login-card {
  background: var(--ovh-card-bg);
  border: 1px solid var(--ovh-border);
  border-radius: var(--ovh-radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--ovh-shadow-lg);
  animation: fadeIn 0.3s ease-out;
}

.storage-setup-card {
  max-width: 480px;
}

.storage-brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.storage-logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--ovh-blue);
  color: #ffffff;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0, 80, 215, 0.25);
}

.storage-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ovh-text-title);
  margin-bottom: 6px;
}

.storage-subtitle {
  font-size: 13.5px;
  color: var(--ovh-text-muted);
  line-height: 1.5;
}

.storage-badge-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ovh-blue-tint);
  border: 1px solid var(--ovh-blue-tint-border);
  color: var(--ovh-blue);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 12px;
  font-family: monospace;
}

.storage-setup-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--ovh-green-bg);
  border: 1px solid var(--ovh-green-border);
  color: var(--ovh-green);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.setup-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ovh-green);
  animation: pulseDot 1.5s infinite ease-in-out;
}

.storage-auth-notice {
  background: var(--ovh-blue-tint);
  border: 1px solid var(--ovh-blue-tint-border);
  border-left: 4px solid var(--ovh-blue);
  border-radius: var(--ovh-radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #1e40af;
  margin-bottom: 20px;
}

.storage-auth-notice strong {
  color: var(--ovh-navy);
}

.storage-form-group {
  margin-bottom: 18px;
  text-align: left;
}

.storage-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ovh-text-title);
  margin-bottom: 6px;
}

.storage-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.storage-input-icon {
  position: absolute;
  left: 12px;
  color: var(--ovh-text-muted);
  pointer-events: none;
}

.storage-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  border-radius: var(--ovh-radius);
  padding: 10px 14px 10px 38px;
  font-size: 13.5px;
  color: var(--ovh-text-title);
  outline: none;
  font-family: inherit;
  transition: border-color var(--ovh-transition), box-shadow var(--ovh-transition);
}

.storage-input:focus {
  border-color: var(--ovh-blue);
  box-shadow: 0 0 0 3px rgba(0, 80, 215, 0.15);
}

.storage-input::placeholder {
  color: var(--ovh-text-light);
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ovh-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--ovh-transition);
}

.btn-toggle-pwd:hover {
  color: var(--ovh-blue);
}

.storage-btn-submit {
  width: 100%;
  background: var(--ovh-blue);
  color: #ffffff;
  border: 1px solid var(--ovh-blue);
  border-radius: var(--ovh-radius);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 80, 215, 0.25);
  transition: all var(--ovh-transition);
  margin-top: 22px;
}

.storage-btn-submit:hover {
  background: var(--ovh-blue-hover);
  border-color: var(--ovh-blue-hover);
  box-shadow: 0 4px 12px rgba(0, 80, 215, 0.35);
  transform: translateY(-1px);
}

.storage-btn-submit:active {
  background: var(--ovh-blue-active);
  transform: translateY(0);
}

.storage-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.storage-alert-error {
  display: none;
  background: var(--ovh-red-bg);
  border: 1px solid var(--ovh-red-border);
  color: var(--ovh-red);
  padding: 10px 14px;
  border-radius: var(--ovh-radius);
  font-size: 13px;
  margin-bottom: 16px;
  animation: shake 0.3s ease-in-out;
}

.storage-alert-success {
  background: var(--ovh-green-bg);
  border: 1px solid var(--ovh-green-border);
  color: var(--ovh-green);
  padding: 10px 14px;
  border-radius: var(--ovh-radius);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.5;
  animation: fadeIn 0.25s ease-out;
}

/* ==========================================================================
   Screen 3: Storage App Layout (Google Drive Enterprise Interface)
   Full-height sidebar, breadcrumbs, folder cards, list/grid view, modals
   ========================================================================== */
.storage-app-layout {
  display: none; /* toggled by storage-app.js to 'flex' */
  flex-direction: row;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--ovh-bg);
}

/* --------------------------------------------------------------------------
   Sidebar (Left Navigation)
   -------------------------------------------------------------------------- */
.storage-sidebar {
  width: 256px;
  min-width: 256px;
  background: var(--ovh-card-bg);
  border-right: 1px solid var(--ovh-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px 12px;
  user-select: none;
  z-index: 20;
}

.storage-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 20px;
}

.storage-sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--ovh-radius);
  background: var(--ovh-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 80, 215, 0.25);
  flex-shrink: 0;
}

.storage-sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ovh-navy);
  letter-spacing: -0.3px;
}

/* "+ Nuovo" Button & Dropdown */
.storage-sidebar-actions {
  padding: 0 8px 16px;
}

.storage-new-dropdown-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.storage-btn-new {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  border-radius: 24px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ovh-text-title);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 24, 94, 0.08), 0 4px 12px rgba(0, 24, 94, 0.04);
  transition: all var(--ovh-transition);
  width: auto;
}

.storage-btn-new svg {
  color: var(--ovh-blue);
}

.storage-btn-new:hover {
  background: var(--ovh-blue-tint);
  border-color: var(--ovh-blue-tint-border);
  color: var(--ovh-blue);
  box-shadow: 0 4px 14px rgba(0, 80, 215, 0.18);
  transform: translateY(-1px);
}

.storage-new-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  border-radius: var(--ovh-radius-lg);
  box-shadow: var(--ovh-shadow-lg);
  padding: 6px 0;
  z-index: 100;
  animation: fadeIn 0.15s ease-out;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: none;
  border: none;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  color: var(--ovh-text-title);
  cursor: pointer;
  text-align: left;
  transition: background var(--ovh-transition), color var(--ovh-transition);
}

.dropdown-item:hover {
  background: var(--ovh-blue-tint);
  color: var(--ovh-blue);
}

.dropdown-divider {
  height: 1px;
  background: var(--ovh-border-subtle);
  margin: 6px 0;
}

/* Sidebar Nav Items (I miei file, Recenti, Preferiti, Cestino) */
.storage-sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 20px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ovh-text-muted);
  cursor: pointer;
  text-align: left;
  transition: all var(--ovh-transition);
}

.sidebar-nav-item svg {
  flex-shrink: 0;
  transition: stroke var(--ovh-transition);
}

.sidebar-nav-item:hover {
  background: rgba(0, 80, 215, 0.05);
  color: var(--ovh-navy);
}

.sidebar-nav-item.active {
  background: var(--ovh-blue-tint);
  color: var(--ovh-blue);
  font-weight: 700;
}

.sidebar-nav-item.active svg {
  stroke: var(--ovh-blue);
}

/* Sidebar Quota Widget */
.storage-sidebar-quota {
  padding: 16px 12px;
  border-top: 1px solid var(--ovh-border-subtle);
  margin-top: auto;
}

.quota-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ovh-text-title);
  margin-bottom: 8px;
}

.quota-text-sub {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ovh-text-muted);
  margin-top: 6px;
  font-weight: 500;
}

.storage-quota-bar {
  width: 100%;
  height: 6px;
  background: var(--ovh-border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.storage-quota-fill {
  height: 100%;
  width: 0%;
  background: var(--ovh-blue);
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

/* --------------------------------------------------------------------------
   Main Workspace Container
   -------------------------------------------------------------------------- */
.storage-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  background-color: var(--ovh-bg);
}

/* App Header (Search & Actions) */
.storage-app-header {
  height: 60px;
  min-height: 60px;
  background: var(--ovh-card-bg);
  border-bottom: 1px solid var(--ovh-border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 10;
}

.storage-search-bar {
  flex: 1;
  max-width: 580px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  border-radius: 24px;
  padding: 0 16px;
  height: 40px;
  transition: all var(--ovh-transition);
  border: 1px solid transparent;
}

.storage-search-bar:focus-within {
  background: #ffffff;
  border-color: var(--ovh-blue);
  box-shadow: 0 0 0 3px rgba(0, 80, 215, 0.12);
}

.storage-search-bar svg {
  flex-shrink: 0;
}

.storage-search-bar input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ovh-text-title);
}

.storage-search-bar input::placeholder {
  color: var(--ovh-text-light);
}

.storage-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* View Mode Switcher (List vs Grid) */
.storage-view-toggle {
  display: flex;
  background: #f1f5f9;
  border-radius: var(--ovh-radius);
  padding: 2px;
  gap: 2px;
}

.view-toggle-btn {
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: var(--ovh-radius-sm);
  color: var(--ovh-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ovh-transition);
}

.view-toggle-btn:hover {
  color: var(--ovh-text-title);
}

.view-toggle-btn.active {
  background: #ffffff;
  color: var(--ovh-blue);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.storage-btn-icon {
  background: none;
  border: 1px solid var(--ovh-border);
  border-radius: var(--ovh-radius);
  color: var(--ovh-text-muted);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ovh-transition);
}

.storage-btn-icon:hover {
  background: var(--ovh-blue-tint);
  border-color: var(--ovh-blue-tint-border);
  color: var(--ovh-blue);
}

.storage-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ovh-text-title);
  background: #f1f5f9;
  padding: 4px 12px 4px 6px;
  border-radius: 20px;
  border: 1px solid var(--ovh-border-subtle);
}

.storage-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ovh-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
}

.storage-btn-logout {
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  color: var(--ovh-text-muted);
  padding: 6px 12px;
  border-radius: var(--ovh-radius);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--ovh-transition);
}

.storage-btn-logout:hover {
  background: var(--ovh-red-bg);
  border-color: var(--ovh-red-border);
  color: var(--ovh-red);
}

/* Subheader: Breadcrumbs & Contextual Actions */
.storage-sub-bar {
  min-height: 48px;
  background: #ffffff;
  border-bottom: 1px solid var(--ovh-border-subtle);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.storage-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.crumb-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: var(--ovh-radius-sm);
  color: var(--ovh-blue);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--ovh-transition);
}

.crumb-btn:hover:not(.active) {
  background: var(--ovh-blue-tint);
}

.crumb-btn.active {
  color: var(--ovh-text-title);
  font-weight: 700;
  cursor: default;
}

.crumb-sep {
  color: var(--ovh-text-light);
  font-size: 13px;
}

.storage-sub-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.storage-sub-btn {
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  color: var(--ovh-text-title);
  border-radius: var(--ovh-radius);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--ovh-transition);
}

.storage-sub-btn:hover {
  background: var(--ovh-bg);
  border-color: var(--ovh-border);
}

.storage-sub-btn.primary {
  background: var(--ovh-blue);
  border-color: var(--ovh-blue);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 80, 215, 0.2);
}

.storage-sub-btn.primary:hover {
  background: var(--ovh-blue-hover);
  border-color: var(--ovh-blue-hover);
  box-shadow: 0 2px 6px rgba(0, 80, 215, 0.3);
}

.storage-sub-btn.danger {
  background: #ffffff;
  border-color: var(--ovh-red-border);
  color: var(--ovh-red);
}

.storage-sub-btn.danger:hover {
  background: var(--ovh-red-bg);
  border-color: var(--ovh-red);
}

/* --------------------------------------------------------------------------
   Scrollable Workspace Body & Dropzone
   -------------------------------------------------------------------------- */
.storage-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  transition: background-color var(--ovh-transition);
}

.storage-body-scroll.dragover {
  background-color: var(--ovh-blue-tint);
  outline: 2px dashed var(--ovh-blue);
  outline-offset: -12px;
}

/* Active Upload Progress Box */
.storage-upload-progress-box {
  background: #ffffff;
  border: 1px solid var(--ovh-blue-tint-border);
  border-left: 4px solid var(--ovh-blue);
  border-radius: var(--ovh-radius);
  padding: 12px 16px;
  box-shadow: var(--ovh-shadow-sm);
  animation: fadeIn 0.2s ease-out;
}

.upload-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--ovh-text-title);
  margin-bottom: 6px;
}

.upload-progressbar-track {
  width: 100%;
  height: 6px;
  background: var(--ovh-border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.upload-progressbar-fill {
  height: 100%;
  width: 0%;
  background: var(--ovh-blue);
  border-radius: 3px;
  transition: width 0.15s ease-out;
}

/* Sections */
.storage-content-section {
  display: flex;
  flex-direction: column;
}

.section-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ovh-text-muted);
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Folders Grid View
   -------------------------------------------------------------------------- */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.folder-card {
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  border-radius: var(--ovh-radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all var(--ovh-transition);
  user-select: none;
}

.folder-card:hover {
  background: #ffffff;
  border-color: var(--ovh-blue);
  box-shadow: 0 2px 8px rgba(0, 80, 215, 0.12);
  transform: translateY(-1px);
}

.folder-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.folder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.folder-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ovh-text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.6;
  transition: opacity var(--ovh-transition);
}

.folder-card:hover .folder-card-actions {
  opacity: 1;
}

.btn-item-star {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--ovh-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ovh-transition);
}

.btn-item-star:hover {
  color: #eab308;
  transform: scale(1.15);
}

.btn-item-star.starred {
  color: #eab308;
}

.btn-item-star.starred svg {
  fill: #eab308;
}

.btn-item-action {
  background: none;
  border: none;
  color: var(--ovh-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--ovh-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ovh-transition);
}

.btn-item-action:hover {
  color: var(--ovh-text-title);
  background: var(--ovh-bg);
}

/* --------------------------------------------------------------------------
   Files List View (Table)
   -------------------------------------------------------------------------- */
.table-view-wrap {
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  border-radius: var(--ovh-radius-lg);
  overflow: hidden;
  box-shadow: var(--ovh-shadow-sm);
}

.storage-file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.storage-file-table th {
  background: #f8fafc;
  padding: 10px 16px;
  font-weight: 700;
  color: var(--ovh-text-muted);
  border-bottom: 1px solid var(--ovh-border);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.storage-file-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--ovh-border-subtle);
  vertical-align: middle;
  color: var(--ovh-text-body);
}

.storage-file-table tr:hover td {
  background: #f8fafc;
}

.storage-file-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--ovh-text-title);
  min-width: 0;
}

.storage-file-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--ovh-radius-sm);
  background: var(--ovh-blue-tint);
  color: var(--ovh-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.storage-file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.storage-btn-action {
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  color: var(--ovh-text-muted);
  width: 30px;
  height: 30px;
  border-radius: var(--ovh-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--ovh-transition);
}

.storage-btn-action:hover {
  background: var(--ovh-blue-tint);
  border-color: var(--ovh-blue-tint-border);
  color: var(--ovh-blue);
}

.storage-btn-action.delete:hover {
  background: var(--ovh-red-bg);
  border-color: var(--ovh-red-border);
  color: var(--ovh-red);
}

/* --------------------------------------------------------------------------
   Files Grid View (Cards)
   -------------------------------------------------------------------------- */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.file-grid-card {
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  border-radius: var(--ovh-radius-lg);
  overflow: hidden;
  box-shadow: var(--ovh-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--ovh-transition);
}

.file-grid-card:hover {
  border-color: var(--ovh-blue);
  box-shadow: 0 4px 14px rgba(0, 80, 215, 0.12);
  transform: translateY(-2px);
}

.file-grid-thumbnail {
  height: 120px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--ovh-border-subtle);
  overflow: hidden;
}

.file-grid-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-grid-generic-icon {
  color: var(--ovh-blue);
}

.file-grid-body {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.file-grid-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ovh-text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-grid-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ovh-text-muted);
}

.file-grid-footer {
  padding: 8px 14px 12px;
  border-top: 1px solid var(--ovh-border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-grid-action {
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  color: var(--ovh-text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--ovh-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--ovh-transition);
}

.btn-grid-action:hover {
  background: var(--ovh-blue-tint);
  border-color: var(--ovh-blue-tint-border);
  color: var(--ovh-blue);
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.storage-empty-state {
  text-align: center;
  padding: 64px 20px;
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  border-radius: var(--ovh-radius-lg);
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.storage-empty-state h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ovh-text-title);
  margin-bottom: 6px;
}

.storage-empty-state p {
  font-size: 13.5px;
  color: var(--ovh-text-muted);
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
.storage-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 24, 94, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease-out;
}

.storage-modal-card {
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  border-radius: var(--ovh-radius-lg);
  max-width: 640px;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--ovh-shadow-lg);
  animation: fadeIn 0.2s ease-out;
}

.storage-modal-card.small-modal {
  max-width: 420px;
}

.storage-modal-card.preview-modal {
  max-width: 720px;
}

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

.storage-modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ovh-text-title);
}

.storage-modal-close {
  background: none;
  border: none;
  color: var(--ovh-text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.storage-modal-close:hover {
  color: var(--ovh-text-title);
}

.storage-modal-body {
  padding: 20px;
}

.storage-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--ovh-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

.preview-body {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: #f1f5f9;
  min-height: 240px;
}

.preview-body img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: var(--ovh-radius-sm);
}

.preview-generic {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.preview-generic-icon {
  color: var(--ovh-blue);
}

.preview-generic-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ovh-text-title);
}

.preview-generic-size {
  font-size: 13px;
  color: var(--ovh-text-muted);
}

/* --------------------------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------------------------- */
.storage-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.storage-toast {
  background: #ffffff;
  border: 1px solid var(--ovh-border);
  border-radius: var(--ovh-radius);
  padding: 12px 18px;
  box-shadow: var(--ovh-shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ovh-text-title);
  pointer-events: auto;
  animation: slideInRight 0.25s ease-out;
}

.storage-toast.success { border-left: 4px solid var(--ovh-green); }
.storage-toast.error { border-left: 4px solid var(--ovh-red); }
.storage-toast.info { border-left: 4px solid var(--ovh-blue); }

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.spin {
  animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .storage-sidebar {
    width: 200px;
    min-width: 200px;
  }
  .storage-search-bar {
    max-width: 100%;
  }
}

