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

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  /* Colors */
  --bg-gradient: linear-gradient(135deg, #090615 0%, #130a24 50%, #060b1e 100%);
  --card-bg: rgba(18, 12, 38, 0.6);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-border-focus: rgba(139, 92, 246, 0.4);
  
  --primary: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.35);
  --primary-hover: #a78bfa;
  
  --secondary: #06b6d4;
  --secondary-glow: rgba(6, 182, 212, 0.3);
  --secondary-hover: #22d3ee;
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #6b7280;
  
  --glow-box: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glow-button: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  position: relative;
}

/* Background elements for depth */
body::before, body::after {
  content: "";
  position: fixed;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.25;
}

body::before {
  top: -10%;
  left: -10%;
  background: var(--primary);
}

body::after {
  bottom: -10%;
  right: -10%;
  background: var(--secondary);
}

/* App Wrapper */
.app-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2.5rem;
}

header h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.8rem;
  background: linear-gradient(to right, #ffffff, #c084fc, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
}

/* Glassmorphism Card Base */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--glow-box);
  transition: transform 0.3s ease, border-color 0.3s ease;
  width: 100%;
  margin-bottom: 2rem;
}

/* Forms & Step Transitions */
.step-container {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.step-container.hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* Step 1: User Login Card */
.auth-card {
  max-width: 480px;
  margin: 3rem auto;
  text-align: center;
}

.auth-card h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #fff;
}

.input-group {
  position: relative;
  margin-bottom: 2rem;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  font-weight: 500;
}

.input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 1.05rem;
  transition: all 0.3s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
  background: rgba(0, 0, 0, 0.35);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--glow-button);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.6);
  background: linear-gradient(90deg, var(--primary-hover), var(--primary));
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  background: var(--text-dark);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(90deg, #dc2626, #b91c1c);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
}

/* Step 2: Upload Area */
.session-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.session-info h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.1rem;
}

.session-info span.folder-badge {
  background: rgba(6, 182, 212, 0.15);
  color: var(--secondary-hover);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-family: monospace;
  font-size: 1rem;
  font-weight: 600;
}

/* Drag and Drop Zone */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.15);
  margin-bottom: 2rem;
  position: relative;
}

.drop-zone.dragover {
  border-color: var(--secondary);
  background: rgba(6, 182, 212, 0.06);
  transform: scale(1.01);
  box-shadow: 0 0 25px var(--secondary-glow);
}

.drop-zone-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  font-size: 2.2rem;
  transition: all 0.3s ease;
}

.drop-zone.dragover .drop-zone-icon {
  color: var(--secondary-hover);
  background: rgba(6, 182, 212, 0.15);
  transform: translateY(-4px);
}

.drop-zone h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.drop-zone p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.drop-zone-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Hidden File Inputs */
.file-inputs-hidden {
  display: none !important;
}

/* Dashboard / Summary Stats */
.upload-dashboard {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

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

.dashboard-header h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.dashboard-controls {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 8px;
}

/* Progress bar container */
.progress-container {
  margin-bottom: 1.5rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 10px;
  transition: width 0.3s ease;
  position: relative;
  box-shadow: 0 0 10px var(--secondary-glow);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  text-align: center;
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.stat-card .value {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.2rem;
  color: #fff;
}

/* File list & Search */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.list-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
}

.search-bar {
  flex-grow: 1;
  max-width: 300px;
  position: relative;
}

.search-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: #fff;
  font-size: 0.9rem;
}

.search-field:focus {
  outline: none;
  border-color: var(--secondary);
}

/* Files scrollable panel */
.files-panel {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  margin-bottom: 1.5rem;
}

.files-list {
  list-style: none;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  gap: 1rem;
  transition: background 0.2s ease;
}

.file-item:last-child {
  border-bottom: none;
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0; /* allows text truncation */
  flex-grow: 1;
}

.file-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.file-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.file-name {
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-path {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-status-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.file-size {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  width: 70px;
}

.status-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-pending {
  background: rgba(156, 163, 175, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.status-uploading {
  background: rgba(6, 182, 212, 0.15);
  color: var(--secondary-hover);
  border: 1px solid rgba(6, 182, 212, 0.3);
  animation: pulse 1.5s infinite;
}

.status-done {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* File list pagination or limit notice */
.list-notice {
  text-align: center;
  padding: 0.85rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Photos Gallery Preview */
.gallery-section {
  margin-top: 2rem;
}

.gallery-section h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.15);
}

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: fadeIn 0.4s forwards;
}

.gallery-item .overlay-done {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: bold;
}

/* Animations */
@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Scrollbar design */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Footer styling */
footer {
  margin-top: auto;
  text-align: center;
  padding: 2rem 0 1rem;
  color: var(--text-dark);
  font-size: 0.85rem;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--secondary-hover);
}

/* Responsive adjustements */
@media (max-width: 600px) {
  header h1 {
    font-size: 2.2rem;
  }
  
  .glass-card {
    padding: 1.5rem;
  }
  
  .drop-zone {
    padding: 2rem 1rem;
  }
  
  .session-info {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- ADMIN PANEL SPECIFIC STYLES --- */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  width: 100%;
}

.folder-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
}

.folder-card:hover {
  transform: translateY(-4px);
  border-color: var(--secondary);
  background: rgba(6, 182, 212, 0.04);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.15);
}

.folder-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.folder-card-icon {
  font-size: 2.2rem;
  color: var(--secondary-hover);
}

.folder-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.folder-card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.2rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-card-date {
  font-size: 0.75rem;
  color: var(--text-dark);
  margin-top: 0.15rem;
}

.folder-card-stats {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.folder-card-stats span strong {
  color: #fff;
}

.folder-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.folder-card-actions .btn {
  flex: 1;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  border-radius: 8px;
}

/* Admin Detail / Files Grid view */
.admin-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  width: 100%;
}

.admin-gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #000;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-gallery-item:hover {
  transform: scale(1.04);
  border-color: var(--primary);
  box-shadow: 0 4px 20px var(--primary-glow);
}

.admin-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.admin-gallery-item:hover img {
  opacity: 0.9;
}

.admin-gallery-nonimg {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.admin-gallery-nonimg .icon {
  font-size: 2rem;
}

.admin-gallery-nonimg .name {
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
  line-height: 1.2;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  object-fit: contain;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 25px;
  right: 25px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

.lightbox-caption {
  position: absolute;
  bottom: 25px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  font-size: 0.9rem;
  max-width: 80%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
