/* ===== LOGIN ===== */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header .logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.login-header h1 {
  font-size: 1.5rem;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 12px;
  text-align: center;
}

/* ===== ADMIN HEADER ===== */
.admin-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.admin-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header .logo h1 {
  font-size: 1.2rem;
}

.admin-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ===== ADMIN MAIN ===== */
.admin-main {
  padding: 30px 20px;
}

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

.dashboard-header h2 {
  font-size: 1.4rem;
}

/* ===== EPISODES TABLE ===== */
.episodes-table-container {
  overflow-x: auto;
}

.episodes-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.episodes-table th,
.episodes-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.episodes-table th {
  background: var(--surface-light);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.episodes-table td {
  font-size: 0.9rem;
}

.episodes-table tr:hover td {
  background: var(--surface-light);
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-published {
  background: rgba(46, 213, 115, 0.15);
  color: var(--success);
}

.status-draft {
  background: rgba(136, 136, 160, 0.15);
  color: var(--text-secondary);
}

.spotify-status {
  font-size: 0.8rem;
}

.spotify-yes {
  color: var(--spotify);
}

.spotify-no {
  color: var(--text-secondary);
}

.actions-cell {
  display: flex;
  gap: 8px;
}

.empty-msg {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* ===== UPLOAD FORM ===== */
.upload-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.file-upload-zone {
  background: var(--surface-light);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s;
}

.file-upload-zone:hover {
  border-color: var(--primary);
}

.file-upload-zone.has-file {
  border-color: var(--success);
  border-style: solid;
}

.file-upload-zone label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.file-upload-zone input[type="file"] {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.file-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ===== UPLOAD PROGRESS ===== */
.upload-progress {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s;
}

.progress-status {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== EDIT FORM ===== */
.edit-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
  max-width: 350px;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== HELP BUTTON ===== */
.btn-help {
  background: var(--primary);
  color: #fff;
  border: none;
  font-weight: 700;
}

.btn-help:hover {
  background: var(--primary-light);
  color: #fff;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h2 {
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 24px;
  line-height: 1.7;
}

.modal-body h3 {
  font-size: 1.05rem;
  margin: 24px 0 10px;
  color: var(--primary-light);
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body p {
  margin-bottom: 12px;
  color: var(--text);
}

.modal-body ol,
.modal-body ul {
  margin: 0 0 12px 20px;
}

.modal-body li {
  margin-bottom: 6px;
}

.modal-body ul ul {
  margin-top: 6px;
}

.modal-body a {
  color: var(--primary-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .admin-header .container {
    flex-direction: column;
    gap: 10px;
  }

  .admin-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .file-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .actions-cell {
    flex-direction: column;
  }
}
