/* ==============================================================================
   CdnXyz9 — Light Mode Admin Dashboard & Image Management Styles
   ============================================================================== */

/* 1. Header & Navigation */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.8rem 0;
  width: 100%;
  box-sizing: border-box;
}

.dash-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  flex-wrap: nowrap;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
}

.dash-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.dash-brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.dash-brand-tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: #7c3aed;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.dash-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.session-inactivity-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  white-space: nowrap;
}

.inactivity-label-short {
  display: none;
}

/* Header Mobile Breakpoints */
@media (max-width: 640px) {
  .dash-header {
    padding: 0.6rem 0;
  }
  .dash-brand {
    gap: 0.45rem;
  }
  .dash-logo-icon {
    width: 30px;
    height: 30px;
  }
  .dash-logo-icon svg {
    width: 20px;
    height: 20px;
  }
  .dash-brand-name {
    font-size: 1.1rem;
  }
  .dash-brand-tag {
    display: none; /* Hide admin console pill on small phones to give space */
  }
  .dash-nav-actions {
    gap: 0.35rem;
  }
  .session-inactivity-pill {
    padding: 0.3rem 0.55rem;
    font-size: 0.7rem;
  }
  .inactivity-label-full {
    display: none;
  }
  .inactivity-label-short {
    display: inline;
  }
  .hide-mobile-text {
    display: none !important;
  }
  .dash-nav-actions .btn-sm {
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 380px) {
  .session-inactivity-pill {
    display: none; /* Hide inactivity pill on ultra narrow screens < 380px */
  }
}

/* 2. Dashboard Layout & Content */
.dash-main {
  padding: 2.5rem 0 5rem;
}

/* Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  position: relative;
  overflow: hidden;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
}

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

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

.stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}

/* 3. Upload Tabs & Section */
.upload-section {
  margin-bottom: 3.5rem;
  background: #ffffff;
}

.tab-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: #f8fafc;
}

.tab-btn.active {
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

/* Drag & Drop Zone */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-xl);
  padding: 3.5rem 2rem;
  text-align: center;
  background: #fafcff;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.03);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.08);
  transform: translateY(-2px);
}

.dropzone.dragover {
  border-color: var(--accent-pink);
  background: rgba(225, 29, 72, 0.04);
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-purple);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.dropzone-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.dropzone-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.dropzone-paste-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 500;
}

/* Staging / Preview Area */
/* Staging / Preview Area */
.upload-staging-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
  width: 100%;
}

.staging-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.staging-meta-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.staging-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.staging-file-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.staging-file-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.staging-file-details {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Upload Fields Grid */
.upload-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .upload-section {
    padding: 1.25rem;
    margin-bottom: 2.5rem;
  }
  .upload-fields-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .upload-staging-card {
    padding: 1.15rem;
    gap: 1rem;
  }
  .staging-thumb {
    width: 52px;
    height: 52px;
  }
  .staging-file-name {
    font-size: 0.875rem;
  }
  .staging-file-details {
    font-size: 0.75rem;
  }
  .dropzone {
    padding: 2.25rem 1rem;
  }
  .dropzone-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 0.75rem;
  }
  .dropzone-icon svg {
    width: 24px;
    height: 24px;
  }
  .dropzone-title {
    font-size: 1.05rem;
  }
  .dropzone-subtitle {
    font-size: 0.8rem;
    margin-bottom: 0.85rem;
  }
  .tab-btn {
    padding: 0.55rem 0.65rem;
    font-size: 0.8rem;
    flex: 1;
    justify-content: center;
    text-align: center;
  }
  .tab-btn svg {
    width: 14px;
    height: 14px;
  }
  #upload-submit-btn,
  #url-upload-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Upload Progress Bar */
.upload-progress-wrap {
  margin-top: 1rem;
}

.progress-bar-bg {
  height: 8px;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--grad-brand);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: progress-shimmer 1.5s infinite;
}

@keyframes progress-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  font-family: var(--font-mono);
}

/* 4. Image Gallery / Management Grid */
.gallery-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.gallery-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.image-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
}

.image-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.09);
}

.image-card-thumb-wrap {
  width: 100%;
  height: 175px;
  background: #f8fafc;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}

.image-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.image-card:hover .image-card-thumb {
  transform: scale(1.04);
}

.image-card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
}

.image-card-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.image-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-card-slug-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-purple);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  font-weight: 600;
}
.image-card-slug-link:hover {
  color: var(--accent-pink);
  text-decoration: underline;
}

.image-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.image-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

/* Empty Gallery State */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: #ffffff;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-xl);
}

.gallery-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  color: var(--text-muted);
}
