/**
 * ================================
 * SMCStylus DB Utils - Admin Styles
 * ================================
 * Clean, modular, and easy-to-maintain CSS
 * Applies to all plugin admin pages
 */

/* ================================
   CORE LAYOUT & GLOBAL STYLES
================================= */
.smcstylus-db-utils-admin {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #212529;
}

/* Card Styling */
.smcstylus-db-utils-admin .card {
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  max-width: 100%;
  margin-bottom: 1.5rem;
  background-color: #fff;
  border: 1px solid #dee2e6;
}

.smcstylus-db-utils-admin .card-header {
  font-weight: 600;
  font-size: 1.1rem;
  background-color: #0d6efd;
  color: #fff;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #dee2e6;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

/* Card Body Collapsed (for collapse sections) */
.smcstylus-db-utils-admin .card.card-body {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
}

/* ================================
   BUTTONS
================================= */
.smcstylus-db-utils-admin .btn {
  min-width: 130px;
}

.smcstylus-db-utils-admin .btn .spinner-border {
  vertical-align: middle;
  margin-right: 0.4rem;
}

.smcstylus-db-utils-admin .btn-link {
  font-size: 0.9rem;
  text-decoration: underline;
  padding: 0;
}

/* Optimize & Repair Buttons in Tables Page */
.smcstylus-db-utils-admin .optimize-btn {
  background-color: #fdd835;
  color: #212121;
  border: none;
  padding: 6px 12px;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}

.smcstylus-db-utils-admin .optimize-btn:hover {
  background-color: #fbc02d;
}

.smcstylus-db-utils-admin .repair-btn {
  background-color: #607d8b;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}

.smcstylus-db-utils-admin .repair-btn:hover {
  background-color: #546e7a;
}

/* Action Buttons Group (Tables Page) */
.smcstylus-db-utils-admin .smc-tables-actions {
  display: flex;
  gap: 0.5rem;
}

/* Hide Optimize Button via Inline Style if Needed (AJAX) */
.smcstylus-db-utils-admin .smc-optimize-btn[style*="display: none"] {
  display: none !important;
}

/* ================================
   FORMS & CHECKBOXES
================================= */
.smcstylus-db-utils-admin .form-check {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.smcstylus-db-utils-admin .form-check-input {
  margin-right: 0.5rem;
}


/* ================================
   ALERTS & MESSAGES
================================= */
.smcstylus-db-utils-admin .alert {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.95rem;
  border-left: 4px solid transparent;
}

.smcstylus-db-utils-admin .alert-success {
  border-left-color: #198754;
}

.smcstylus-db-utils-admin .alert-info {
  border-left-color: #0dcaf0;
}

.smcstylus-db-utils-admin .alert-danger {
  border-left-color: #dc3545;
}

.smcstylus-db-utils-admin .alert-warning {
  border-left-color: #ffc107;
}

.smcstylus-db-utils-admin .alert .btn-close {
  padding: 0.5rem;
}

/* Cleanup Form Message Box */
#smcstylus-cleanup-message {
  margin: 1rem 0;
}

#smcstylus-cleanup-message .alert {
  margin-bottom: 0.5rem;
}

/* ================================
   SPINNER STYLES
================================= */
.smcstylus-db-utils-admin .spinner-border-lg {
  width: 3rem;
  height: 3rem;
}

.smcstylus-db-utils-admin .spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* Spinner inside Buttons */
#smcstylus-cleanup-form .spinner-border {
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* Spinner Generic */
.smcstylus-db-utils-admin .spinner-border {
  display: inline-block;
  vertical-align: middle;
}

/* ================================
   TABLES
================================= */
.smcstylus-db-utils-admin .table-responsive {
  margin-top: 1rem;
}

.table thead th {
  vertical-align: middle;
}

/* ================================
   LIST GROUP LINKS
================================= */
.smcstylus-db-utils-admin .list-group-item a {
  text-decoration: none;
  font-weight: 500;
  color: #0d6efd;
}

.smcstylus-db-utils-admin .list-group-item a:hover {
  text-decoration: underline;
}

/* ================================
   TEXT & TYPOGRAPHY
================================= */
.smcstylus-db-utils-admin .text-muted {
  font-size: 0.9rem;
  color: #6c757d;
}

/* ================================
   RESPONSIVENESS
================================= */
@media (max-width: 768px) {
  .smcstylus-db-utils-admin .table-responsive {
    overflow-x: auto;
  }

  .smcstylus-db-utils-admin .btn {
    min-width: 100%;
  }

  .smcstylus-db-utils-admin .smc-tables-actions {
    flex-direction: column;
    gap: 0.25rem;
  }
}
