/* ============================================
   DOGAWEB ADMIN PANEL - Premium Dark Theme
   ============================================ */

/* ---- Admin Layout ---- */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #0f1117;
  color: #e2e8f0;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ---- Sidebar ---- */
.admin-sidebar {
  width: 260px;
  background: linear-gradient(180deg, #131620 0%, #0d1017 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.admin-sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-sidebar-header img {
  height: 32px;
  width: auto;
  filter: brightness(200%);
}

.admin-sidebar-header span {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.admin-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
  text-decoration: none;
}

.admin-nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
}

.admin-nav-item.active {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.admin-nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.admin-nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 12px 0;
}

.admin-sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.admin-logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #ef4444;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
}

.admin-logout-btn:hover {
  background: rgba(239,68,68,0.1);
}

/* ---- Main Content ---- */
.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 0;
  min-height: 100vh;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(15,17,23,0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-topbar h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f1f5f9;
}

.admin-topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-content {
  padding: 32px;
}

/* ---- Stats Cards ---- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.admin-stat-card {
  background: linear-gradient(135deg, #1a1d2e 0%, #151827 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37,99,235,0.3);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.admin-stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.stat-icon.blue { background: rgba(37,99,235,0.15); color: #60a5fa; }
.stat-icon.green { background: rgba(34,197,94,0.15); color: #4ade80; }
.stat-icon.purple { background: rgba(168,85,247,0.15); color: #c084fc; }
.stat-icon.amber { background: rgba(245,158,11,0.15); color: #fbbf24; }
.stat-icon.rose { background: rgba(244,63,94,0.15); color: #fb7185; }
.stat-icon.cyan { background: rgba(6,182,212,0.15); color: #22d3ee; }

.admin-stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.admin-stat-card .stat-label {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

/* ---- Integration Panels ---- */
.admin-integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.admin-integration-card {
  background: linear-gradient(135deg, #1a1d2e 0%, #151827 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.admin-integration-card:hover {
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.admin-integration-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.15);
}

.admin-integration-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  display: flex;
  align-items: center;
}

.admin-integration-body {
  padding: 20px;
}

.admin-help-text {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 16px;
}

.admin-metric-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-metric-list li {
  font-size: 0.9rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-metric-list li i {
  color: #64748b;
  width: 16px;
  text-align: center;
}

.admin-adsense-preview {
  background: rgba(0,0,0,0.2);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.adsense-amount {
  font-size: 2rem;
  font-weight: 800;
  color: #4ade80;
  margin-bottom: 4px;
}

.adsense-label {
  font-size: 0.8rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-ideas-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.idea-item {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.idea-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e2e8f0;
}

.idea-meta {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Tables ---- */
.admin-table-wrapper {
  background: linear-gradient(135deg, #1a1d2e 0%, #151827 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
}

.admin-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.admin-table-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 12px 24px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.15);
}

.admin-table td {
  padding: 14px 24px;
  font-size: 0.9rem;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.admin-table tr:last-child td {
  border-bottom: none;
}

/* ---- Badges ---- */
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.admin-badge.green {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}

.admin-badge.yellow {
  background: rgba(245,158,11,0.15);
  color: #fbbf24;
}

.admin-badge.blue {
  background: rgba(37,99,235,0.15);
  color: #60a5fa;
}

.admin-badge.red {
  background: rgba(239,68,68,0.15);
  color: #f87171;
}

/* ---- Buttons ---- */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.admin-btn.primary {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.admin-btn.primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37,99,235,0.35);
}

.admin-btn.danger {
  background: rgba(239,68,68,0.12);
  color: #f87171;
}

.admin-btn.danger:hover {
  background: rgba(239,68,68,0.2);
}

.admin-btn.ghost {
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
}

.admin-btn.ghost:hover {
  background: rgba(255,255,255,0.1);
  color: #e2e8f0;
}

.admin-btn.sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.admin-btn-group {
  display: flex;
  gap: 6px;
}

/* ---- Forms ---- */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
}

.admin-form-group input,
.admin-form-group textarea,
.admin-form-group select {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.admin-form-group textarea {
  min-height: 200px;
  resize: vertical;
}

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

.admin-form-group select option {
  background: #1a1d2e;
  color: #e2e8f0;
}

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

.admin-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.admin-form-actions {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ---- Modal ---- */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal {
  background: #1a1d2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.admin-modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f1f5f9;
}

.admin-modal-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.admin-modal-close:hover {
  color: #e2e8f0;
}

.admin-modal-body {
  padding: 24px;
}

/* ---- Login Page ---- */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f1117 0%, #131620 50%, #0d1017 100%);
  padding: 20px;
}

.admin-login-card {
  background: linear-gradient(135deg, #1a1d2e 0%, #151827 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}

.admin-login-card .login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.admin-login-card .login-logo img {
  height: 40px;
  margin: 0 auto 16px;
  filter: brightness(200%);
}

.admin-login-card .login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.admin-login-card .login-logo p {
  font-size: 0.9rem;
  color: #64748b;
}

.admin-login-card .login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 8px;
  padding: 10px 14px;
  color: #f87171;
  font-size: 0.85rem;
  margin-bottom: 16px;
  text-align: center;
}

.admin-login-card .login-input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 14px 16px;
  color: #e2e8f0;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.admin-login-card .login-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.admin-login-card .login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(37,99,235,0.3);
}

.admin-login-card .login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}

.admin-login-card .login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---- Search & Filter Bar ---- */
.admin-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-search-input {
  flex: 1;
  min-width: 200px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 14px;
  color: #e2e8f0;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.admin-search-input:focus {
  border-color: #2563eb;
}

.admin-filter-select {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 14px;
  color: #e2e8f0;
  font-size: 0.85rem;
  outline: none;
}

/* ---- Pagination ---- */
.admin-pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.admin-pagination button {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-pagination button:hover:not(:disabled) {
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
}

.admin-pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.admin-pagination span {
  font-size: 0.85rem;
  color: #64748b;
}

/* ---- Toast Notification ---- */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 300;
  animation: toastSlideIn 0.3s ease, toastFadeOut 0.3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-toast.success {
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
}

.admin-toast.error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}

@keyframes toastSlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toastFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ---- Empty State ---- */
.admin-empty {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}

.admin-empty i {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.admin-empty p {
  font-size: 1rem;
  margin-bottom: 16px;
}

/* ---- Loading ---- */
.admin-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #64748b;
}

.admin-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: adminSpin 0.6s linear infinite;
}

@keyframes adminSpin {
  to { transform: rotate(360deg); }
}

/* ---- Mobile Responsive ---- */
.admin-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #e2e8f0;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
    width: 100%;
    overflow-x: hidden;
  }

  .admin-mobile-toggle {
    display: block;
  }

  .admin-content {
    padding: 20px 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .admin-topbar {
    padding: 12px 16px;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .admin-integration-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .admin-stat-card {
    padding: 16px;
  }

  .admin-stat-card .stat-value {
    font-size: 1.5rem;
  }

  .admin-table-wrapper {
    overflow-x: auto;
    width: 100%;
  }

  .admin-form-row {
    grid-template-columns: 1fr;
  }

  .admin-modal {
    max-width: 100%;
    margin: 10px;
    max-height: 90vh;
  }
}

/* ---- Hide site header/footer in admin ---- */
.admin-page-active .site-header,
.admin-page-active .main-footer,
.admin-page-active .whatsapp-widget {
  display: none !important;
}
