/* ===== ADMIN PANEL OVERLAY ===== */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.admin-overlay.active {
  display: flex;
  opacity: 1;
}

.admin-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Admin Header */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(20,20,20,0.95);
  border-bottom: 1px solid rgba(227,25,55,0.3);
  flex-shrink: 0;
}
.admin-header h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-header h2 span {
  color: var(--red-light);
}
.admin-close {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.admin-close:hover {
  background: var(--red-primary);
  border-color: var(--red-primary);
}

/* Admin Body */
.admin-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Admin Sidebar */
.admin-sidebar {
  width: 200px;
  background: rgba(10,10,10,0.98);
  border-right: 1px solid rgba(255,255,255,0.05);
  padding: 12px 0;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--white-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.admin-nav-item:hover {
  background: rgba(255,255,255,0.03);
  color: white;
}
.admin-nav-item.active {
  background: rgba(227,25,55,0.1);
  color: var(--red-light);
  border-left-color: var(--red-primary);
}
.admin-nav-item .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  opacity: 0.7;
}
.admin-nav-item.active .nav-icon {
  opacity: 1;
}

/* Admin Content */
.admin-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}
.admin-content::-webkit-scrollbar { width: 6px; }
.admin-content::-webkit-scrollbar-thumb { background: rgba(227,25,55,0.3); border-radius: 3px; }

/* Admin Sections (Tab Content) */
.admin-tab {
  display: none;
}
.admin-tab.active {
  display: block;
  animation: fadeInUp 0.3s ease;
}
.admin-tab h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 6px;
}
.admin-tab .tab-desc {
  color: var(--white-dim);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: white;
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(227,25,55,0.15);
}
.form-group textarea {
  min-height: 100px;
  resize: vertical;
}
.form-group select option {
  background: #1a1a1a;
  color: white;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Buttons */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}
.btn-save {
  background: var(--gradient-red);
  color: white;
}
.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--red-glow);
}
.btn-add {
  background: rgba(255,255,255,0.08);
  color: white;
  border: 1px dashed rgba(255,255,255,0.2);
}
.btn-add:hover {
  border-color: var(--red-primary);
  background: rgba(227,25,55,0.08);
}
.btn-delete {
  background: rgba(220,38,38,0.15);
  color: #f87171;
  padding: 6px 12px;
  font-size: 0.8rem;
}
.btn-delete:hover {
  background: rgba(220,38,38,0.3);
}
.btn-edit {
  background: rgba(255,255,255,0.08);
  color: white;
  padding: 6px 12px;
  font-size: 0.8rem;
}
.btn-edit:hover {
  background: rgba(255,255,255,0.15);
}

/* Card Editor Items */
.editor-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 12px;
  transition: var(--transition);
}
.editor-card:hover {
  border-color: rgba(227,25,55,0.2);
}
.editor-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.editor-card-header h4 {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.editor-card-actions {
  display: flex;
  gap: 8px;
}

/* Media Upload Area */
.upload-area {
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.upload-area:hover {
  border-color: var(--red-primary);
  background: rgba(227,25,55,0.05);
}
.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-area .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.upload-area p {
  color: var(--white-muted);
  font-size: 0.9rem;
}
.upload-area .upload-hint {
  color: var(--white-dim);
  font-size: 0.75rem;
  margin-top: 6px;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.media-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  aspect-ratio: 1;
  cursor: pointer;
  transition: var(--transition);
}
.media-item:hover {
  border-color: var(--red-primary);
  transform: scale(1.03);
}
.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.8));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 8px;
  opacity: 0;
  transition: var(--transition);
}
.media-item:hover .media-item-overlay {
  opacity: 1;
}
.media-item-name {
  color: white;
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.media-delete {
  background: rgba(220,38,38,0.8);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toast Notification */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  background: rgba(20,20,20,0.95);
  border: 1px solid rgba(227,25,55,0.3);
  border-radius: 12px;
  padding: 14px 24px;
  color: white;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}
.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}
.admin-toast.success { border-color: #22c55e; }
.admin-toast.error { border-color: #ef4444; }

/* Image Preview */
.img-preview {
  max-width: 200px;
  max-height: 120px;
  border-radius: 10px;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Sample Video Card */
.sample-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.sample-card .sample-preview {
  width: 100%;
  max-height: 200px;
  border-radius: 10px;
  margin-bottom: 12px;
  object-fit: cover;
}

/* Logo click indicator */
.logo-click-indicator {
  position: fixed;
  top: 70px;
  left: 24px;
  z-index: 10001;
  background: rgba(227,25,55,0.9);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.logo-click-indicator.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Admin */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 56px;
    padding: 8px 0;
  }
  .admin-nav-item {
    padding: 12px;
    justify-content: center;
  }
  .admin-nav-item .nav-label {
    display: none;
  }
  .admin-content {
    padding: 16px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* Login Screen Styles */
.admin-login-screen {
  position: absolute;
  inset: 0;
  background: var(--admin-bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  width: 100%;
}
.login-box h3 { margin-bottom: 10px; font-size: 1.5rem; }
.login-box p { color: var(--white-dim); margin-bottom: 25px; font-size: 0.9rem; }
.login-box input {
  width: 100%;
  padding: 14px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: white;
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.1rem;
}
.login-box input:focus { border-color: var(--primary-red); outline: none; }

/* Settings Specific Styles */
.settings-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}
.settings-section h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red-light);
}
.settings-upload-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: center;
  background: rgba(0,0,0,0.2);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.settings-upload-row .img-preview {
  margin-top: 0;
  width: 100px;
  height: 100px;
  object-fit: contain;
  background: #000;
}
