/* Ali Remote panel */

.ar-layout {
  min-height: 100vh;
  background: var(--bg-0, #0f0a0c);
  color: var(--text, #f4d3b5);
  display: flex;
  flex-direction: column;
}
.ar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--bg-2, #1f1518);
  background: var(--bg-1, #150d10);
}
.ar-brand {
  font-size: 16px;
  font-weight: 600;
}
.ar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-mute, #888);
}
.ar-modelos {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--bg-2);
  background: var(--bg-1);
  flex-wrap: wrap;
}
.ar-modelo-btn {
  background: transparent;
  border: 1px solid var(--bg-2);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}
.ar-modelo-btn:hover { border-color: var(--coral-light, #e89c6e); }
.ar-modelo-btn.active {
  background: var(--coral-light, #e89c6e);
  color: #2a0f10;
  border-color: var(--coral-light, #e89c6e);
}
.ar-stats {
  display: flex;
  gap: 10px;
  padding: 14px 24px;
  flex-wrap: wrap;
}
.stat-box {
  background: var(--bg-1);
  border: 1px solid var(--bg-2);
  border-radius: 10px;
  padding: 12px 18px;
  min-width: 160px;
}
.stat-box .stat-label {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-box .stat-value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 2px;
}
.ar-main {
  flex: 1;
  padding: 12px 24px 100px;
}
.ar-empty {
  text-align: center;
  color: var(--text-mute);
  padding: 60px 20px;
}
.ar-loading, .ar-error {
  padding: 40px;
  text-align: center;
  color: var(--text-mute);
}
.ar-error { color: #e88080; }
.ar-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 8px 0 12px;
}
.ar-section-head h3 { margin: 0; font-size: 18px; }
.muted { color: var(--text-mute, #888); font-size: 12px; font-weight: 400; }

.ar-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 100px;
}
.ar-column {
  background: var(--bg-1);
  border: 1px solid var(--bg-2);
  border-radius: 10px;
  padding: 14px;
}
.ar-column h4 {
  margin: 0 0 4px;
  font-size: 15px;
}
.ar-tip {
  font-size: 11px;
  color: var(--text-mute);
  margin-bottom: 10px;
}
.ar-reels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.ar-reel-card {
  position: relative;
  border-radius: 10px;
  border: 3px solid transparent;
  background: var(--bg-2, #1f1518);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.05s;
}
.ar-reel-card:active { transform: scale(0.98); }
.ar-reel-card.selected-1 {
  border-color: #4caf50;
  box-shadow: 0 0 0 1px rgba(76, 175, 80, .35), 0 6px 18px rgba(76, 175, 80, .2);
}
.ar-reel-card.selected-2 {
  border-color: #e89c6e;
  box-shadow: 0 0 0 1px rgba(232, 156, 110, .4), 0 6px 18px rgba(232, 156, 110, .25);
}
.ar-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: linear-gradient(135deg, #1a1014, #0c0709);
  cursor: pointer;
}
/* Thumbnail estático (imagen ligera) — lo que se ve por defecto */
.ar-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ar-thumb.thumb-failed {
  opacity: 0;  /* si Drive no tiene thumb, queda el fondo degradado */
}
/* Vídeo real: solo existe cuando le das play */
.ar-video-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
  z-index: 6;
}
.ar-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  padding-left: 4px;
  transition: background 0.15s, transform 0.1s;
}
.ar-play-btn:hover { background: rgba(232, 156, 110, 0.9); }
.ar-play-btn:active { transform: translate(-50%, -50%) scale(0.92); }
.ar-video-wrap.playing .ar-play-btn,
.ar-video-wrap.playing .ar-thumb { display: none; }
.ar-sel-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 4;
}
.ar-sel-1 { background: #4caf50; }
.ar-sel-2 { background: #e89c6e; color: #2a0f10; }
.ar-reel-card.selected-1 .ar-sel-1 { display: flex; }
.ar-reel-card.selected-2 .ar-sel-2 { display: flex; }

.ar-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 5;
}
.ar-reel-card:hover .ar-card-actions { opacity: 1; }
.ar-mini-btn {
  width: 28px; height: 28px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ar-mini-btn:hover { background: rgba(232, 156, 110, 0.85); }

/* Footer fijo */
.ar-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-1);
  border-top: 1px solid var(--bg-2);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
}
.ar-counts {
  font-size: 14px;
}
.ar-counts strong {
  color: var(--coral-light, #e89c6e);
  font-size: 18px;
  margin: 0 4px;
}
.ar-actions {
  display: flex;
  gap: 8px;
}

/* Toast */
#ar-toast-host {
  position: fixed;
  top: 70px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 100;
  pointer-events: none;
}
.ar-toast {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  max-width: 380px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.ar-toast.success { background: rgba(120, 200, 120, 0.95); color: #073007; }
.ar-toast.error   { background: rgba(220, 90, 90, 0.95); color: white; }

@media (max-width: 900px) {
  .ar-columns { grid-template-columns: 1fr; }
  .ar-footer { flex-direction: column; align-items: stretch; }
  .ar-actions { justify-content: stretch; }
  .ar-actions .btn-admin { flex: 1; }
}
