/* frontend/css/ticket-editor.css - Styles spécifiques à l'éditeur 3 volets */

.editor-container {
  display: flex;
  height: calc(100vh - 70px);
  overflow: hidden;
  background: #0B132B;
}

/* Volet Gauche - Outils & Composants */
.editor-sidebar-left {
  width: 320px;
  background: #1C2541;
  color: #F8FAFC;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.panel-section {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-section-title {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cgeup-gold);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--cgeup-gold);
  color: #FFF;
}

.tool-btn .icon {
  font-size: 1.25rem;
}

/* Volet Central - Scène de visualisation en direct */
.editor-stage {
  flex: 1;
  background: #080D1A;
  background-image: radial-gradient(rgba(212, 175, 55, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 30px;
  overflow: auto;
  position: relative;
}

.stage-toolbar {
  background: rgba(28, 37, 65, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 8px 18px;
  border-radius: 30px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #E2E8F0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.stage-toolbar select, .stage-toolbar button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFF;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Le Billet d'invitation (Zone WYSIWYG) */
.ticket-wrapper {
  position: relative;
  transition: transform 0.2s ease;
}

.ticket-canvas {
  width: 860px;
  height: 480px;
  background: linear-gradient(135deg, #0A192F 0%, #142848 100%);
  border-radius: 12px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 55, 0.4);
  overflow: hidden;
  display: flex;
  color: #FFFFFF;
  user-select: none;
}

/* Variations de format */
.ticket-canvas.format-portrait {
  width: 480px;
  height: 720px;
  flex-direction: column;
}

.ticket-canvas.format-vip {
  background: linear-gradient(135deg, #181206 0%, #2A1F0B 50%, #140E04 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 2px #F59E0B;
}

/* Cadre or festonné */
.ticket-border-frame {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border: 2px solid var(--cgeup-gold);
  border-radius: 8px;
  pointer-events: none;
  z-index: 5;
}

.ticket-border-inner {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  bottom: 18px;
  border: 1px dashed rgba(212, 175, 55, 0.6);
  border-radius: 6px;
  pointer-events: none;
  z-index: 5;
}

/* Coins ornementaux */
.corner-ornament {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--cgeup-gold);
  border-style: solid;
  pointer-events: none;
  z-index: 6;
}
.corner-tl { top: 10px; left: 10px; border-width: 3px 0 0 3px; }
.corner-tr { top: 10px; right: 10px; border-width: 3px 3px 0 0; }
.corner-bl { bottom: 10px; left: 10px; border-width: 0 0 3px 3px; }
.corner-br { bottom: 10px; right: 10px; border-width: 0 3px 3px 0; }

/* Corps principal du billet */
.ticket-main-body {
  flex: 1;
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 8;
}

/* Bande latérale détachable (Stub QR Code) */
.ticket-stub {
  width: 220px;
  border-left: 2px dashed rgba(212, 175, 55, 0.5);
  background: rgba(0, 0, 0, 0.25);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  position: relative;
  z-index: 8;
}

.ticket-canvas.format-portrait .ticket-stub {
  width: 100%;
  height: 180px;
  border-left: none;
  border-top: 2px dashed rgba(212, 175, 55, 0.5);
  flex-direction: row;
}

/* En-tête des logos officiels */
.ticket-header-logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.ticket-logo {
  height: 44px;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Éléments éditables dans le billet */
.editable-field {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 6px;
  transition: all 0.15s ease;
  position: relative;
}

.editable-field:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.5);
}

.editable-field.selected {
  background: rgba(212, 175, 55, 0.25);
  border: 1px solid var(--cgeup-gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.ticket-subheading {
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cgeup-gold);
  text-align: center;
  margin-bottom: 4px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

.ticket-title {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  color: #FFFFFF;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.ticket-academic-year {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--cgeup-gold);
  text-align: center;
  margin-bottom: 14px;
  letter-spacing: 1px;
}

.ticket-patron-block {
  text-align: center;
  margin-bottom: 12px;
}

.ticket-patron-intro {
  font-size: 0.72rem;
  font-style: italic;
  color: #CBD5E1;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ticket-patron-name {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFF;
  margin-top: 2px;
}

/* Cadre du Destinataire Invité */
.ticket-guest-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  padding: 8px 16px;
  text-align: center;
  margin: 8px 0;
}

.ticket-guest-label {
  font-size: 0.68rem;
  color: var(--cgeup-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.ticket-guest-name {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFF;
  letter-spacing: 0.5px;
}

.ticket-guest-title {
  font-size: 0.75rem;
  color: #CBD5E1;
}

/* Infos logistiques (Date, Heure, Lieu) */
.ticket-details-row {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding: 8px 0;
  margin-top: 8px;
}

.ticket-detail-item {
  text-align: center;
}

.ticket-detail-label {
  font-size: 0.65rem;
  color: var(--cgeup-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ticket-detail-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFF;
}

/* Stub elements */
.stub-qr-code {
  background: #FFF;
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  display: inline-block;
}

.stub-qr-code canvas, .stub-qr-code img {
  display: block;
}

.stub-code-text {
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cgeup-gold);
  margin-top: 8px;
}

.stub-category-badge {
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--cgeup-gold);
  color: var(--cgeup-gold-light);
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Volet Droit - Propriétés de l'élément sélectionné */
.editor-sidebar-right {
  width: 320px;
  background: #1C2541;
  color: #F8FAFC;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.prop-field {
  margin-bottom: 14px;
}

.prop-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94A3B8;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prop-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFF;
  font-size: 0.85rem;
  outline: none;
}

.prop-input:focus {
  border-color: var(--cgeup-gold);
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 2px solid #FFF;
  cursor: pointer;
  padding: 0;
  background: transparent;
}

/* Responsive Editeur */
@media (max-width: 1200px) {
  .editor-sidebar-left, .editor-sidebar-right {
    width: 260px;
  }
}
