/**
 * Unified Admin Panel Styles
 * Anthony West Holdings Incorporated
 *
 * This CSS provides consistent admin panel styling across all pages.
 * Include this file on any page that needs admin functionality.
 */

/* Settings Cog Button */
.admin-settings-cog {
  position: fixed;
  top: 20px;
  right: 80px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: none; /* Hidden by default, shown via JS for admins */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s ease;
}

.admin-settings-cog.visible {
  display: flex;
}

.admin-settings-cog:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: rotate(45deg);
}

.admin-settings-cog svg {
  width: 20px;
  height: 20px;
  fill: rgba(255, 255, 255, 0.6);
  transition: fill 0.3s ease;
}

.admin-settings-cog:hover svg {
  fill: rgba(255, 255, 255, 0.9);
}

/* Admin Panel Overlay */
.admin-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.admin-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Admin Panel */
.admin-panel {
  position: fixed;
  top: 0;
  right: -550px;
  width: 550px;
  max-width: 100vw;
  height: 100vh;
  background: rgba(15, 15, 15, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 3000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-panel.open {
  right: 0;
}

/* Admin Header */
.admin-header {
  padding: 25px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.admin-header h2 {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
}

.admin-close {
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.admin-close::before,
.admin-close::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: rgba(255, 255, 255, 0.6);
  transition: background 0.3s ease;
}

.admin-close::before {
  transform: rotate(45deg);
}

.admin-close::after {
  transform: rotate(-45deg);
}

.admin-close:hover::before,
.admin-close:hover::after {
  background: #ffffff;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.admin-tab {
  flex: 1;
  padding: 15px 20px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.admin-tab:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.02);
}

.admin-tab.active {
  color: #ffffff;
}

.admin-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(100, 150, 255, 0.8);
}

/* Admin Content */
.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 25px 30px;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

/* Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.admin-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.admin-stat-value {
  font-size: 2rem;
  font-weight: 300;
  color: #ffffff;
  margin-bottom: 5px;
}

.admin-stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

/* Search Bar */
.admin-search {
  margin-bottom: 20px;
}

.admin-search-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.admin-search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.admin-search-input:focus {
  outline: none;
  border-color: rgba(100, 150, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

/* User List */
.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-user-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-user-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.admin-user-email {
  font-size: 0.95rem;
  color: #ffffff;
  margin-bottom: 6px;
}

.admin-user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-user-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(100, 150, 255, 0.15);
  color: rgba(100, 150, 255, 0.9);
}

.admin-user-badge.admin {
  background: rgba(255, 180, 100, 0.15);
  color: rgba(255, 180, 100, 0.9);
}

.admin-user-badge.super {
  background: rgba(255, 100, 100, 0.15);
  color: rgba(255, 100, 100, 0.9);
}

.admin-user-badge.verified {
  background: rgba(100, 200, 150, 0.15);
  color: rgba(100, 200, 150, 0.9);
}

.admin-user-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

/* User Detail View */
.admin-user-detail {
  display: none;
}

.admin-user-detail.active {
  display: block;
}

.admin-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 20px;
  transition: color 0.3s ease;
}

.admin-back-btn:hover {
  color: #ffffff;
}

.admin-detail-section {
  margin-bottom: 30px;
}

.admin-detail-section h4 {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
}

.admin-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-detail-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.admin-detail-value {
  font-size: 0.9rem;
  color: #ffffff;
}

/* Access Control */
.admin-access-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-access-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.admin-access-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Toggle Switch */
.admin-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.admin-toggle.active {
  background: rgba(100, 200, 150, 0.6);
}

.admin-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.admin-toggle.active::after {
  transform: translateX(20px);
}

/* Subscription List */
.admin-subscription-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-subscription-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
}

.admin-subscription-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: rgba(100, 150, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-subscription-check::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.admin-subscription-name {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Loading State */
.admin-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

.admin-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(100, 150, 255, 0.8);
  border-radius: 50%;
  animation: adminSpin 1s linear infinite;
}

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

/* Empty State */
.admin-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
  .admin-panel {
    width: 100vw;
    right: -100vw;
  }

  .admin-settings-cog {
    right: 70px;
    width: 36px;
    height: 36px;
  }

  .admin-settings-cog svg {
    width: 18px;
    height: 18px;
  }

  .admin-header {
    padding: 20px;
  }

  .admin-content {
    padding: 20px;
  }

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

  .admin-tab {
    padding: 12px 10px;
    font-size: 0.7rem;
  }
}
