/* ============================================================
   Cloud Storage · Luxury Glassmorphic Design System
   Minimalist, Ultra-Secure, Confidential Theme
   ============================================================ */

:root {
  --bg-main: #06080e;
  --bg-card: rgba(13, 18, 30, 0.72);
  --bg-card-hover: rgba(22, 30, 48, 0.82);
  --bg-sidebar: rgba(10, 14, 24, 0.88);
  --bg-topbar: rgba(6, 8, 14, 0.85);
  --bg-input: #0b111e;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  --border-light: rgba(255, 255, 255, 0.14);
  --text: #f8fafc;
  --text-muted: #8492a6;
  --text-dim: #475569;
  --accent: #38bdf8;
  --accent-rgb: 56, 189, 248;
  --accent-glow: rgba(56, 189, 248, 0.18);
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #818cf8;
  --font: "Plus Jakarta Sans", "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.65);
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-topbar: rgba(248, 250, 252, 0.88);
  --bg-input: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --border-focus: #0284c7;
  --border-light: rgba(0, 0, 0, 0.15);
  --text: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --accent: #0284c7;
  --accent-rgb: 2, 132, 199;
  --accent-glow: rgba(2, 132, 199, 0.12);
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --shadow-card: 0 12px 36px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

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

body {
  font-family: var(--font);
  background-color: var(--bg-main);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fix Browser Autofill White Flash */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #0b111e inset !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  caret-color: #38bdf8 !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ============================================================
   DISCRETE LUXURY LOGIN
   ============================================================ */
.cloud-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: var(--bg-main);
  position: relative;
  overflow: hidden;
}

.cloud-ambient-light {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
}

.light-1 {
  width: 550px;
  height: 550px;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(56, 189, 248, 0.14) 0%, rgba(0, 0, 0, 0) 70%);
}

.light-2 {
  width: 400px;
  height: 400px;
  bottom: -80px;
  right: 15%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
}

.cloud-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-radius: var(--radius-xl);
  padding: 42px 36px;
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 2;
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.cloud-login-brand {
  text-align: center;
  margin-bottom: 30px;
}

.cloud-emblem-wrap {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cloud-emblem-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 20px rgba(56, 189, 248, 0.3));
}

.cloud-brand-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 4px;
}

.cloud-brand-sub {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 400;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
  transition: var(--transition);
}

.input-field:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #0d1424;
}

.input-toggle-pw {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  font-size: 0.95rem;
  transition: var(--transition);
}

.input-toggle-pw:hover {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
  margin-top: 8px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: var(--border-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-sm {
  width: auto;
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  margin-top: 0;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.alert-box {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* ============================================================
   APP SHELL
   ============================================================ */
.cloud-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Topbar */
.cloud-topbar {
  height: 60px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}

.topbar-brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(2, 132, 199, 0.3));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
}

.brand-text-main {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.topbar-center {
  flex: 1;
  max-width: 520px;
  margin: 0 20px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  font-size: 0.88rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 36px 8px 38px;
  color: var(--text);
  font-size: 0.86rem;
  font-family: inherit;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  background: var(--bg-input);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-clear {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  font-size: 0.75rem;
  display: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
}

.user-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.76rem;
}

/* Body Layout */
.cloud-main-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.cloud-sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 14px;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 10px 8px 10px;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 22px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.sidebar-nav-item.active {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  font-weight: 600;
  border-color: rgba(56, 189, 248, 0.2);
}

.sidebar-nav-item .nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-nav-item .nav-icon {
  font-size: 1.05rem;
}

.sidebar-badge {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.sidebar-nav-item.active .sidebar-badge {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

/* Storage Meter Widget */
.sidebar-storage-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.storage-title-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}

.storage-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 7px;
}

.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.storage-detail-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Content Area */
.cloud-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-main);
  position: relative;
}

/* Action Bar */
.cloud-action-bar {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 24, 0.5);
  backdrop-filter: blur(16px);
  gap: 14px;
  flex-wrap: wrap;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.breadcrumb-item {
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.breadcrumb-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

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

.breadcrumb-separator {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.action-tools-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-toggle-wrap {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.view-toggle-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Main Viewport */
.cloud-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.viewport-section-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   FOLDERS GRID (Modern Luxury Revamp)
   ============================================================ */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.folder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.folder-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.folder-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.5), 0 0 15px -2px rgba(56, 189, 248, 0.15);
}

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

.folder-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.folder-icon-pill {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.folder-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-access {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-access-private {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.badge-access-team {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-access-restricted {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.badge-access-public {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-download-deny {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}

.folder-info {
  margin-top: 4px;
}

.folder-name {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.folder-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

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

.folder-actions-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   FILES GRID (Kachelansicht)
   ============================================================ */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.file-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.file-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.file-thumbnail-wrap {
  height: 120px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

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

.file-icon-big {
  font-size: 2.8rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.file-star-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  color: rgba(255, 255, 255, 0.35);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: var(--transition);
  font-size: 0.82rem;
}

.file-star-badge.starred {
  color: #f59e0b;
}

.file-card-details {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.file-card-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
  cursor: pointer;
}

.file-card-name:hover {
  color: #38bdf8;
}

.file-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.file-card-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   FILES LIST
   ============================================================ */
.files-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.files-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.files-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.files-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.files-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.file-table-name-col {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
}

.file-table-name-col:hover {
  color: #38bdf8;
}

/* ============================================================
   LOGINS VAULT
   ============================================================ */
.logins-vault-header {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(13, 18, 30, 0.6));
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.vault-icon-shield {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.vault-brand-info h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.vault-brand-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.logins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.login-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.login-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-favicon-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

.login-title-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.login-url-text {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
}

.login-url-text:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.login-field-box {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-field-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 2px;
}

.login-field-val {
  font-size: 0.86rem;
  font-family: monospace;
  color: var(--text);
  user-select: all;
}

.login-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   DRAG & DROP OVERLAY
   ============================================================ */
.drag-drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 14, 0.9);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drag-drop-overlay.active {
  display: flex;
}

.drag-drop-box {
  border: 2px dashed #38bdf8;
  border-radius: var(--radius-xl);
  padding: 50px 70px;
  text-align: center;
  background: rgba(56, 189, 248, 0.06);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.25);
}

.drag-drop-box h2 {
  font-size: 1.4rem;
  margin: 14px 0 6px 0;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: #0d121f;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-card-lg {
  max-width: 860px;
  height: 82vh;
}

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

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.preview-img-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.preview-text-box {
  width: 100%;
  height: 100%;
  background: #070a12;
  padding: 18px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
  color: #e2e8f0;
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(13, 18, 30, 0.95);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: slideInToast 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast.ok { border-left: 3px solid #10b981; }
.toast.err { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid #38bdf8; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state h4 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 0.84rem;
  max-width: 360px;
  margin: 0 auto 16px auto;
}

/* ============================================================
   PERMISSIONS MODAL & ACCESS CONTROLS
   ============================================================ */
.modal-card-perm {
  max-width: 580px;
}

.perm-modal-icon {
  width: 42px;
  height: 42px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.perm-levels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.perm-radio-card {
  position: relative;
  cursor: pointer;
  display: block;
}

.perm-radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.perm-card-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: var(--transition);
  height: 100%;
}

.perm-radio-card:hover .perm-card-content {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.perm-radio-card input:checked + .perm-card-content {
  background: rgba(56, 189, 248, 0.08);
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
}

.perm-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.perm-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.perm-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Apple Style Switch Slider */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.switch-toggle input:checked + .switch-slider {
  background-color: #0284c7;
  border-color: #38bdf8;
}

.switch-toggle input:checked + .switch-slider::before {
  transform: translateX(20px);
}

/* User Selection Checklist */
.perm-users-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.perm-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: var(--transition);
}

.perm-user-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.2);
}

.perm-user-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.perm-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.perm-user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.perm-user-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* File Card Quick Download & Badges */
.file-card-badges-top {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 3;
}

.btn-download-pill {
  background: rgba(2, 132, 199, 0.22) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

.btn-download-pill:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important;
}

@media (max-width: 900px) {
  .cloud-sidebar {
    position: fixed;
    top: 60px;
    bottom: 0;
    left: -260px;
    z-index: 90;
    transition: left 0.3s ease;
  }
  .cloud-sidebar.open {
    left: 0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
  }
  .mobile-nav-toggle {
    display: flex !important;
  }
  .perm-levels-grid {
    grid-template-columns: 1fr;
  }
}
