/* ================================================================
   REI SAMPLE — Admin CMS Styles
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: #0d0d1e; color: #e0e0e0; min-height: 100vh; }

/* ─── Login ─── */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; position: relative; background: #0a0a12;
}
.login-particles {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.login-card {
  position: relative; z-index: 2;
  background: rgba(22,33,62,0.6); border: 1px solid rgba(0,212,255,0.1);
  border-radius: 16px; padding: 3rem 2.5rem; width: 340px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  text-align: center;
}
.login-title {
  font-family: 'Inter', sans-serif; font-weight: 300;
  font-size: 1.4rem; letter-spacing: 0.4em; margin-bottom: 0.3rem;
}
.login-subtitle {
  font-size: 0.7rem; letter-spacing: 0.2em; color: #888;
  margin-bottom: 2rem; text-transform: uppercase;
}
.login-field { margin-bottom: 1rem; }
.login-input {
  width: 100%; padding: 0.9rem 1rem; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; background: rgba(255,255,255,0.04);
  color: #e0e0e0; font-size: 0.9rem; font-family: 'Inter', sans-serif;
  outline: none; transition: border-color 0.3s ease;
}
.login-input:focus { border-color: #00d4ff; }
.login-error { color: #ff4060; font-size: 0.75rem; min-height: 1.2em; margin-bottom: 0.5rem; }
.login-btn {
  width: 100%; padding: 0.9rem; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #00d4ff, #0088cc);
  color: #fff; font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.15em; cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
  min-height: 48px;
}
.login-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.login-btn:active { transform: scale(0.98); }

/* ─── Admin Panel ─── */
.admin-panel { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: 240px; background: #0f1129; border-right: 1px solid rgba(255,255,255,0.05);
  display: flex; flex-direction: column; padding: 1.5rem 0;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
}
.sidebar-header { padding: 0 1.5rem; margin-bottom: 2rem; }
.sidebar-title { font-size: 0.9rem; font-weight: 300; letter-spacing: 0.3em; }
.sidebar-badge {
  display: inline-block; margin-left: 0.5rem; padding: 2px 8px;
  font-size: 0.6rem; letter-spacing: 0.1em;
  background: rgba(0,212,255,0.15); color: #00d4ff;
  border-radius: 4px;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.8rem 1.5rem; color: #888; text-decoration: none;
  font-size: 0.85rem; transition: all 0.3s ease;
  border: none; background: none; cursor: pointer; text-align: left;
  font-family: 'Inter', sans-serif; min-height: 48px; width: 100%;
}
.sidebar-link:hover, .sidebar-link.active { color: #e0e0e0; background: rgba(255,255,255,0.03); }
.sidebar-link.active { border-right: 2px solid #00d4ff; }
.sidebar-icon { font-size: 1.1rem; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 0.5rem; margin-top: auto; }
.logout-link:hover { color: #ff4060 !important; }

/* Main */
.admin-main { flex: 1; margin-left: 240px; padding: 2rem; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.section-title { font-weight: 300; font-size: 1.3rem; letter-spacing: 0.15em; margin-bottom: 1.5rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }

/* Upload area */
.upload-area {
  border: 2px dashed rgba(255,255,255,0.1); border-radius: 16px;
  padding: 4rem 2rem; text-align: center; cursor: pointer;
  transition: all 0.3s ease;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: #00d4ff; background: rgba(0,212,255,0.03);
}
.upload-icon { font-size: 3rem; margin-bottom: 1rem; }
.upload-text { font-size: 0.9rem; letter-spacing: 0.15em; color: #aaa; margin-bottom: 0.5rem; }
.upload-hint { font-size: 0.75rem; color: #666; }

/* Queue */
.upload-queue { margin-top: 1.5rem; }
.queue-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.queue-header h3 { font-weight: 400; font-size: 0.9rem; letter-spacing: 0.1em; }
.queue-actions { display: flex; gap: 0.5rem; }
.queue-list { display: flex; flex-direction: column; gap: 0.5rem; }
.queue-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.7rem 1rem; background: rgba(255,255,255,0.02);
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.05);
}
.queue-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.queue-info { flex: 1; min-width: 0; }
.queue-filename { font-size: 0.8rem; margin-bottom: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-progress-bar { height: 4px; background: rgba(255,255,255,0.05); border-radius: 2px; overflow: hidden; }
.queue-progress-fill { height: 100%; background: #00d4ff; border-radius: 2px; transition: width 0.3s ease; }
.queue-status { font-size: 0.7rem; letter-spacing: 0.1em; flex-shrink: 0; }
.queue-status.pending { color: #888; }
.queue-status.uploading { color: #00d4ff; }
.queue-status.done { color: #00e676; }
.queue-status.error { color: #ff4060; }

/* Queue title input */
.queue-title-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.3rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.queue-title-input:focus {
  border-color: #00d4ff;
  background: rgba(0,212,255,0.05);
}
.queue-title-input::placeholder { color: #555; }
.queue-filesize {
  font-size: 0.68rem;
  color: #555;
  margin-top: 0.15rem;
  letter-spacing: 0.05em;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem; border: none; border-radius: 6px;
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.1em;
  cursor: pointer; transition: all 0.3s ease; font-family: 'Inter', sans-serif;
}
.btn-primary { background: #00d4ff; color: #0a0a12; }
.btn-primary:hover { background: #00b8e6; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: #888; border: 1px solid rgba(255,255,255,0.1); }
.btn-ghost:hover { color: #e0e0e0; border-color: rgba(255,255,255,0.2); }
.btn-danger { background: #ff4060; color: #fff; }
.btn-danger:hover { background: #e63550; }

/* Manage grid */
.manage-loading { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 3rem; color: #888; }
.spinner {
  width: 32px; height: 32px; border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #00d4ff; border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.manage-empty { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 3rem; color: #888; }
.manage-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.manage-card {
  position: relative; border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05); background: rgba(255,255,255,0.02);
  transition: border-color 0.3s ease;
}
.manage-card:hover { border-color: rgba(0,212,255,0.2); }
.manage-card-img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.manage-card-overlay {
  position: absolute; inset: 0;
  background: rgba(10,10,18,0.7);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s ease;
}
.manage-card:hover .manage-card-overlay { opacity: 1; }
.delete-btn {
  padding: 0.5rem 1.2rem; border: 1px solid #ff4060; border-radius: 6px;
  background: transparent; color: #ff4060;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em;
  cursor: pointer; transition: all 0.3s ease;
}
.delete-btn:hover { background: #ff4060; color: #fff; }
.manage-card-meta { padding: 0.7rem; }
.manage-card-name { font-size: 0.75rem; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
}
.modal-card {
  background: #16213e; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 2rem; max-width: 380px; width: 90%; text-align: center;
}
.modal-card h3 { font-weight: 400; margin-bottom: 0.5rem; }
.modal-card p { font-size: 0.85rem; color: #888; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 0.8rem; justify-content: center; }

/* Toast */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 10000; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  padding: 0.8rem 1.2rem; border-radius: 8px;
  font-size: 0.8rem; color: #e0e0e0;
  background: #1a1a3e; border: 1px solid rgba(255,255,255,0.08);
  transform: translateX(120%); transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.toast.show { transform: translateX(0); }
.toast.success { border-left: 3px solid #00e676; }
.toast.error { border-left: 3px solid #ff4060; }
.toast.info { border-left: 3px solid #00d4ff; }

/* Mobile menu button */
.mobile-menu-btn {
  display: none; position: fixed; top: 1rem; left: 1rem; z-index: 60;
  width: 44px; height: 44px; background: rgba(15,17,41,0.9);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  cursor: pointer; flex-direction: column; gap: 5px;
  align-items: center; justify-content: center;
}
.mobile-menu-btn span { display: block; width: 20px; height: 2px; background: #e0e0e0; transition: all 0.3s ease; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%); transition: transform 0.3s ease;
    width: 260px;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; padding: 1rem; padding-top: 4rem; }
  .mobile-menu-btn { display: flex; }
  .manage-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .upload-area { padding: 2.5rem 1.5rem; }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
  .manage-card-overlay {
    opacity: 1; top: auto; bottom: 0; height: auto;
    background: linear-gradient(transparent, rgba(10,10,18,0.85));
    padding: 8px; align-items: flex-end; justify-content: flex-end;
  }
  .upload-text::after { content: ' (TAP TO SELECT)'; }
}
