:root {
  --primary-color: #ffffff;
  --secondary-color: #6366f1;
  --light-color: #f3f4f6;
  --dark-color: #1f2937;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --border-radius: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
}

header {
  background-color: #1a1a2e;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo-section {
  width: 20%;
}

.logo-img {
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
}

.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1 {
  color: var(--primary-color);
  margin-bottom: 0.25rem;
  font-size: 2rem;
  cursor: pointer;
}

h1 {
  margin: 0;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  background-color: #16213e;
  color: white;
}

.btn-primary:hover {
  background-color: #0f3460;
}

.btn-danger {
  background-color: #e94560;
  color: white;
}

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

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.user-list {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  word-wrap: break-word;
}

.user-list th,
.user-list td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
  vertical-align: top;
}

.user-list th {
  background-color: #f5f5f5;
  font-weight: 600;
  white-space: nowrap;
}

.user-list tr:hover {
  background-color: #f9f9f9;
}

/* Responsive table styles */
@media (max-width: 1200px) {
  .user-list {
    font-size: 0.875rem;
  }
  
  .user-list th,
  .user-list td {
    padding: 0.5rem;
  }
}

@media (max-width: 768px) {
  .user-list {
    font-size: 0.75rem;
  }
  
  .user-list th,
  .user-list td {
    padding: 0.25rem;
  }
  
  /* Hide optional columns on mobile */
  .user-list th:nth-child(4),
  .user-list td:nth-child(4),
  .user-list th:nth-child(5),
  .user-list td:nth-child(5),
  .user-list th:nth-child(6),
  .user-list td:nth-child(6) {
    display: none;
  }
}

.user-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.user-actions .btn {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
}

.btn-danger {
  background-color: #ef4444;
  color: white;
}

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

.status {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

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

.status-partial {
  background-color: #fef3c7;
  color: #92400e;
}

.status-free {
  background-color: #e5e7eb;
  color: #4b5563;
}

.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.alert-error {
  background-color: #fee2e2;
  color: #b91c1c;
  border-left: 4px solid #ef4444;
}

.edit-user-form {
  display: none;
  margin-top: 2rem;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

.error-message {
  color: #b91c1c;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.hidden {
  display: none;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}

.tab.active {
  border-bottom-color: #16213e;
  color: #16213e;
}

.tab-content {
  display: none;
}

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

.service-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.service-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.service-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0;
}

.service-options {
  margin: 1rem 0;
}

.service-expiry {
  margin-top: 0.5rem;
}

.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.form-check input {
  margin-right: 0.5rem;
}

.text-muted {
  color: #6c757d;
  font-size: 0.875em;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #16213e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.tab.disabled {
  color: #aaa;
  cursor: not-allowed;
}

.form-text {
  margin-top: 0.25rem;
}

/* Pagination styles */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  gap: 0.5rem;
}

.pagination-button {
  padding: 0.5rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius);
  background-color: white;
  cursor: pointer;
  font-weight: 500;
  color: #374151;
  transition: all 0.2s;
}

.pagination-button:hover {
  background-color: #f9fafb;
  border-color: #16213e;
}

.pagination-button.active {
  background-color: #16213e;
  color: white;
  border-color: #16213e;
}

.pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f3f4f6;
}

.pagination-button:disabled:hover {
  background-color: #f3f4f6;
  border-color: #cbd5e1;
}

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

.stat-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card h3 {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: #6b7280;
  font-weight: 500;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: #16213e;
  margin: 0.5rem 0;
}

.stat-value.premium {
  color: #10b981;
}

.stat-value.new-users {
  color: #3b82f6;
}

.stat-value.today-users {
  color: #f59e0b;
}

.stat-percentage {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.chart-container {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 2rem;
  height: 400px;
}

.chart-container h3 {
  margin: 0 0 1rem 0;
  color: #16213e;
  font-size: 1.1rem;
}

.chart-container canvas {
  max-height: 320px;
}

/* Admin Actions Section */
.admin-actions {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.admin-actions h3 {
  margin: 0 0 1rem 0;
  color: #16213e;
  font-size: 1.1rem;
}

.action-help-text {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.5rem;
}

.btn-warning {
  background-color: #f59e0b;
  color: white;
  border: 1px solid #f59e0b;
}

.btn-warning:hover {
  background-color: #d97706;
  border-color: #d97706;
}

.btn-warning:disabled {
  background-color: #fbbf24;
  border-color: #fbbf24;
  opacity: 0.8;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  margin-left: 0.5rem;
}
