/* ============================================
   CUES PRO - AMÉLIORATIONS ESTHÉTIQUES
   ============================================ */

/* Thème Light */
:root[data-theme="light"]{
  --bg:#f4f6f8;
  --card:#ffffff;
  --muted:#5b6472;
  --text:#1f2328;
  --line:#d7dde3;
  --pill:#eef1f4;
  --bg-elevated:#eef1f4;
  --line-soft:#d1d7df;
  --drop-border:#c3c9d2;
  --bg-app:#f4f6f8;
  --bg-panel:#ffffff;
  --bg-table-row:#eef1f4;
  --bg-timeline:#e9edf2;
  --accent:#3b82f6;
  --blue:#3b82f6;
  --red:#ef4444;
  --ok:#10b981;
  --warn:#f59e0b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
}

/* Améliorations panels */
.panel{
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.2));
  transition: all var(--transition, 200ms ease);
}

.panel:hover{
  box-shadow: var(--shadow-md, 0 4px 8px rgba(0,0,0,0.25));
  border-color: var(--line-soft);
}

/* Améliorations drop zone */
.drop:hover{
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.drop.drag-over{
  box-shadow: 0 0 20px rgba(42,170,85,0.2);
}

/* Améliorations table */
table{
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.2));
}

thead{
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 10;
}

th{
  user-select: none;
  transition: background var(--transition, 200ms ease);
}

th.sortable{
  cursor: pointer;
  position: relative;
}

th.sortable:hover{
  background: var(--card);
}

th.sortable::after{
  content: ' ⇅';
  opacity: 0.3;
  font-size: 10px;
}

th.sortable.asc::after{
  content: ' ↑';
  opacity: 1;
}

th.sortable.desc::after{
  content: ' ↓';
  opacity: 1;
}

tbody tr{
  transition: background var(--transition, 200ms ease);
}

tbody tr:hover{
  background: var(--card);
}

tbody tr.highlight{
  background: rgba(42,170,85,0.15);
  animation: highlightPulse 1s ease;
}

@keyframes highlightPulse {
  0%, 100% { background: var(--card); }
  50% { background: rgba(42,170,85,0.25); }
}

/* Highlight de recherche */
.search-highlight{
  background: rgba(245, 196, 0, 0.3);
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
}

/* Dashboard stats */
.stats-dashboard{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 14px);
  padding: var(--spacing-lg, 16px);
  margin-bottom: var(--spacing-lg, 16px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.2));
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg, 16px);
}

.stat-item{
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs, 4px);
}

.stat-label{
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-value{
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'SF Mono', 'Monaco', monospace;
}

.stat-icon{
  font-size: 20px;
  margin-bottom: var(--spacing-xs, 4px);
}
.stat-icon .dot{
  display: inline-block;
  width: 12px;
  height: 12px;
}

/* Toast notifications */
.toast-container{
  position: fixed;
  bottom: var(--spacing-xl, 24px);
  right: var(--spacing-xl, 24px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md, 12px);
  max-width: 400px;
}

.toast{
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md, 10px);
  padding: var(--spacing-lg, 16px);
  box-shadow: var(--shadow-lg, 0 8px 16px rgba(0,0,0,0.3));
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-md, 12px);
}

.toast.success{
  border-left-color: var(--ok);
}

.toast.error{
  border-left-color: var(--red);
}

.toast.warning{
  border-left-color: var(--warn);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Loading state */
.loading-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner{
  width: 48px;
  height: 48px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Help dialog */
.help-dialog{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.help-dialog.active{
  display: flex;
}

.help-content{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 14px);
  padding: var(--spacing-xl, 24px);
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg, 0 8px 16px rgba(0,0,0,0.3));
}

.help-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md, 12px);
  margin-bottom: var(--spacing-lg, 16px);
}

.help-header h2{
  margin: 0;
}

.help-section{
  margin-top: var(--spacing-lg, 16px);
}

.help-section h3{
  margin: 0 0 var(--spacing-sm, 8px) 0;
}

.help-footer{
  margin-top: var(--spacing-xl, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md, 12px);
  flex-wrap: wrap;
}

.help-meta{
  font-size: 12px;
  color: var(--muted);
}

.help-shortcuts{
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--spacing-md, 12px);
  margin-top: var(--spacing-lg, 16px);
}

.help-shortcuts dt{
  font-weight: 600;
  color: var(--accent);
}

.help-shortcuts dd{
  margin: 0;
  color: var(--text);
}

kbd{
  display: inline-block;
  padding: 2px 8px;
  background: var(--pill);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 6px);
  font-family: 'SF Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 2px 0 var(--line);
}

/* Tooltips améliorés */
[title]{
  cursor: help;
}

/* Copy feedback */
.copy-feedback{
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--ok);
  color: white;
  padding: var(--spacing-lg, 16px) var(--spacing-xl, 24px);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-lg, 0 8px 16px rgba(0,0,0,0.3));
  animation: fadeInOut 1.5s ease;
  z-index: 1001;
  pointer-events: none;
  font-weight: 600;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  20%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Icônes dans les boutons */
.btn-icon{
  font-size: 16px;
  margin-right: var(--spacing-xs, 4px);
}

/* Icônes dans les boutons */
.btn-icon{
  font-size: 16px;
  margin-right: var(--spacing-xs, 4px);
}

/* Bouton icon uniquement */
.icon-btn{
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
}

.icon-btn:hover{
  transform: scale(1.1);
}

/* Header controls */
.header-controls{
  display: flex;
  align-items: center;
  gap: var(--spacing-md, 12px);
}

/* Responsive améliorations */
@media (max-width: 768px) {
  .stats-dashboard{
    grid-template-columns: 1fr;
  }
  
  .toast-container{
    bottom: var(--spacing-md, 12px);
    right: var(--spacing-md, 12px);
    left: var(--spacing-md, 12px);
    max-width: none;
  }
  
  .help-content{
    margin: var(--spacing-md, 12px);
    max-width: calc(100% - 24px);
  }
}

/* Smooth scrolling */
html{
  scroll-behavior: smooth;
}

/* Selection color */
::selection{
  background: var(--accent);
  color: white;
}

/* Focus styles améliorés */
*:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
