/* =================================================================
   Scheduled Messages CSS
   ================================================================= */

/* Modal Styles */
#scheduled-message-modal .modal-content {
  max-width: 600px;
}

/* Form Styles */
#scheduled-message-form .form-group {
  margin-bottom: 20px;
}

#scheduled-message-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

#scheduled-message-form select[multiple] {
  height: 150px;
}

/* Card Grid Layout */
.scheduled-messages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Card Styles */
.scheduled-message-card {
  background-color: var(--card-bg-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.scheduled-message-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.scheduled-message-card.inactive {
  opacity: 0.7;
}

.card-header {
  padding: 15px;
  background-color: var(--card-header-bg);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-title {
  flex: 1;
}

.card-title h4 {
  margin: 5px 0 0 0;
  font-size: 16px;
  line-height: 1.4;
}

/* Countdown Timer Styles */
.countdown-container {
  margin-top: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  color: var(--text-color);
}

.countdown-timer {
  font-family: monospace;
  font-weight: bold;
  background-color: rgba(0, 0, 0, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-right: 5px;
  color: var(--primary-color);
}

.sent-status {
  color: #28a745;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.sent-status:before {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-left: 5px;
  margin-right: 5px;
}

.failed-status {
  color: #dc3545;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.failed-status:before {
  content: "\f00d";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-left: 5px;
  margin-right: 5px;
}

.pending-status {
  color: #ffc107;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.pending-status:before {
  content: "\f017";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-left: 5px;
  margin-right: 5px;
}

.retry-btn {
  margin-left: 10px;
  font-size: 12px;
  padding: 2px 8px;
}

.card-actions {
  display: flex;
  gap: 5px;
}

/* Schedule Badge Styles */
.schedule-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.schedule-badge.once {
  background-color: #e91e63;
  color: white;
}

.schedule-badge.daily {
  background-color: #2196f3;
  color: white;
}

.schedule-badge.weekly {
  background-color: #ff9800;
  color: white;
}

.schedule-badge.monthly {
  background-color: #4caf50;
  color: white;
}

/* Card Body Styles */
.card-body {
  padding: 15px;
}

/* Countdown Container Styles */
.countdown-container {
  margin-bottom: 15px;
  padding: 8px 12px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.countdown-display {
  font-weight: bold;
}

.countdown-timer {
  font-family: monospace;
  font-weight: bold;
  background-color: rgba(0, 0, 0, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-right: 5px;
  color: var(--primary-color);
}

.sent-status {
  color: #28a745;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.sent-status:before {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-left: 5px;
  margin-right: 5px;
}

.message-groups {
  margin-bottom: 15px;
}

.groups-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.group-badge {
  background-color: var(--secondary-color);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.message-text p {
  margin-top: 5px;
  white-space: pre-wrap;
  line-height: 1.5;
  max-height: 100px;
  overflow-y: auto;
}

/* Empty State Styles */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  background-color: var(--card-bg-color);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.empty-state i {
  opacity: 0.5;
  margin-bottom: 15px;
}

/* Toast Styles */
.toast {
  opacity: 1 !important;
  background-color: var(--card-bg-color);
  color: var(--text-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
}

.toast.success .toast-header {
  color: #28a745;
  border-bottom-color: rgba(40, 167, 69, 0.2);
}

.toast.error .toast-header {
  color: #dc3545;
  border-bottom-color: rgba(220, 53, 69, 0.2);
}

.toast-header {
  background-color: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 10px 15px;
}

.toast-body {
  padding: 15px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .scheduled-messages-grid {
    grid-template-columns: 1fr;
  }
  
  #scheduled-message-modal .modal-content {
    width: 90%;
    max-width: none;
  }
}