/* ============================================================
   FB Ads Pro Manager — Additional Styles
   Version: 2026.04.12
   ============================================================ */

/* Sub-tab transitions */
.fbadspro-sub-tab {
  transition: all 0.2s ease-in-out;
}

.fbadspro-sub-tab:hover {
  background-color: rgba(99, 102, 241, 0.1);
}

.fbadspro-sub-tab.active {
  background-color: white;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  color: #4f46e5;
  font-weight: 600;
}

/* Sub-page transitions */
.fbadspro-sub-page {
  transition: opacity 0.3s ease-in-out;
}

.fbadspro-sub-page.hidden {
  display: none !important;
}

/* Ensure page-fbadspro displays correctly when active */
#page-fbadspro {
  display: none;
}

#page-fbadspro.active {
  display: block;
}

/* Status badges */
.status-badge {
  @apply text-xs px-2 py-1 rounded-full font-medium;
}

.status-active {
  @apply bg-green-100 text-green-700;
}

.status-paused {
  @apply bg-yellow-100 text-yellow-700;
}

.status-error {
  @apply bg-red-100 text-red-700;
}

.status-disabled {
  @apply bg-gray-100 text-gray-700;
}

.status-banned {
  @apply bg-red-700 text-white;
}

/* Card hover effects */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Progress bar animation */
.progress-bar {
  transition: width 0.5s ease-in-out;
}

/* Table row hover */
table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.05);
}

/* Sync indicator pulse */
@keyframes sync-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.syncing {
  animation: sync-pulse 1.5s ease-in-out infinite;
}

/* Alert animations */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-item {
  animation: slideInRight 0.3s ease-out;
}

/* Employee card */
.employee-card {
  transition: all 0.2s ease;
}

.employee-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 2px 8px 0 rgba(99, 102, 241, 0.1);
}

/* Queue status colors */
.queue-pending {
  @apply text-yellow-600;
}

.queue-running {
  @apply text-blue-600;
}

.queue-completed {
  @apply text-green-600;
}

.queue-failed {
  @apply text-red-600;
}

/* Chart container */
.chart-container {
  position: relative;
  width: 100%;
}

/* KPI card number formatting */
.kpi-value {
  @apply text-2xl font-bold text-gray-900;
}

.kpi-label {
  @apply text-xs text-gray-500 font-medium;
}

.kpi-sublabel {
  @apply text-xs text-gray-400 mt-1;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
  
  .fbadspro-sub-tab {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Loading spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 0.6s linear infinite;
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 11px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
  margin-bottom: 4px;
}

/* Modal backdrop (for future modals) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Rules builder (for future modal) */
.rule-condition {
  @apply flex items-center gap-2 p-3 bg-gray-50 rounded-lg;
}

.rule-condition select,
.rule-condition input {
  @apply text-sm border border-gray-200 rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-indigo-300;
}

/* Payment status badges */
.payment-completed {
  @apply bg-green-100 text-green-700;
}

.payment-pending {
  @apply bg-yellow-100 text-yellow-700;
}

.payment-failed {
  @apply bg-red-100 text-red-700;
}

/* Account health indicator */
.health-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.health-active {
  @apply bg-green-500;
}

health-warning {
  @apply bg-yellow-500;
}

.health-error {
  @apply bg-red-500;
}

/* Sync frequency badge */
.sync-badge {
  @apply text-xs px-2 py-1 rounded-full font-medium;
}

.sync-fast {
  @apply bg-green-100 text-green-700;
}

.sync-normal {
  @apply bg-blue-100 text-blue-700;
}

.sync-slow {
  @apply bg-yellow-100 text-yellow-700;
}

/* Priority indicator */
.priority-high {
  @apply text-red-600 font-semibold;
}

.priority-normal {
  @apply text-green-600;
}

/* Fade-in animation for page transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Print styles */
@media print {
  .fbadspro-sub-tab,
  button {
    display: none;
  }
  
  .fbadspro-sub-page {
    display: block !important;
    page-break-inside: avoid;
  }
}
