/* =============================================
   AO Frontend - Version Professionnelle
   Design moderne et épuré
   ============================================= */

:root {
  --ao-primary: #2563eb;
  --ao-primary-dark: #1e40af;
  --ao-primary-light: #dbeafe;
  --ao-success: #10b981;
  --ao-warning: #f59e0b;
  --ao-danger: #ef4444;
  --ao-info: #06b6d4;
  --ao-gray-50: #f9fafb;
  --ao-gray-100: #f3f4f6;
  --ao-gray-200: #e5e7eb;
  --ao-gray-300: #d1d5db;
  --ao-gray-400: #9ca3af;
  --ao-gray-500: #6b7280;
  --ao-gray-600: #4b5563;
  --ao-gray-700: #374151;
  --ao-gray-800: #1f2937;
  --ao-gray-900: #111827;
  --ao-radius: 20px;
  --ao-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --ao-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --ao-shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --ao-shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --ao-transition: all 0.2s ease;
}

/* =============================================
   LOGIN CONTAINER
   ============================================= */
.ao-login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 2rem 1rem;
}

.ao-login-card {
  background: white;
  border-radius: var(--ao-radius);
  box-shadow: var(--ao-shadow-lg);
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.ao-login-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  color: var(--ao-primary);
}

.ao-login-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ao-gray-900);
}

.ao-login-card p {
  margin: 0 0 2rem;
  color: var(--ao-gray-600);
  font-size: 1rem;
  line-height: 1.6;
}

.ao-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  background: var(--ao-primary);
  color: white !important;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--ao-transition);
  box-shadow: var(--ao-shadow-sm);
}

.ao-login-btn:hover {
  background: var(--ao-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--ao-shadow-md);
}

/* =============================================
   MAIN WRAPPER
   ============================================= */
.ao-my-list-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* =============================================
   HEADER
   ============================================= */
.ao-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.ao-header-content {
  flex: 1;
  min-width: 250px;
}

.ao-list-title {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ao-gray-900);
  letter-spacing: -0.025em;
}

.ao-list-subtitle {
  margin: 0;
  font-size: 1rem;
  color: var(--ao-gray-600);
  font-weight: 500;
}

.ao-header-actions {
  display: flex;
  gap: 0.75rem;
}

/* =============================================
   BUTTONS
   ============================================= */
.ao-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 100px;
  text-decoration: none;
  transition: var(--ao-transition);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.ao-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

.ao-btn-primary {
  background: var(--ao-primary);
  color: white !important;
  box-shadow: var(--ao-shadow-sm);
}

.ao-btn-primary:hover {
  background: var(--ao-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--ao-shadow-md);
}

/* =============================================
   CARD GRID
   ============================================= */
.ao-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* =============================================
   CARDS
   ============================================= */
.ao-card {
  position: relative;
  background: white;
  border-radius: var(--ao-radius);
  padding: 1.5rem;
  box-shadow: var(--ao-shadow);
  border: 1px solid var(--ao-gray-200);
  transition: var(--ao-transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ao-card:hover {
  box-shadow: var(--ao-shadow-lg);
  transform: translateY(-2px);
  border-color: var(--ao-gray-300);
}

.ao-card-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
}

.ao-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.ao-card-logo {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ao-gray-100);
  border: 2px solid var(--ao-gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ao-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ao-card-initials {
  background: linear-gradient(135deg, var(--ao-primary), var(--ao-primary-dark));
  border-color: transparent;
}

.ao-card-initials span {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
}

.ao-card-header-text {
  flex: 1;
  min-width: 0;
  padding-right: 3rem;
}

.ao-card-title {
  margin: 0 0 0.375rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ao-gray-900);
}

.ao-card-title a {
  color: inherit;
  text-decoration: none;
  transition: var(--ao-transition);
}

.ao-card-title a:hover {
  color: var(--ao-primary);
}

.ao-card-type {
  font-size: 0.875rem;
  color: var(--ao-gray-600);
  font-weight: 500;
}

/* =============================================
   BADGES
   ============================================= */
.ao-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.ao-badge-success {
  background: #d1fae5;
  color: #065f46;
}

.ao-badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.ao-badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.ao-badge-info {
  background: #cffafe;
  color: #164e63;
}

.ao-badge-draft {
  background: var(--ao-gray-200);
  color: var(--ao-gray-700);
}

.ao-badge-secondary {
  background: #e0e7ff;
  color: #3730a3;
}

.ao-badge-default {
  background: var(--ao-gray-100);
  color: var(--ao-gray-600);
}

/* =============================================
   META ITEMS
   ============================================= */
.ao-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--ao-gray-200);
  border-bottom: 1px solid var(--ao-gray-200);
}

.ao-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--ao-gray-700);
}

.ao-meta-item svg {
  width: 18px;
  height: 18px;
  color: var(--ao-gray-500);
  stroke-width: 2;
  flex-shrink: 0;
}

.ao-meta-item em {
  font-style: normal;
  font-weight: 600;
  color: var(--ao-warning);
}

.ao-meta-item.urgent {
  color: var(--ao-danger);
  font-weight: 600;
}

.ao-meta-item.urgent svg {
  color: var(--ao-danger);
}

/* =============================================
   ALERTS
   ============================================= */
.ao-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.ao-alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-width: 2;
}

.ao-alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.ao-alert-danger svg {
  color: #dc2626;
}

.ao-alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.ao-alert-warning svg {
  color: #f59e0b;
}

/* =============================================
   CARD ACTIONS
   ============================================= */
.ao-card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.ao-btn-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: var(--ao-transition);
  border: 1px solid var(--ao-gray-300);
  background: white;
  color: var(--ao-gray-700);
}

.ao-btn-action svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.ao-btn-action:hover {
  background: var(--ao-gray-50);
  border-color: var(--ao-gray-400);
  color: var(--ao-gray-900);
}

.ao-btn-edit:hover {
  background: var(--ao-primary-light);
  border-color: var(--ao-primary);
  color: var(--ao-primary-dark);
}

.ao-btn-view:hover {
  background: #f0fdf4;
  border-color: var(--ao-success);
  color: #065f46;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.ao-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: var(--ao-radius);
  box-shadow: var(--ao-shadow);
  border: 2px dashed var(--ao-gray-300);
}

.ao-empty-state svg {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  color: var(--ao-gray-400);
  stroke-width: 1.5;
}

.ao-empty-state h3 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ao-gray-900);
}

.ao-empty-state p {
  margin: 0 0 2rem;
  color: var(--ao-gray-600);
  font-size: 1rem;
}

/* =============================================
   PAGINATION
   ============================================= */
.ao-pagination {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ao-gray-200);
}

.ao-pagination-list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.ao-pagination-list li {
  list-style: none;
}

.ao-pagination a,
.ao-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: var(--ao-transition);
  border: 1px solid var(--ao-gray-300);
  background: white;
  color: var(--ao-gray-700);
  gap: 0.375rem;
}

.ao-pagination a svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.ao-pagination a:hover {
  background: var(--ao-gray-50);
  border-color: var(--ao-gray-400);
  color: var(--ao-gray-900);
  transform: translateY(-1px);
}

.ao-pagination .current {
  background: var(--ao-primary);
  border-color: var(--ao-primary);
  color: white;
  cursor: default;
}

.ao-pagination .dots {
  border: none;
  background: transparent;
  color: var(--ao-gray-500);
  cursor: default;
}

/* =============================================
   LOADER OVERLAY
   ============================================= */
.ao-loader-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(4px);
  z-index: 99999;
  animation: ao-fadeIn 0.2s ease;
}

@keyframes ao-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ao-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: ao-scaleIn 0.3s ease;
}

@keyframes ao-scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.ao-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid var(--ao-gray-200);
  border-top-color: var(--ao-primary);
  animation: ao-spin 0.8s linear infinite;
}

@keyframes ao-spin {
  to {
    transform: rotate(360deg);
  }
}

.ao-loader-box p {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ao-gray-700);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .ao-my-list-wrapper {
    padding: 1.5rem 0.75rem;
  }

  .ao-list-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }

  .ao-header-actions {
    justify-content: stretch;
  }

  .ao-btn-primary {
    width: 100%;
    justify-content: center;
  }

  .ao-list-title {
    font-size: 1.75rem;
  }

  .ao-card-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .ao-card {
    padding: 1.25rem;
  }

  .ao-card-status {
    position: static;
    margin-bottom: 0.75rem;
  }

  .ao-card-header-text {
    padding-right: 0;
  }

  .ao-card-meta {
    flex-direction: column;
    gap: 0.75rem;
  }

  .ao-card-actions {
    flex-direction: column;
  }

  .ao-btn-action {
    width: 100%;
  }

  .ao-pagination-list {
    gap: 0.375rem;
  }

  .ao-pagination a,
  .ao-pagination span {
    min-width: 38px;
    height: 38px;
    padding: 0 0.625rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .ao-login-card {
    padding: 2rem 1.5rem;
  }

  .ao-card-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .ao-card-logo {
    width: 80px;
    height: 80px;
  }

  .ao-card-initials span {
    font-size: 1.5rem;
  }

  .ao-empty-state {
    padding: 3rem 1.5rem;
  }

  .ao-empty-state svg {
    width: 64px;
    height: 64px;
  }
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
  .ao-header-actions,
  .ao-card-actions,
  .ao-pagination,
  .ao-loader-overlay {
    display: none !important;
  }

  .ao-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .ao-my-list-wrapper {
    max-width: 100%;
  }
}

/* =============================================
   ACCESSIBILITY
   ============================================= */
.ao-btn:focus-visible,
.ao-btn-action:focus-visible,
.ao-pagination a:focus-visible {
  outline: 3px solid var(--ao-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================
   DARK MODE SUPPORT (optionnel)
   ============================================= */
@media (prefers-color-scheme: dark) {
  .ao-my-list-wrapper[data-theme="auto"] {
    --ao-gray-50: #111827;
    --ao-gray-100: #1f2937;
    --ao-gray-200: #374151;
    --ao-gray-300: #4b5563;
    --ao-gray-700: #d1d5db;
    --ao-gray-800: #e5e7eb;
    --ao-gray-900: #f9fafb;
  }

  .ao-my-list-wrapper[data-theme="auto"] .ao-card,
  .ao-my-list-wrapper[data-theme="auto"] .ao-empty-state,
  .ao-my-list-wrapper[data-theme="auto"] .ao-login-card {
    background: #1f2937;
    border-color: #374151;
  }

  .ao-my-list-wrapper[data-theme="auto"] .ao-card:hover {
    border-color: #4b5563;
  }
}







/* Styles pour le shortcode [ao_dates] */
.ao-dates {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.ao-dates .ao-published-date,
.ao-dates .ao-expires-date,
.ao-dates .ao-sep {
    line-height: 1;
}

/* État expiré pour attirer l'attention */
.ao-dates .ao-expires-date.expired {
    color: #d9534f; /* rouge doux */
    font-weight: 600;
}

/* Optionnel : style pour l'icône ou le séparateur */
.ao-dates .ao-sep { color: #666666; margin: 0 4px; }
