/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ========== CHARTE GRAPHIQUE — Les Échos ========== */
:root {
  /* Flipbook reader */
  --bg-dark: #0f0f0f;
  --accent: #3b82f6;
  --text-main: #e5e5e5;
  --text-muted: #a3a3a3;

  /* Charte graphique */
  --primary-blue: #0C124D;
  --secondary-purple: #3409B1;
  --accent-teal: #0A4D68;
  --accent-green: #0C4A0A;
  --white: #FFFFFF;
  --light-gray: #F8F9FA;
  --gold: #FFD700;
  --brand-gradient: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-purple) 100%);
}

/* ========== SURCHARGE BOOTSTRAP bg-dark / btn-dark / table-dark ========== */
/* On garde les noms Bootstrap mais on les remplace par la charte */

.bg-dark,
.card-header.bg-dark,
.navbar.bg-dark {
  background: var(--brand-gradient) !important;
  color: var(--white) !important;
}

.btn-dark {
  background: var(--brand-gradient) !important;
  border-color: var(--primary-blue) !important;
  color: var(--white) !important;
}

.btn-dark:hover,
.btn-dark:focus {
  background: linear-gradient(135deg, #161c6e 0%, #4a0fd4 100%) !important;
  border-color: var(--secondary-purple) !important;
  color: var(--white) !important;
}

.btn-outline-dark {
  color: var(--primary-blue) !important;
  border-color: var(--primary-blue) !important;
}

.btn-outline-dark:hover {
  background: var(--brand-gradient) !important;
  border-color: var(--primary-blue) !important;
  color: var(--white) !important;
}

.table-dark,
.table-dark th,
.table-dark td {
  background: var(--brand-gradient) !important;
  color: var(--white) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

.table thead.table-dark th {
  background: var(--accent-green) !important;
  color: var(--white) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

/* Badge secondary → couleur charte */
.badge.bg-secondary {
  background: var(--accent-teal) !important;
}

/* Liens en charte */
a {
  color: var(--secondary-purple);
}
a:hover {
  color: var(--primary-blue);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background-color: var(--bg-dark);
  background-image: radial-gradient(circle at 50% 50%, #1a1a1a 0%, #000000 100%);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  height: 50px;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.brand {
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  
  span { color: var(--accent); }
}

.toolbar {
  display: flex;
  gap: 4px;
}

.btn-tool {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  
  &:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
  }
  
  &:active {
    transform: scale(0.95);
  }
  
  svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
  }
}

.btn-tool.active-audio {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.15);
  
  &::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
  }
}

/* Stage */
#stage {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 2500px;
  overflow: hidden;
}

#flipbook-wrapper {
  position: relative;
  background: transparent;
  transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
              height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.flipbook {
  position: relative;
  
  .page {
    background-color: #fff;
    box-shadow: none;
    border-radius: 0;
    overflow: hidden;
    
    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      pointer-events: none;
      user-select: none;
      display: block;
    }
  }
}

/* Navigation */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.9);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  pointer-events: none;
  
  &.visible {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
  }
  
  &:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.1);
  }
  
  svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
  }
}

.nav-prev { left: 30px; }
.nav-next { right: 30px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: #2a2a2a;
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-size: 14px;
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  
  &.show {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    height: 45px;
    padding: 0 10px;
  }
  
  .brand {
    font-size: 14px;
  }
  
  .btn-tool {
    width: 32px;
    height: 32px;
    
    svg {
      width: 16px;
      height: 16px;
    }
  }
  
  .nav-arrow {
    width: 40px;
    height: 40px;
    
    svg {
      width: 20px;
      height: 20px;
    }
  }
  
  .nav-prev { left: 10px; }
  .nav-next { right: 10px; }
}