/**
 * CodeSig: sgketg
 * Author: G & D Enterprises, Inc.
 */

.joan-admin-wrap {
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.joan-admin-wrap h1 {
  font-size: 1.8em;
  margin-bottom: 20px;
}

/* Premium Ad Styles */
.joan-premium-ad {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 25px;
  position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.joan-premium-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.joan-premium-text h3 {
  margin: 0 0 8px 0;
  font-size: 1.4em;
  font-weight: 600;
}

.joan-premium-text p {
  margin: 0;
  opacity: 0.9;
  line-height: 1.4;
}

.joan-premium-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.joan-premium-upgrade {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.3);
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.joan-premium-upgrade:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
  color: white;
  text-decoration: none;
}

.joan-premium-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  transition: color 0.2s;
}

.joan-premium-dismiss:hover {
  color: white;
}

/* Admin root container for positioning notifications */
#joan-admin-root {
  position: relative;
  min-height: 200px;
}

/* Schedule header */
.joan-schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.joan-schedule-header h2 {
  margin: 0;
  font-size: 1.3em;
}

/* Top notifications below admin bar */
.joan-notification {
    position: fixed !important;
    top: 32px !important; /* Below WordPress admin bar */
    right: 20px !important;
    z-index: 999999 !important; /* Higher than admin bar */
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    font-weight: 500;
    font-size: 15px;
    min-width: 300px;
    max-width: 450px;
    animation: slideInRight 0.4s ease-out;
    border: 2px solid transparent;
}

.joan-notification-success {
  background: #28a745;
  color: white;
  border-color: #1e7e34;
}

.joan-notification-error {
  background: #dc3545;
  color: white;
  border-color: #c82333;
}

.joan-notification .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.joan-notification-success .dashicons {
  color: #d4edda;
}

.joan-notification-error .dashicons {
  color: #f8d7da;
}

.joan-notification-text {
  flex: 1;
  line-height: 1.5;
  font-weight: 600;
}

.joan-notification-dismiss {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.joan-notification-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.joan-add-form {
  background: #f9f9f9;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 25px;
}

.joan-form-row {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.joan-form-row input,
.joan-form-row select {
  padding: 6px 10px;
  flex: 1;
  min-width: 150px;
  max-width: 250px;
}

/* Inline image upload styling */
.joan-image-upload-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
}

.joan-image-upload-inline .joan-image-preview {
  max-height: 30px;
  max-width: 30px;
  border-radius: 3px;
  border: 1px solid #ddd;
}

.joan-image-upload-inline button {
  font-size: 12px;
  padding: 4px 8px;
  white-space: nowrap;
}

.joan-add-form button.button-primary {
  margin-top: 10px;
  padding: 8px 20px;
}

.joan-schedule-table {
  margin-top: 20px;
}

.joan-schedule-table input,
.joan-schedule-table select {
  width: 100%;
  max-width: 180px;
  padding: 4px 6px;
  margin: 2px 0;
}

.joan-actions {
  white-space: nowrap;
}

.joan-actions .button {
  margin-right: 5px;
}

.joan-image-field {
  text-align: center;
}

.joan-image-upload {
  text-align: center;
}

.joan-image-preview {
  display: block;
  margin: 4px auto;
  max-height: 60px;
  max-width: 60px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.joan-select-image,
#new-select-image {
  margin-top: 5px;
  font-size: 12px;
  padding: 4px 8px;
}

/* Button loading states */
.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Form validation styles */
.joan-form-error {
  border-color: #dc3232 !important;
  box-shadow: 0 0 2px rgba(220, 50, 50, 0.8);
}

/* ==========================================================================
   JOAN STATUS INDICATOR STYLES (Admin Bar)
   ========================================================================== */

/* Admin bar status indicator for suspended schedule */
.joan-admin-status-suspended #wp-admin-bar-joan-status .ab-item {
  background: #f39c12 !important;
  color: white !important;
  font-weight: bold;
}

.joan-admin-status-suspended #wp-admin-bar-joan-status:hover .ab-item {
  background: #e67e22 !important;
}

/* Admin bar status indicator for off-air schedule */
.joan-admin-status-off_air #wp-admin-bar-joan-status .ab-item {
  background: #e74c3c !important;
  color: white !important;
  font-weight: bold;
}

.joan-admin-status-off_air #wp-admin-bar-joan-status:hover .ab-item {
  background: #c0392b !important;
}

/* Status indicator styling */
.joan-status-indicator {
  animation: joan-status-pulse 2s infinite;
}

@keyframes joan-status-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Admin notice enhancements for status changes */
.notice.joan-status-notice {
  border-left-width: 4px;
  padding: 15px 20px;
}

.notice.joan-status-notice.notice-warning {
  border-left-color: #f39c12;
  background: #fff8e1;
}

.notice.joan-status-notice.notice-error {
  border-left-color: #e74c3c;
  background: #ffebee;
}

.notice.joan-status-notice strong {
  display: inline-block;
  margin-right: 8px;
}

.notice.joan-status-notice a {
  text-decoration: none;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(0, 115, 170, 0.1);
  border: 1px solid #0073aa;
  color: #0073aa;
  margin-left: 10px;
  transition: all 0.2s ease;
}

.notice.joan-status-notice a:hover {
  background: #0073aa;
  color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .joan-premium-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  
  .joan-premium-actions {
    justify-content: center;
  }
  
  .joan-notification {
    position: fixed;
    top: 32px;
    right: 10px;
    left: 10px;
    width: auto;
    min-width: auto;
    max-width: none;
  }
  
  .joan-form-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .joan-form-row input,
  .joan-form-row select {
    max-width: none;
    margin: 5px 0;
  }
  
  .joan-image-upload-inline {
    margin-left: 0;
    justify-content: center;
  }
  
  .joan-schedule-table {
    font-size: 14px;
  }
  
  .joan-schedule-table input,
  .joan-schedule-table select {
    max-width: 120px;
  }

  .joan-schedule-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Mobile admin bar adjustments */
  @media screen and (max-width: 782px) {
    .joan-notification {
      top: 46px; /* Mobile admin bar is taller */
    }
  }
}

@media (max-width: 600px) {
  .joan-notification {
    font-size: 14px;
    padding: 12px 16px;
  }
  
  .joan-notification .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
  }

  /* Mobile admin bar status indicator adjustments */
  #wp-admin-bar-joan-status .ab-item {
    font-size: 13px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .joan-admin-status-suspended #wp-admin-bar-joan-status .ab-item,
  .joan-admin-status-off_air #wp-admin-bar-joan-status .ab-item {
    border: 2px solid #000;
  }
}

/* Print styles - hide status indicators */
@media print {
  #wp-admin-bar-joan-status,
  .joan-status-indicator,
  .notice.joan-status-notice {
    display: none !important;
  }
}