/* Admin Panel Styling */

/* Custom Tailwind-like utilities */
.bg-admin-black {
  background-color: #000000;
}

.bg-admin-gray {
  background-color: #1f2937;
}

.bg-admin-gray-light {
  background-color: #374151;
}

/* Button styles */
.btn-admin {
  background-color: #000000;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.btn-admin:hover {
  background-color: #1f2937;
}

.btn-admin:active {
  background-color: #374151;
}

.btn-admin:focus {
  outline: none;
  box-shadow: 0 0 0 2px #6b7280, 0 0 0 4px #f3f4f6;
}

.btn-admin-secondary {
  background-color: #4b5563;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.btn-admin-secondary:hover {
  background-color: #374151;
}

.btn-admin-secondary:active {
  background-color: #1f2937;
}

.btn-admin-secondary:focus {
  outline: none;
  box-shadow: 0 0 0 2px #6b7280, 0 0 0 4px #f3f4f6;
}

.btn-admin-danger {
  background-color: #dc2626;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.btn-admin-danger:hover {
  background-color: #b91c1c;
}

.btn-admin-danger:active {
  background-color: #991b1b;
}

.btn-admin-danger:focus {
  outline: none;
  box-shadow: 0 0 0 2px #ef4444, 0 0 0 4px #fef2f2;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .btn-admin,
  .btn-admin-secondary,
  .btn-admin-danger {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5rem;
    min-height: 44px; /* Touch-friendly sizing */
  }
  
  .table-responsive {
    font-size: 0.875rem;
  }
  
  .table-responsive th,
  .table-responsive td {
    padding: 0.5rem 0.75rem;
  }
  
  /* Mobile menu */
  .mobile-menu-toggle {
    display: block;
  }
  
  .desktop-menu {
    display: none;
  }
  
  .mobile-menu {
    display: none;
  }
  
  .mobile-menu.open {
    display: block;
  }
  
  /* Mobile-friendly table */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table-responsive table {
    min-width: 600px;
  }
  
  /* Stack action buttons on mobile */
  .action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .action-buttons .btn-admin,
  .action-buttons .btn-admin-secondary,
  .action-buttons .btn-admin-danger {
    width: 100%;
    justify-content: center;
  }
  
  /* Admin logo responsive sizing */
  .admin-logo {
    width: 180px !important;
    height: 90px !important;
  }
  
  /* Header responsive adjustments */
  .text-xl.md\\:text-2xl {
    font-size: 1.125rem !important;
  }
  
  /* Main content responsive padding */
  .px-4.sm\\:px-6.lg\\:px-8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  .py-6 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .admin-logo {
    width: 150px !important;
    height: 75px !important;
  }
  
  .btn-admin,
  .btn-admin-secondary,
  .btn-admin-danger {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-height: 48px;
  }
  
  /* Header adjustments for very small screens */
  .py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  
  .px-4.sm\\:px-6.lg\\:px-8 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}

/* Desktop styles */
@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none;
  }
  
  .desktop-menu {
    display: flex;
  }
  
  .mobile-menu {
    display: none;
  }
}

/* Table improvements */
.table-responsive {
  border-radius: 0.5rem;
  overflow: hidden;
}

.table-responsive th {
  background-color: #f9fafb;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  color: #6b7280;
}

.table-responsive td {
  border-bottom: 1px solid #e5e7eb;
}

.table-responsive tr:hover {
  background-color: #f9fafb;
}

/* Card improvements */
.card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background-color: white;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

/* Responsive logout overlay styling */
#logout-overlay {
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1070;
}

#logout-overlay .bg-white {
  max-width: 90vw;
  width: 100%;
  margin: 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 576px) {
  #logout-overlay .bg-white {
    max-width: 400px;
    margin: 2rem auto;
  }
}

@media (max-width: 480px) {
  #logout-overlay .bg-white {
    margin: 0.5rem;
    padding: 1rem !important;
  }
  
  #logout-overlay .p-6 {
    padding: 1rem !important;
  }
  
  #logout-overlay .mb-6 {
    margin-bottom: 1rem !important;
  }
  
  #logout-overlay .w-24 {
    width: 4rem !important;
  }
  
  #logout-overlay .h-12 {
    height: 3rem !important;
  }
  
  #logout-overlay .text-xl {
    font-size: 1.125rem !important;
  }
  
  #logout-overlay .text-sm {
    font-size: 0.875rem !important;
  }
}

/* Touch-friendly button improvements */
.btn-admin,
.btn-admin-secondary,
.btn-admin-danger {
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-admin:active,
.btn-admin-secondary:active,
.btn-admin-danger:active {
  transform: translateY(1px);
}

/* Focus improvements for accessibility */
.btn-admin:focus,
.btn-admin-secondary:focus,
.btn-admin-danger:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Mobile menu improvements */
.mobile-menu {
  background-color: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mobile-menu .space-y-1 > * + * {
  margin-top: 0.25rem;
}

.mobile-menu .px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.mobile-menu .pt-2 {
  padding-top: 0.5rem;
}

.mobile-menu .pb-3 {
  padding-bottom: 0.75rem;
}

/* Mobile menu toggle button improvements */
.mobile-menu-toggle {
  transition: all 0.2s ease-in-out;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

.mobile-menu-toggle:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Responsive spacing utilities */
@media (max-width: 768px) {
  .space-x-4 > * + * {
    margin-left: 0.75rem;
  }
  
  .gap-3 {
    gap: 0.75rem;
  }
  
  .gap-4 {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .space-x-4 > * + * {
    margin-left: 0.5rem;
  }
  
  .gap-3 {
    gap: 0.5rem;
  }
  
  .gap-4 {
    gap: 0.75rem;
  }
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

.status-badge.subscribed {
  background-color: #d1fae5;
  color: #065f46;
}

.status-badge.unsubscribed {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Form improvements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Flash messages */
.flash-message {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  max-width: 24rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.flash-message.success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.flash-message.error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
}

.flash-message .flash-content {
  display: flex;
  align-items: flex-start;
  padding: 1rem;
}

.flash-message .flash-icon {
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.flash-message .flash-text {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.flash-message .flash-close {
  flex-shrink: 0;
  margin-left: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease-in-out;
}

.flash-message .flash-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn-admin,
  .btn-admin-secondary,
  .btn-admin-danger {
    border: 2px solid currentColor;
  }
  
  .table-responsive th {
    background-color: #e5e7eb;
  }
  
  .card {
    border: 2px solid #374151;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .btn-admin,
  .btn-admin-secondary,
  .btn-admin-danger,
  .form-input {
    transition: none;
  }
  
  .flash-message {
    animation: none;
  }
}

