/* ==========================================================================
   PERSONAL MEDIA & DOCUMENT VAULT - DESIGN SYSTEM & STYLES
   Modern Glassmorphic Dark-Mode Architecture
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-main: #070a12;
  --bg-gradient: radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.15) 0%, transparent 40%),
                      radial-gradient(circle at 85% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
                      radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
                      #070a12;
  --panel-bg: rgba(18, 25, 41, 0.7);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-hover-border: rgba(56, 189, 248, 0.4);
  --panel-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  
  --card-bg: rgba(23, 32, 54, 0.65);
  --card-hover-bg: rgba(29, 41, 70, 0.85);
  
  --primary: #06b6d4;
  --primary-glow: rgba(6, 182, 212, 0.35);
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-indigo: #6366f1;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .brand-title, .modal-title {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   NAVIGATION & HEADER
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 13, 23, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--panel-border);
  padding: 0.9rem 2rem;
  transition: var(--transition-normal);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.35rem;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.brand-text h1 {
  font-size: 1.28rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 30%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-center-search {
  flex: 1;
  max-width: 460px;
  position: relative;
}

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

.search-icon {
  position: absolute;
  left: 1.1rem;
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.nav-search-input {
  width: 100%;
  padding: 0.68rem 1rem 0.68rem 2.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--text-main);
  font-size: 0.9rem;
  transition: var(--transition-normal);
  outline: none;
}

.nav-search-input:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.clear-search-btn {
  position: absolute;
  right: 0.9rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  font-size: 0.9rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  border-radius: 999px;
  transition: var(--transition-fast);
  cursor: default;
}

.user-profile-badge:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.user-name-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.02em;
}


/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(6, 182, 212, 0.45);
  filter: brightness(1.1);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--panel-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

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

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   MAIN CONTAINER & HERO / STATS BAR
   ========================================================================== */
.main-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.8rem 2rem 5rem 2rem;
}

.hero-dashboard {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.75rem;
  margin-bottom: 2.2rem;
}

.hero-info-card {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  padding: 2.2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--panel-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-info-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 70%);
  pointer-events: none;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  width: fit-content;
}

.hero-badge-pill .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #10b981; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #ffffff 20%, #e2e8f0 70%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.96rem;
  max-width: 580px;
  margin-bottom: 1.6rem;
  line-height: 1.6;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Stats Counter Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--panel-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  box-shadow: var(--panel-shadow);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--panel-hover-border);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.icon-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.icon-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.icon-indigo {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.stat-meta {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.7rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #ffffff;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* ==========================================================================
   FEATURED ID CARD 3D FLIP SHOWCASE
   ========================================================================== */
.featured-showcase {
  background: linear-gradient(135deg, rgba(20, 28, 48, 0.85), rgba(12, 18, 32, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.6);
}

.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.showcase-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.showcase-badge {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.showcase-body {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 2.2rem;
  align-items: center;
}

/* 3D Flip Card Container */
.id-flip-stage {
  perspective: 1200px;
  width: 100%;
  max-width: 460px;
  height: 290px;
  cursor: pointer;
}

.id-flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: 20px;
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.7);
}

.id-flip-card-inner.flipped {
  transform: rotateY(180deg);
}

.id-card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0d1322;
}

.id-card-face.id-card-back {
  transform: rotateY(180deg);
}

.id-card-face img,
.id-card-face svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flip-side-indicator {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
}

.flip-hint-overlay {
  position: absolute;
  top: 12px;
  left: 14px;
  background: rgba(6, 182, 212, 0.8);
  backdrop-filter: blur(6px);
  color: #ffffff;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.showcase-info-content {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.showcase-card-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
}

.showcase-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.id-data-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.id-data-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
}

.id-data-pill span.label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.id-data-pill span.val {
  font-weight: 600;
  color: #ffffff;
}

.showcase-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   FILTER & CONTROLS TOOLBAR
   ========================================================================== */
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
}

.category-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(18, 25, 41, 0.6);
  backdrop-filter: blur(12px);
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  overflow-x: auto;
  max-width: 100%;
}

.filter-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.filter-pill .count-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  font-size: 0.72rem;
  transition: var(--transition-fast);
}

.filter-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.filter-pill.active {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.filter-pill.active .count-badge {
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
}

.gallery-sort-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.select-control {
  background: rgba(18, 25, 41, 0.7);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.86rem;
  outline: none;
  cursor: pointer;
}

.select-control:focus {
  border-color: var(--primary);
}

/* ==========================================================================
   GALLERY GRID & CARDS
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.6rem;
}

.vault-card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--panel-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.vault-card:hover {
  transform: translateY(-5px);
  border-color: var(--panel-hover-border);
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(6, 182, 212, 0.15);
}

/* Media Thumbnail Container */
.card-media-wrapper {
  position: relative;
  width: 100%;
  height: 215px;
  background: #090e1a;
  overflow: hidden;
  cursor: pointer;
}

.card-media-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.vault-card:hover .card-media-wrapper img {
  transform: scale(1.05);
}

/* Video thumbnail play badge */
.video-play-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.4rem;
  padding-left: 3px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.vault-card:hover .video-play-indicator {
  transform: translate(-50%, -50%) scale(1.12);
  background: var(--primary);
  border-color: #ffffff;
}

/* Document / PDF preview representation */
.doc-thumbnail-preview {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #151e33, #0d1424);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  position: relative;
}

.doc-paper-icon {
  width: 60px;
  height: 72px;
  background: #ffffff;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  position: relative;
  margin-bottom: 0.85rem;
}

.doc-paper-icon::after {
  content: "PDF";
  position: absolute;
  bottom: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #ef4444;
  letter-spacing: 0.05em;
}

.doc-icon-glyph {
  font-size: 1.8rem;
  color: #ef4444;
  margin-top: -8px;
}

/* Card Type Badge */
.card-type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.badge-idcard {
  background: rgba(6, 182, 212, 0.85);
  color: #ffffff;
}

.badge-photo {
  background: rgba(16, 185, 129, 0.85);
  color: #ffffff;
}

.badge-video {
  background: rgba(245, 158, 11, 0.9);
  color: #ffffff;
}

.badge-document {
  background: rgba(239, 68, 68, 0.85);
  color: #ffffff;
}

/* Floating Quick Actions on Thumbnail */
.card-quick-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 0.4rem;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.25s ease;
  z-index: 2;
}

.vault-card:hover .card-quick-overlay {
  opacity: 1;
  transform: translateY(0);
}

.quick-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(9, 13, 23, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.quick-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}

.quick-btn.btn-delete-quick:hover {
  background: #f43f5e;
  border-color: #f43f5e;
}

/* ID Card Dual Flip Indicator in Grid */
.id-side-switch-btn {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(9, 13, 23, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  z-index: 2;
  transition: var(--transition-fast);
}

.id-side-switch-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* Card Content Area */
.card-content {
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.4rem;
  line-height: 1.35;
  cursor: pointer;
  transition: color 0.2s;
}

.card-title:hover {
  color: var(--accent-cyan);
}

.card-description {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.tag-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

.card-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.card-meta-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-actions-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.action-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.action-icon-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.action-icon-btn.btn-delete:hover {
  color: #f43f5e;
}

/* ==========================================================================
   EMPTY STATE & SEARCH NO-RESULTS
   ========================================================================== */
.empty-state-card {
  grid-column: 1 / -1;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.empty-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 440px;
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   MODAL DIALOGS (UPLOAD, PREVIEW/LIGHTBOX, EDIT, DELETE)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: #0f1629;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(6, 182, 212, 0.15);
  transform: scale(0.94) translateY(10px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-backdrop.active .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.4rem 1.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: #f43f5e;
  border-color: #f43f5e;
  color: #ffffff;
}

.modal-body {
  padding: 1.8rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  padding: 1.2rem 1.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
}

/* Form controls inside modal */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
}

.form-control {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

textarea.form-control {
  min-height: 85px;
  resize: vertical;
}

/* Category selection pills in Upload Form */
.category-picker-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.cat-pick-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
}

.cat-pick-btn span.emoji {
  font-size: 1.4rem;
}

.cat-pick-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.cat-pick-btn.selected {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--primary);
  color: #38bdf8;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

/* Dropzone & File Pickers */
.dropzone-box {
  border: 2px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  position: relative;
}

.dropzone-box:hover,
.dropzone-box.dragover {
  border-color: var(--primary);
  background: rgba(6, 182, 212, 0.08);
}

.dropzone-icon {
  font-size: 2.2rem;
  color: var(--primary);
}

.dropzone-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
}

.dropzone-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Special ID Card Dual Upload Box */
.id-dual-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.id-side-dropzone {
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: var(--transition-fast);
}

.id-side-dropzone:hover {
  border-color: var(--primary);
  background: rgba(6, 182, 212, 0.06);
}

.id-side-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.id-side-dropzone.has-file .id-side-preview {
  display: block;
}

.id-side-dropzone.has-file .id-drop-placeholder {
  display: none;
}

.id-side-tag-label {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #00ffcc;
  z-index: 2;
}

/* ==========================================================================
   FULLSCREEN PREVIEW LIGHTBOX MODAL
   ========================================================================== */
.lightbox-modal .modal-dialog {
  max-width: 1100px;
  max-height: 94vh;
  height: 90vh;
}

.lightbox-body {
  padding: 0;
  display: flex;
  flex-direction: row;
  height: 100%;
  overflow: hidden;
}

.lightbox-viewer-stage {
  flex: 1.7;
  background: #060911;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
}

.lightbox-viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  transition: transform 0.2s ease;
}

.lightbox-viewer-stage video {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  outline: none;
}

.lightbox-viewer-stage iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-md);
  background: #ffffff;
}

/* In-App PDF Reader Studio */
.pdf-viewer-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0b0f19;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.pdf-viewer-header {
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 1rem;
  flex-wrap: wrap;
  z-index: 5;
}

.pdf-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pdf-header-icon {
  font-size: 1.5rem;
}

.pdf-header-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.pdf-header-sub {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.pdf-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pdf-frame-container {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 480px;
  background: #2a2e33;
}

.pdf-frame-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

.pdf-image-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 1.5rem;
  background: #0f172a;
  position: relative;
}

.pdf-page-display-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease;
  background: #ffffff;
}

.pdf-fallback-notice {
  padding: 0.65rem 1.2rem;
  background: rgba(6, 182, 212, 0.08);
  border-top: 1px solid rgba(6, 182, 212, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #94a3b8;
  gap: 1rem;
}

.pdf-card-badge-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* In-Lightbox ID Card 3D Flip Viewer */
.lightbox-id-flip-container {
  perspective: 1200px;
  width: 100%;
  max-width: 580px;
  height: 360px;
  cursor: pointer;
}

.lightbox-id-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: 20px;
}

.lightbox-id-card-inner.flipped {
  transform: rotateY(180deg);
}

.lightbox-id-card-inner .id-card-face {
  border-radius: 20px;
  box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.8);
}

/* Lightbox Details Sidebar */
.lightbox-details-panel {
  flex: 1;
  max-width: 380px;
  background: #0f1629;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.8rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.lightbox-detail-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.lightbox-detail-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.lightbox-meta-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.lightbox-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
}

.lightbox-meta-item .meta-key {
  color: var(--text-muted);
}

.lightbox-meta-item .meta-val {
  font-weight: 600;
  color: #ffffff;
}

/* Viewer Controls Overlay */
.viewer-controls-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 22, 41, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  z-index: 10;
}

.viewer-tool-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.viewer-tool-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: rgba(18, 25, 41, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  color: #ffffff;
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  pointer-events: auto;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 280px;
  max-width: 420px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast.toast-error {
  border-left: 4px solid var(--accent-rose);
}

.toast.toast-info {
  border-left: 4px solid var(--primary);
}

.toast-undo-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
}

.toast-undo-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (DESKTOP, TABLET, MOBILE OVERHAUL)
   ========================================================================== */
@media (max-width: 1080px) {
  .hero-dashboard {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
  
  .showcase-body {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
  
  .id-flip-stage {
    max-width: 100%;
  }
  
  .lightbox-body {
    flex-direction: column;
  }
  
  .lightbox-details-panel {
    max-width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}

/* Tablet & Mobile (<= 768px) */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  .navbar {
    padding: 0.65rem 0.85rem;
  }
  
  .nav-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
  }

  .nav-brand {
    gap: 0.55rem;
  }

  .brand-logo-circle {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .brand-title {
    font-size: 1.12rem;
  }

  .brand-tag-badge {
    display: none;
  }
  
  .nav-center-search {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin-top: 0.45rem;
  }

  .nav-search-input {
    padding: 0.55rem 0.85rem 0.55rem 2.4rem;
    font-size: 0.84rem;
  }

  .search-icon {
    left: 0.85rem;
    font-size: 0.85rem;
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  .user-profile-badge {
    padding: 0.2rem 0.45rem 0.2rem 0.25rem;
    gap: 0.35rem;
  }

  .avatar-circle {
    width: 26px;
    height: 26px;
    font-size: 0.68rem;
  }
  
  .main-wrapper {
    padding: 0.85rem 0.85rem 3.5rem 0.85rem;
  }
  
  .hero-title {
    font-size: 1.55rem;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 0.88rem;
    margin-bottom: 1.1rem;
  }
  
  /* Compact 2x2 Stats Grid on Mobile (No vertical stretching) */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .stat-card {
    padding: 0.85rem 0.95rem;
    gap: 0.75rem;
    border-radius: var(--radius-md);
  }

  .stat-icon-circle {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .stat-number {
    font-size: 1.35rem;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  /* Featured ID Card 3D Flip Viewer - Responsive Dimensions */
  .featured-showcase {
    padding: 1.15rem 0.95rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.8rem;
  }

  .showcase-header {
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .showcase-card-title {
    font-size: 1.3rem;
  }

  .showcase-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .id-flip-stage {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 85.6 / 54; /* Exact ISO ID-1 ratio (1.585:1) */
    border-radius: 14px;
  }

  .id-flip-card-inner {
    border-radius: 14px;
  }

  .id-card-face {
    border-radius: 14px;
  }

  .id-card-face img,
  .id-card-face svg {
    object-fit: contain;
    background: #090e18;
  }

  .showcase-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.55rem;
    margin-top: 0.3rem;
  }

  .showcase-actions .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.82rem;
    padding: 0.65rem 1rem;
  }

  /* Gallery Toolbar & Touch-Scrollable Category Filter */
  .gallery-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
  }

  .category-filter-pills {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding: 0.3rem 0.4rem;
    gap: 0.4rem;
    width: 100%;
  }

  .category-filter-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
  }

  .gallery-layout-toggle {
    display: none;
  }
  
  /* Gallery Grid on Mobile */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .vault-card {
    border-radius: var(--radius-md);
  }

  .card-media-wrapper {
    height: 200px;
  }

  .card-content {
    padding: 1rem;
  }

  .card-title {
    font-size: 1.05rem;
  }

  .card-footer-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .card-btn-pill {
    padding: 0.4rem 0.75rem;
    font-size: 0.76rem;
  }

  /* Modals & Dialogs Mobile Friendly */
  .modal-backdrop {
    padding: 0.6rem;
  }

  .modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
    margin: auto;
    border-radius: var(--radius-lg);
    max-height: 94vh;
  }

  .modal-header {
    padding: 1.1rem 1.2rem;
  }

  .modal-body {
    padding: 1.2rem;
  }

  .modal-footer {
    padding: 1rem 1.2rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
  
  .category-picker-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .id-dual-upload-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .id-side-dropzone {
    height: 140px;
  }

  /* Lightbox Mobile Adjustments */
  .lightbox-modal .modal-dialog {
    max-height: 94vh;
    height: auto;
    overflow-y: auto;
  }

  .lightbox-body {
    flex-direction: column;
    height: auto;
    overflow-y: auto;
  }

  .lightbox-viewer-stage {
    min-height: 210px;
    padding: 0.85rem;
  }

  .lightbox-id-flip-container {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 85.6 / 54;
  }

  .lightbox-details-panel {
    padding: 1.15rem 1rem;
    max-width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
  .user-name-label {
    display: none;
  }

  /* Hide long text on secondary buttons, showing sleek touch icon */
  #authLogoutBtn span:last-child,
  #openCloudinaryBtn span:last-child,
  #syncVaultBtn span:last-child {
    display: none;
  }

  #authLogoutBtn,
  #openCloudinaryBtn,
  #syncVaultBtn {
    padding: 0.45rem 0.65rem;
    font-size: 0.95rem;
  }

  #openUploadBtn {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  .auth-title {
    font-size: 1.35rem;
  }

  .auth-shield-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    margin-bottom: 0.85rem;
  }
}

/* ==========================================================================
   PROGRESS BAR & CLOUDINARY STYLES
   ========================================================================== */
.progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #10b981);
  border-radius: 999px;
  transition: width 0.25s ease;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.cloudinary-guide-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   AUTHENTICATION LOCK SCREEN GATEWAY
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 20%, rgba(14, 165, 233, 0.18) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
              #050811;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.auth-overlay.active {
  opacity: 1;
  visibility: visible;
}

.auth-overlay.unlocking {
  opacity: 0;
  transform: scale(1.04);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.auth-card {
  background: rgba(15, 22, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(6, 182, 212, 0.15);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #06b6d4, #6366f1, #10b981);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-shield-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.35);
  margin-bottom: 1.1rem;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.auth-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: #cbd5e1;
}

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

.auth-field-icon {
  position: absolute;
  left: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  transition: var(--transition-fast);
  outline: none;
}

.auth-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.auth-input::placeholder {
  color: var(--text-dim);
  font-size: 0.88rem;
}

.auth-toggle-pwd {
  position: absolute;
  right: 0.85rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.95rem;
  transition: color 0.18s;
}

.auth-toggle-pwd:hover {
  color: #ffffff;
}

.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.auth-remember-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-remember-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
}

.auth-submit-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.98rem;
  border-radius: var(--radius-md);
  margin-top: 0.4rem;
}

.auth-error-banner {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  color: #fda4af;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.6rem;
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Shake Animation for Incorrect Login */
.shake {
  animation: shakeCard 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeCard {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Cloud Sync Spinning Animation */
@keyframes spinClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning {
  display: inline-block;
  animation: spinClockwise 0.85s linear infinite;
}


