/* MSWP SMS Admin Styles */
#mswp-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#mswp-saving-spinner {
  vertical-align: middle;
  margin-left: 10px;
}

.mswp-sms-notice {
  padding: 15px;
  margin: 15px 0;
  border-left: 4px solid;
}

.mswp-sms-notice.success {
  border-color: #46b450;
  background-color: #f7fff7;
}

.mswp-sms-notice.error {
  border-color: #dc3232;
  background-color: #fff5f5;
}

.mswp-sms-recipients-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
  padding: 10px;
  margin-bottom: 10px;
}

.mswp-sms-recipients-list ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.mswp-sms-recipients-list li {
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.mswp-sms-recipients-list li:last-child {
  border-bottom: none;
}

.mswp-sms-stats-container {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.mswp-sms-stat-card {
  flex: 1;
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.mswp-sms-stat-card h3 {
  margin-top: 0;
  color: #646970;
  font-size: 14px;
  font-weight: 500;
}

.mswp-sms-stat-card .stat-value {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  margin: 10px 0;
}

.mswp-sms-stat-card .stat-description {
  color: #646970;
  font-size: 13px;
}

.mswp-sms-chart-card h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #646970;
  font-size: 14px;
  font-weight: 500;
}

.mswp-sms-recent-activity {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.mswp-sms-recent-activity h3 {
  margin-top: 0;
  color: #646970;
  font-size: 14px;
  font-weight: 500;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.status-approved {
  background-color: #d4edda;
  color: #155724;
}

.status-pending {
  background-color: #fff3cd;
  color: #856404;
}

.status-unknown {
  background-color: #f8d7da;
  color: #721c24;
}

/* Credits page styles */
.mswp-sms-credits-container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* .mswp-sms-balance-card {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  text-align: center;
} */

.mswp-sms-balance-card {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center;  */
}

.mswp-sms-balance-card h2 {
  margin-top: 0;
  color: #646970;
  font-size: 16px;
  font-weight: 500;
}

.balance-value {
  font-size: 48px;
  font-weight: 600;
  line-height: 1.2;
  margin: 20px 0;
  color: #2271b1;
}

.balance-label {
  color: #646970;
  font-size: 14px;
  margin-bottom: 20px;
}

/* .mswp-sms-usage-table {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
} */

.mswp-sms-usage-table {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  width: 305% !important; /* Make container span full width */
  box-sizing: border-box; /* Prevent overflow from padding */
}

/* Optional: If you're styling the table inside */
.mswp-sms-usage-table table {
  width: 100% !important; /* Make table span full width of container */
  border-collapse: collapse;
}

/* Optional: Full-width table headers and cells */
.mswp-sms-usage-table table th,
.mswp-sms-usage-table table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #e1e1e1;
}

.mswp-sms-usage-chart {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  position: relative; /* Needed for Chart.js */
  height: 400px; /* Fixed height (better than max-height) */
}

.mswp-sms-usage-chart canvas {
  width: 100% !important;
  height: calc(100% - 40px) !important; /* Accounts for heading */
  display: block; /* Removes extra spacing */
}

.mswp-sms-usage-chart h2,
.mswp-sms-usage-table h2 {
  margin-top: 0;
  color: #646970;
  font-size: 16px;
  font-weight: 500;
}

/* Sender ID page styles */
.mswp-sender-id-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.mswp-sender-id-current,
.mswp-sender-id-create {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.mswp-sender-id-current h2,
.mswp-sender-id-create h2 {
  margin-top: 0;
  color: #646970;
  font-size: 16px;
  font-weight: 500;
}

.sender-id-card {
  text-align: center;
  padding: 20px 0;
}

.sender-id-value {
  font-size: 32px;
  font-weight: 600;
  margin: 10px 0;
}

.sender-id-status {
  margin: 15px 0;
}

.sender-id-form p {
  margin-top: 0;
}

#mswp-sender-id-spinner {
  float: none;
  margin-top: 4px;
}

/* Chart Container (Parent) */
.mswp-sms-chart-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}

/* Individual Chart Canvas Containers */
.mswp-sms-chart-card {
  position: relative;
  flex: 1;
  min-width: 300px;
  height: 450px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#mswp-sms-usage-chart,
#mswp-sms-types-chart {
  height: 400px !important;
  width: 539px;
}

/* Modern Bulk SMS Page Styles */
.mswp-sms-bulk-page {
  max-width: 1200px;
  margin: 0 auto;
}

.mswp-sms-bulk-container {
  margin-top: 20px;
}

.mswp-sms-bulk-card {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.mswp-sms-bulk-section {
  padding: 25px;
  border-bottom: 1px solid #f0f0f1;
}

.mswp-sms-bulk-section:last-child {
  border-bottom: none;
}

.mswp-sms-bulk-section h2 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #1d2327;
}

/* Message Editor Styles */
.mswp-sms-message-editor {
  margin-bottom: 20px;
}

.mswp-sms-message-editor textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}

.mswp-sms-message-editor textarea:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
  outline: none;
}

.mswp-sms-message-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.mswp-sms-char-counter {
  font-size: 13px;
  color: #646970;
}

.mswp-sms-placeholders {
  position: relative;
  display: inline-block;
}

.mswp-sms-placeholder-toggle {
  color: #2271b1;
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
}

.mswp-sms-placeholder-dropdown {
  display: none;
  position: absolute;
  right: 0;
  bottom: 100%;
  width: 200px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.mswp-sms-placeholder-dropdown ul {
  list-style: none;
  margin: 10px 0 0 0;
  padding: 0;
}

.mswp-sms-placeholder-dropdown li {
  margin-bottom: 5px;
}

.mswp-sms-placeholder-dropdown button {
  background: none;
  border: none;
  color: #2271b1;
  cursor: pointer;
  padding: 0;
  text-align: left;
  width: 100%;
}

.mswp-sms-placeholder-dropdown button:hover {
  text-decoration: underline;
}

.mswp-sms-placeholders:hover .mswp-sms-placeholder-dropdown {
  display: block;
}

/* Recipients List Styles */
.mswp-sms-recipients-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.mswp-sms-recipients-actions {
  display: flex;
  gap: 8px;
}

.mswp-sms-recipients-search input {
  padding: 5px 10px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  min-width: 250px;
}

.mswp-sms-recipients-list {
  border: 1px solid #dcdcde;
  border-radius: 4px;
  overflow: hidden;
}

.mswp-sms-recipients-header {
  display: flex;
  background: #f6f7f7;
  padding: 10px 15px;
  font-weight: 500;
  border-bottom: 1px solid #dcdcde;
}

.mswp-sms-recipient-select {
  width: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.mswp-sms-recipient-name {
  flex: 2;
  padding-right: 15px;
}

.mswp-sms-recipient-phone {
  flex: 1;
}

.mswp-sms-recipients-items {
  max-height: 400px;
  overflow-y: auto;
}

.mswp-sms-recipient-item {
  display: flex;
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f1;
  align-items: center;
}

.mswp-sms-recipient-item:last-child {
  border-bottom: none;
}

.mswp-sms-recipient-item:hover {
  background-color: #f6f7f7;
}

.mswp-sms-recipient-item input[type='checkbox'] {
  margin: 0;
}

.mswp-sms-recipients-summary {
  margin-top: 15px;
  font-size: 14px;
  color: #646970;
  text-align: right;
}

.mswp-sms-no-recipients {
  padding: 20px;
  text-align: center;
  background: #f6f7f7;
  border-radius: 4px;
}

/* Bulk Actions Styles */
.mswp-sms-bulk-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #f6f7f7;
  border-top: 1px solid #dcdcde;
}

.mswp-sms-estimated-cost {
  font-size: 14px;
  color: #646970;
}

/* Responsive Adjustments */
@media (max-width: 782px) {
  .mswp-sms-recipients-controls {
    flex-direction: column;
  }

  .mswp-sms-recipients-search input {
    width: 100%;
  }

  .mswp-sms-bulk-actions {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
}

/* Notice Container Styles */
#mswp-sms-notice-container {
  margin: 20px 0;
}

#mswp-sms-notice-container .notice {
  margin: 5px 0 15px;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state for submit button */
.button.is-busy {
  opacity: 0.7;
  position: relative;
  padding-left: 40px;
}

.button.is-busy:before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  margin-top: -8px;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Modern Settings Page Styles */
.mswp-sms-settings {
  max-width: 1200px;
}

.mswp-settings-container {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.mswp-settings-sidebar {
  width: 280px;
  flex-shrink: 0;
}

.mswp-settings-main {
  flex-grow: 1;
}

.mswp-settings-sidebar-card {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.mswp-settings-sidebar-card h3 {
  margin-top: 0;
  font-size: 16px;
  color: #1d2327;
}

.mswp-settings-sidebar-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mswp-settings-sidebar-card li {
  margin-bottom: 8px;
}

.mswp-settings-sidebar-card a {
  text-decoration: none;
  color: #2271b1;
  display: block;
  padding: 5px 0;
}

.mswp-settings-sidebar-card a:hover {
  color: #135e96;
}

.mswp-settings-tabs {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.mswp-settings-tab-nav {
  border-bottom: 1px solid #dcdcde;
}

.mswp-settings-tab-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.mswp-settings-tab-nav li {
  margin: 0;
}

.mswp-settings-tab-nav a {
  display: block;
  padding: 12px 20px;
  text-decoration: none;
  color: #646970;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.mswp-settings-tab-nav a:hover {
  color: #2271b1;
  border-bottom-color: #dcdcde;
}

.mswp-settings-tab-nav a.active {
  color: #2271b1;
  border-bottom-color: #2271b1;
}

.mswp-settings-tab-content {
  display: none;
  padding: 20px;
}

.mswp-settings-tab-content.active {
  display: block;
}

.mswp-settings-card {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f1;
}

.mswp-settings-card:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.mswp-settings-card h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 18px;
  color: #1d2327;
}

.mswp-form-group {
  margin-bottom: 20px;
}

.mswp-form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.mswp-form-group input[type='text'],
.mswp-form-group input[type='number'],
.mswp-form-group textarea {
  width: 100%;
  max-width: 600px;
}

.mswp-form-group textarea {
  min-height: 100px;
}

.mswp-placeholder-hint {
  margin-top: 5px;
  font-size: 13px;
  color: #646970;
}

.mswp-placeholder-hint code {
  background: #f6f7f7;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 12px;
}

.mswp-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.mswp-status-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mswp-status-item input {
  margin: 0;
}

.mswp-form-switch {
  display: flex;
  align-items: center;
}

.mswp-form-switch label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 0;
}

.mswp-switch-slider {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  background-color: #dcdcde;
  border-radius: 12px;
  transition: background-color 0.2s;
}

.mswp-switch-slider:before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.mswp-form-switch input {
  display: none;
}

.mswp-form-switch input:checked + .mswp-switch-slider {
  background-color: #2271b1;
}

.mswp-form-switch input:checked + .mswp-switch-slider:before {
  transform: translateX(18px);
}

.mswp-settings-footer {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  padding: 20px;
  background: #f6f7f7;
  border-radius: 4px;
}

.mswp-save-notice {
  color: #2271b1;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s;
}

.mswp-save-notice.show {
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 960px) {
  .mswp-settings-container {
    flex-direction: column;
  }

  .mswp-settings-sidebar {
    width: 100%;
  }

  .mswp-status-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@media (max-width: 600px) {
  .mswp-settings-tab-nav ul {
    flex-wrap: wrap;
  }

  .mswp-settings-tab-nav li {
    flex: 1;
    min-width: 100px;
  }

  .mswp-settings-tab-nav a {
    padding: 10px;
    text-align: center;
    font-size: 14px;
  }

  .mswp-status-grid {
    grid-template-columns: 1fr;
  }
}
