/* Admin Dashboard Styles */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #121829;
  --bg-tertiary: #1a2238;
  --text-primary: #e0e6f0;
  --text-secondary: #a0aec0;
  --accent-primary: #00ffaa;
  --accent-secondary: #7b68ee;
  --border-color: #2a3555;
  --success: #00ff88;
  --warning: #ffaa00;
  --danger: #ff4466;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

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

.login-box {
  background: var(--bg-secondary);
  padding: 40px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(0, 255, 170, 0.1);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  color: var(--accent-primary);
  text-align: center;
  margin-bottom: 30px;
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-box input {
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 16px;
}

.login-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
}

.login-box button {
  padding: 12px;
  background: var(--accent-primary);
  border: none;
  border-radius: 8px;
  color: var(--bg-primary);
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.login-box button:hover {
  box-shadow: 0 0 15px rgba(0, 255, 170, 0.5);
  transform: translateY(-2px);
}

.error {
  color: var(--danger);
  font-size: 14px;
  text-align: center;
}

/* Dashboard */
.dashboard {
  min-height: 100vh;
  background: var(--bg-primary);
}

.admin-header {
  background: var(--bg-secondary);
  padding: 20px 30px;
  border-bottom: 2px solid var(--accent-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  color: var(--accent-primary);
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  box-shadow: 0 0 15px rgba(0, 255, 170, 0.5);
}

.btn-secondary {
  background: var(--accent-secondary);
  color: white;
}

.btn-secondary:hover {
  box-shadow: 0 0 15px rgba(123, 104, 238, 0.5);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
}

/* Admin Layout */
.admin-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 30px;
}

/* Panels */
.panel {
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  max-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
}

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

.panel-header h2 {
  color: var(--accent-primary);
  font-size: 1.2rem;
}

.panel-header select {
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
}

/* Pages List */
.pages-list {
  overflow-y: auto;
  flex: 1;
}

.page-item {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.page-item:hover {
  background: var(--bg-tertiary);
}

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

.page-info {
  flex: 1;
}

.page-info h3 {
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 5px;
}

.page-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  gap: 15px;
}

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

.page-status.published {
  background: rgba(0, 255, 136, 0.2);
  color: var(--success);
}

.page-status.draft {
  background: rgba(255, 170, 0, 0.2);
  color: var(--warning);
}

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

.page-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-edit {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.btn-delete {
  background: var(--danger);
  color: white;
}

.btn-toggle {
  background: var(--accent-secondary);
  color: white;
}

/* Media List */
.media-list {
  overflow-y: auto;
  flex: 1;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

.media-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.media-item:hover {
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.media-item-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  padding: 5px;
  display: flex;
  justify-content: center;
}

.media-item-actions button {
  padding: 4px 8px;
  background: var(--danger);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 0.75rem;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

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

.modal-header h2 {
  color: var(--accent-primary);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
}

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

.modal-body {
  padding: 20px;
}

/* Checkbox List */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.checkbox-list label:hover {
  background: var(--bg-tertiary);
}

.checkbox-list input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Progress */
.progress {
  margin-top: 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--accent-primary);
  animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

#scrapeStatus {
  text-align: center;
  margin-top: 10px;
  color: var(--text-secondary);
}

/* File Input */
#fileInput {
  width: 100%;
  padding: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .panel {
    max-height: none;
  }

  .admin-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}
