/* Admin Subscription Management Styles */

.subscription-management {
  padding: 20px;
}

.subscription-header {
  margin-bottom: 30px;
}

.subscription-header h2 {
  color: #333;
  margin-bottom: 20px;
}

.subscription-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  background: #6c757d;
}

.stat-icon.active {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.stat-icon.trial {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.stat-icon.warning {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

.stat-icon.revenue {
  background: linear-gradient(135deg, #007bff, #0056b3);
}

.stat-content h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #333;
}

.stat-content p {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.subscription-controls {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.filters {
  display: flex;
  gap: 20px;
  align-items: end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
}

.filter-group .form-control {
  min-width: 150px;
}

.bulk-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.shops-table-container {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  overflow: hidden;
}

.shops-table-container table {
  margin: 0;
}

.shops-table-container th {
  background: #f8f9fa;
  border-top: none;
  font-weight: 600;
  color: #333;
  padding: 15px;
}

.shops-table-container td {
  padding: 15px;
  vertical-align: middle;
  border-top: 1px solid #e9ecef;
}

.shop-info strong {
  display: block;
  color: #333;
  font-weight: 600;
}

.shop-info small {
  color: #666;
}

.subscription-info {
  text-align: center;
}

.tier-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.tier-badge.tier-basic {
  background: #e9ecef;
  color: #495057;
}

.tier-badge.tier-standard {
  background: #cce5ff;
  color: #0056b3;
}

.tier-badge.tier-premium {
  background: #d1ecf1;
  color: #0c5460;
}

.tier-badge.tier-enterprise {
  background: #d4edda;
  color: #155724;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.status-active {
  background: #d1ecf1;
  color: #0c5460;
}

.status-badge.status-trial {
  background: #fff3cd;
  color: #856404;
}

.status-badge.status-overdue {
  background: #f8d7da;
  color: #721c24;
}

.status-badge.status-suspended {
  background: #e2e3e5;
  color: #41464b;
}

.action-buttons {
  display: flex;
  gap: 5px;
}

.action-buttons .btn {
  padding: 5px 8px;
}

/* Subscription Edit Modal */
.feature-toggles {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
}

.feature-toggles .form-check {
  margin-bottom: 10px;
}

.feature-toggles .form-check-label {
  font-size: 14px;
  color: #333;
}

/* Modal Enhancements */
.modal-lg {
  max-width: 800px;
}

.modal-header {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border-radius: 12px 12px 0 0;
}

.modal-header h4 {
  margin: 0;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 25px;
}

.modal-footer {
  background: #f8f9fa;
  border-radius: 0 0 12px 12px;
  padding: 15px 25px;
  border-top: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
  .subscription-stats {
    grid-template-columns: 1fr;
  }
  
  .subscription-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filters {
    flex-direction: column;
    gap: 10px;
  }
  
  .bulk-actions {
    justify-content: center;
  }
  
  .shops-table-container {
    overflow-x: auto;
  }
  
  .action-buttons {
    flex-direction: column;
  }
}

/* Loading States */
.table-loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-style: italic;
}

.table-loading:before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e9ecef;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

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

/* Hover Effects */
.shops-table-container tbody tr:hover {
  background: #f8f9fa;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Form Enhancements */
.form-control:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-check-input:checked {
  background-color: #007bff;
  border-color: #007bff;
}

.form-check-input:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}