/* ================================
   ADMIN-SPECIFIC LAYOUT STYLES
   ================================ */

/* Admin Background Container */
.background-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #8B4513 0%, #D2691E 50%, #F4A460 100%);
  position: relative;
}

/* Admin Container */
.index-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
}

/* Admin Title Container */
.title-container {
  text-align: center;
  margin-bottom: 3rem;
}

/* Admin Title - NO ANIMATIONS */
.typing-title {
  font-size: 3rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
  font-family: 'Courier New', monospace;
}

/* Boss Avatar Container */
.boss-avatar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.boss-avatar-admin {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Admin Info Panel */
.admin-info {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.admin-info p {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #333;
}

/* Admin Sections */
.admin-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.admin-section h2 {
  color: #8B4513;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  border-bottom: 2px solid #8B4513;
  padding-bottom: 0.5rem;
}

/* Admin Buttons - Clean and Fast */
.button-base {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  outline: none;
}

.button-base:hover {
  transform: none; /* No hover animations for performance */
  opacity: 0.9;
}

.logout-btn {
  background: #dc3545;
  color: white;
}

.logout-btn:hover {
  background: #c82333;
}

/* Admin Controls */
.admin-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-btn {
  background: #8B4513;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.admin-btn:hover {
  background: #6B3410;
}

/* Form Inputs - Optimized for Fast Typing */
input[type="text"], 
input[type="email"], 
textarea, 
select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

input[type="text"]:focus, 
input[type="email"]:focus, 
textarea:focus, 
select:focus {
  border-color: #8B4513;
  box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.2);
}

/* Remove any inherited animations that cause latency */
* {
  animation: none !important;
  transition: none !important;
}

/* Re-enable only essential transitions */
.button-base, .admin-btn {
  transition: background-color 0.2s ease !important;
}

input[type="text"], input[type="email"], textarea, select {
  transition: border-color 0.2s ease !important;
}

/* Admin Login Styles */
.admin-login-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.login-form-container {
  background: linear-gradient(145deg, #F5E6D3, #E8D5B7);
  border: 3px solid #8B4513;
  border-radius: 15px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.login-header {
  margin-bottom: 2rem;
}

.login-header h1 {
  color: #8B4513;
  margin-bottom: 1rem;
  font-size: 1.8rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.boss-avatar-login {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid #8B4513;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  object-fit: cover;
  object-position: center;
}

.login-form {
  text-align: left;
}

.login-form .form-group {
  margin-bottom: 1.5rem;
}

.login-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: #8B4513;
  font-weight: bold;
}

.login-form input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #8B7355;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #4A4A4A;
  font-size: 1rem;
  box-sizing: border-box;
}

.login-form input:focus {
  outline: none;
  border-color: #D2B48C;
  background: white;
  box-shadow: 0 0 5px rgba(210, 180, 140, 0.5);
}

.login-btn {
  background: linear-gradient(145deg, #90EE90, #7dd87d);
  border: 2px solid #5cb85c;
  color: #2d5a2d;
  padding: 0.75rem 1.5rem;
  font-weight: bold;
  margin-right: 0.5rem;
}

.login-btn:hover {
  background: linear-gradient(145deg, #7dd87d, #6bc66b);
  transform: translateY(-2px);
}

.back-btn {
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
  border: 2px solid #ccc;
  color: #666;
  padding: 0.75rem 1.5rem;
}

.back-btn:hover {
  background: linear-gradient(145deg, #e0e0e0, #d0d0d0);
  transform: translateY(-2px);
}

.error-message {
  color: #dc3545;
  background: linear-gradient(145deg, #f8d7da, #f1c6cb);
  border: 2px solid #dc3545;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  font-weight: bold;
}

/* Admin Panel Styles */
.admin-info {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(139, 69, 19, 0.1);
  border-radius: 10px;
  border: 2px solid #8B4513;
}

.admin-info p {
  margin: 0 0 1rem 0;
  color: #8B4513;
  font-weight: bold;
  font-size: 1.2rem;
}

.logout-btn {
  background: linear-gradient(145deg, #ff6b6b, #ee5a5a);
  border: 2px solid #cc4444;
  color: white;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.logout-btn:hover {
  background: linear-gradient(145deg, #ee5a5a, #dd4949);
  transform: translateY(-2px);
}

.admin-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(139, 69, 19, 0.05);
  border-radius: 15px;
  border: 2px solid #8B4513;
}

.admin-section h2 {
  color: #8B4513;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.admin-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.admin-btn {
  background: linear-gradient(145deg, #D2B48C, #C19A6B);
  border: 2px solid #8B7355;
  color: #4A4A4A;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  min-width: 180px;
  text-align: center;
}

.admin-btn:hover {
  background: linear-gradient(145deg, #C19A6B, #B8860B);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.boss-avatar-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.boss-avatar-admin {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #8B4513;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  object-fit: cover;
  object-position: center;
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  overflow-y: auto;
  padding: 40px 20px;
}

.modal-content {
  background: linear-gradient(145deg, #F5E6D3, #E8D5B7);
  border: 3px solid #8B4513;
  border-radius: 15px;
  max-width: 600px;
  width: 90%;
  min-height: 300px;
  max-height: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin: 20px auto;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid #8B4513;
  background: linear-gradient(145deg, #D2B48C, #C19A6B);
}

.modal-header h3 {
  margin: 0;
  color: #4A4A4A;
  font-size: 1.3rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #8B4513;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.close-btn:hover {
  color: #A0522D;
  transform: scale(1.1);
}

.modal-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #8B4513;
  font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #8B7355;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #4A4A4A;
  font-size: 1rem;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.form-group input[type="text"] {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
  max-height: 200px;
  overflow-y: auto;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #D2B48C;
  background: white;
  box-shadow: 0 0 5px rgba(210, 180, 140, 0.5);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.submit-btn {
  background: linear-gradient(145deg, #90EE90, #7dd87d);
  border: 2px solid #5cb85c;
  color: #2d5a2d;
  padding: 0.75rem 1.5rem;
}

.submit-btn:hover {
  background: linear-gradient(145deg, #7dd87d, #6bc66b);
  transform: translateY(-2px);
}

.cancel-btn {
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
  border: 2px solid #ccc;
  color: #666;
  padding: 0.75rem 1.5rem;
}

.cancel-btn:hover {
  background: linear-gradient(145deg, #e0e0e0, #d0d0d0);
  transform: translateY(-2px);
}

/* Newsletter List */
.newsletter-list {
  max-height: 400px;
  overflow-y: auto;
}

.newsletter-item {
  border: 2px solid #8B7355;
  border-radius: 10px;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.7);
}

.newsletter-item h4 {
  margin: 0 0 0.5rem 0;
  color: #8B4513;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.newsletter-item p {
  margin: 0 0 0.5rem 0;
  color: #666;
  font-size: 0.9rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.4;
}

.newsletter-date {
  font-size: 0.8rem;
  color: #999;
  font-style: italic;
}

.newsletter-actions {
  margin-top: 0.5rem;
}

.delete-newsletter-btn {
  background: linear-gradient(145deg, #ff6b6b, #ee5a5a);
  border: 2px solid #cc4444;
  color: white;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 5px;
  cursor: pointer;
}

.delete-newsletter-btn:hover {
  background: linear-gradient(145deg, #ee5a5a, #dd4949);
  transform: translateY(-1px);
}

/* Message Container */
.message-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
}

.message {
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  border: 2px solid;
  font-weight: bold;
  animation: slideIn 0.3s ease-out;
}

.message.success {
  background: linear-gradient(145deg, #d4edda, #c3e6cb);
  border-color: #5cb85c;
  color: #155724;
}

.message.error {
  background: linear-gradient(145deg, #f8d7da, #f1c6cb);
  border-color: #dc3545;
  color: #721c24;
}

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

/* Metrics Styles */
.large-modal .modal-content {
  max-width: 95%;
  width: 1200px;
  min-height: 400px;
  max-height: none;
  margin: 20px auto;
}

.metrics-content, .users-content {
  margin-top: 1rem;
}

.loading-message {
  text-align: center;
  padding: 2rem;
  color: #8B4513;
  font-size: 1.1rem;
}

.error-message {
  text-align: center;
  padding: 2rem;
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
  border: 2px solid #dc3545;
  border-radius: 8px;
  font-weight: bold;
}

.no-data {
  text-align: center;
  padding: 1rem;
  color: #666;
  font-style: italic;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: linear-gradient(145deg, #F5E6D3, #E8D5B7);
  border: 2px solid #8B7355;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}

.metric-card h4 {
  margin: 0 0 0.5rem 0;
  color: #8B4513;
  font-size: 0.9rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: bold;
  color: #4A4A4A;
  margin-bottom: 0.25rem;
}

.metric-percentage {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}

/* Chart Styles */
.chart-section {
  margin-top: 2rem;
}

.chart-section h4 {
  color: #8B4513;
  margin-bottom: 1rem;
  border-bottom: 2px solid #8B4513;
  padding-bottom: 0.5rem;
}

.signup-chart, .popular-maps {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 1rem;
  border: 2px solid #8B7355;
}

.chart-bar {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.bar-label {
  min-width: 100px;
  font-size: 0.9rem;
  color: #8B4513;
  font-weight: bold;
}

.bar-container {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  background: rgba(139, 69, 19, 0.1);
  border-radius: 4px;
  height: 24px;
}

.bar-fill {
  background: linear-gradient(90deg, #8B4513, #D2B48C);
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.bar-value {
  position: absolute;
  right: 8px;
  font-size: 0.8rem;
  font-weight: bold;
  color: #4A4A4A;
}

/* Users List Styles */
.users-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid #8B7355;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #4A4A4A;
  font-size: 1rem;
}

.search-input:focus {
  outline: none;
  border-color: #D2B48C;
  background: white;
  box-shadow: 0 0 5px rgba(210, 180, 140, 0.5);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #8B7355;
}

.users-table th,
.users-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.users-table th {
  background: linear-gradient(145deg, #D2B48C, #C19A6B);
  color: #4A4A4A;
  font-weight: bold;
  font-size: 0.9rem;
}

.users-table tbody tr:hover {
  background: rgba(139, 69, 19, 0.05);
}

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

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.status-badge.confirmed {
  background: linear-gradient(145deg, #90EE90, #7dd87d);
  color: #2d5a2d;
  border: 1px solid #5cb85c;
}

.status-badge.pending {
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
  color: #666;
  border: 1px solid #ccc;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #8B7355;
}

.pagination-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#pageInfo {
  color: #8B4513;
  font-weight: bold;
  min-width: 200px;
  text-align: center;
}

/* Recent Errors */
.recent-errors {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 1rem;
  border: 2px solid #8B7355;
}

.error-item {
  border-bottom: 1px solid #ddd;
  padding: 1rem 0;
}

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

.error-type {
  font-weight: bold;
  color: #dc3545;
  margin-bottom: 0.25rem;
}

.error-message {
  color: #4A4A4A;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  background: none;
  border: none;
  padding: 0;
}

.error-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #666;
}

.error-count {
  font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
  .admin-controls {
    flex-direction: column;
    align-items: center;
  }
  
  .admin-btn {
    min-width: 200px;
  }
  
  .modal-content {
    width: 95%;
    margin: 1rem;
  }
  
  .form-actions {
    flex-direction: column;
  }

  .large-modal .modal-content {
    width: 95%;
    max-width: none;
    margin: 10px auto;
  }

  .modal-content {
    width: 95%;
    margin: 10px auto;
  }

  .modal-overlay {
    padding: 20px 10px;
  }

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

  .users-controls {
    flex-direction: column;
  }

  .users-table {
    font-size: 0.8rem;
  }

  .users-table th,
  .users-table td {
    padding: 0.5rem;
  }

  .pagination-controls {
    flex-direction: column;
    gap: 0.5rem;
  }

  .chart-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .bar-label {
    min-width: auto;
  }
}