/* admin.css - Styling for the Administration Dashboard */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --admin-bg: #0d1117;
  --admin-card: #161b22;
  --admin-border: #30363d;
  --admin-primary: #58a6ff;
  --admin-primary-hover: #1f6feb;
  --admin-text-main: #c9d1d9;
  --admin-text-muted: #8b949e;
  --admin-accent: #238636; /* green */
}

body.admin-body {
  font-family: 'Inter', sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  padding: 40px 20px;
  line-height: 1.5;
}

.admin-container {
  max-width: 1100px;
  margin: 0 auto;
}

header.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

header.admin-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

.view-live-btn {
  background: var(--admin-primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.view-live-btn:hover {
  background: var(--admin-primary-hover);
}

.admin-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 30px;
}

@media(max-width: 768px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar navigation */
.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--admin-text-muted);
  padding: 12px 16px;
  text-align: left;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-tab.active {
  background: rgba(88, 166, 255, 0.15);
  color: var(--admin-primary);
  border-left: 3px solid var(--admin-primary);
}

/* Content cards */
.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 30px;
  display: none;
}

.admin-card.active {
  display: block;
}

.admin-card h2 {
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 10px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}

.form-control {
  width: 100%;
  background: #0d1117;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--admin-text-main);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
}

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

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

@media(max-width: 576px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Custom checkbox / switches */
.switch-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0d1117;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  margin-bottom: 15px;
}

.switch-label {
  display: flex;
  flex-direction: column;
}

.switch-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.switch-desc {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
}

.switch-input {
  position: relative;
  width: 44px;
  height: 22px;
  -webkit-appearance: none;
  background: #30363d;
  outline: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.3s;
}

.switch-input:checked {
  background: var(--admin-accent);
}

.switch-input::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  background: #fff;
  transition: transform 0.3s;
}

.switch-input:checked::before {
  transform: translateX(22px);
}

/* File Upload drag area */
.upload-zone {
  border: 2px dashed var(--admin-border);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  background: #0d1117;
  transition: border-color 0.3s, background 0.3s;
}

.upload-zone:hover {
  border-color: var(--admin-primary);
  background: rgba(88, 166, 255, 0.02);
}

.upload-zone svg {
  width: 40px;
  height: 40px;
  color: var(--admin-text-muted);
  margin-bottom: 10px;
}

.upload-zone p {
  font-size: 0.9rem;
  color: var(--admin-text-muted);
}

.upload-zone span {
  color: var(--admin-primary);
  font-weight: 500;
}

/* Playlist table */
.playlist-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.playlist-table th, .playlist-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}

.playlist-table th {
  color: var(--admin-text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.playlist-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.badge-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-mp3 { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.badge-spotify { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

.action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--admin-text-muted);
  padding: 4px;
  border-radius: 4px;
  transition: all 0.3s;
}

.action-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.action-btn.delete-btn:hover {
  color: #f85149;
  background: rgba(248, 81, 73, 0.1);
}

.action-btn.select-btn.active {
  color: var(--admin-accent);
}

/* Button variants */
.btn-save {
  background: var(--admin-accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  width: 100%;
  margin-top: 10px;
}

.btn-save:hover {
  background: #2ea043;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.theme-radio {
  display: none;
}

.theme-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.theme-radio:checked + .theme-label {
  border-color: var(--admin-primary);
  background: rgba(88, 166, 255, 0.1);
}

.theme-color-preview {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-bottom: 8px;
}
.color-gold { background: #d4af37; }
.color-rose { background: #b76e79; }
.color-emerald { background: #071912; border: 1px solid #d4af37; }
.color-navy { background: #0b132b; border: 1px solid #c0c0c0; }

.theme-name {
  font-size: 0.8rem;
  font-weight: 600;
}
.toast-msg {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--admin-accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
}
.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}

/* Image File Picker & Preview styling */
.file-select-container {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-top: 5px;
}

.btn-file-select {
  background: #30363d;
  color: var(--admin-text-main);
  border: 1px solid var(--admin-border);
  padding: 10px 15px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.3s;
}

.btn-file-select:hover {
  background: #444c56;
}

.img-preview-box {
  width: 50px;
  height: 50px;
  border: 1px solid var(--admin-border);
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: #0d1117;
  flex-shrink: 0;
}

.img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Link Generator Styling */
.generated-link-card {
  background: #0d1117;
  border: 1px solid var(--admin-border);
  padding: 15px;
  border-radius: 6px;
  margin-top: 15px;
  display: none;
}

.generated-link-card.active {
  display: block;
}

.copy-link-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

