/* components.css */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  gap: var(--space-2);
  line-height: 1.2;
  /* Default sizing (equivalent to btn--md) */
  padding: 14px 28px;
  font-size: var(--fs-base);
}

.btn:hover {
  opacity: 1; /* Override global a:hover opacity */
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Button Variants */
.btn--primary {
  background-color: var(--color-cta-primary);
  color: var(--color-white);
}

.btn--primary:hover:not(:disabled) {
  background-color: var(--color-cta-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(27, 58, 75, 0.2);
}

/* Shimmer Variant */
.btn--shimmer {
  position: relative;
  overflow: hidden;
  background-color: var(--color-bleu-nuit);
  color: var(--color-white);
  border: none;
}

.btn--shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.08) 35%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.08) 65%,
    transparent 80%
  );
  animation: globalShimmerLoop 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes globalShimmerLoop {
  0%   { transform: translateX(-150%) skewX(-20deg); }
  30%  { transform: translateX(250%) skewX(-20deg); }
  100% { transform: translateX(250%) skewX(-20deg); }
}

.btn--shimmer:hover {
  background-color: #0f252f;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(27, 58, 75, 0.3);
}

.btn--secondary {
  background-color: var(--color-cta-secondary-bg);
  color: var(--color-bleu-nuit);
}

.btn--secondary:hover:not(:disabled) {
  background-color: var(--color-cta-secondary-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(135, 196, 204, 0.3);
}

.btn--ghost {
  background-color: transparent;
  color: var(--color-bleu-nuit);
  border-color: var(--color-bleu-nuit);
  border-width: 2px;
}

.btn--ghost:hover:not(:disabled) {
  background-color: var(--color-bleu-nuit);
  color: var(--color-white);
  transform: translateY(-2px);
}

.btn--ghost-white {
  background-color: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
  border-width: 2px;
}

.btn--ghost-white:hover:not(:disabled) {
  background-color: var(--color-white);
  color: var(--color-bleu-nuit);
  transform: translateY(-2px);
}

.btn--link {
  background-color: transparent;
  color: var(--color-ambre-chaleur);
  padding: 0;
  border-radius: 0;
}

.btn--link:hover:not(:disabled) {
  text-decoration: underline;
  opacity: 1;
}

/* Button Sizes */
.btn--sm {
  padding: 10px 20px;
  font-size: var(--fs-sm);
}

.btn--md {
  padding: 14px 28px;
  font-size: var(--fs-base);
}

.btn--lg {
  padding: 18px 40px;
  font-size: 1.125rem;
}

/* Specific override for Mon espace CTA */
.btn--espace:hover:not(:disabled) {
  background-color: transparent !important;
  color: var(--color-bleu-nuit) !important;
  border-color: var(--color-bleu-nuit) !important;
  box-shadow: none !important;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag--certification {
  background-color: var(--color-gray-100);
  color: var(--color-bleu-nuit);
}

.tag--rse {
  background-color: rgba(45, 148, 104, 0.1);
  color: var(--color-success);
}

.tag--inclusion {
  background-color: rgba(245, 184, 74, 0.15);
  color: var(--color-warning);
}

/* Cards */
.card-base {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-base:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
  max-width: 800px;
  margin-inline: auto;
}

.section-header__title {
  margin-bottom: var(--space-4);
}

.section-header__subtitle {
  font-size: var(--fs-md);
  color: var(--color-gray-400);
  line-height: var(--lh-relaxed);
  max-width: 800px;
  margin: var(--space-4) auto 0;
  text-align: center;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-4);
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  margin-bottom: var(--space-2);
  color: var(--color-bleu-nuit);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  color: var(--color-gray-800);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-bleu-nuit);
  box-shadow: 0 0 0 3px rgba(27, 58, 75, 0.1);
}

.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--color-error);
}

.form-helper {
  font-size: var(--fs-xs);
  color: var(--color-gray-600);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--fs-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--color-gray-600);
  margin-bottom: var(--space-6);
}

.breadcrumb a {
  color: inherit;
}

.breadcrumb a:hover {
  color: var(--color-bleu-nuit);
}

.breadcrumb-separator {
  color: var(--color-gray-400);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(27, 58, 75, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.is-open .modal-content {
  transform: translateY(0);
}

/* Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(27, 58, 75, 0.5);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-content {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background-color: var(--color-white);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer-overlay.is-open .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

/* Chatbot Widget Placeholder */
.chatbot-widget {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 900;
}

.chatbot-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--color-bleu-nuit);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform 0.25s ease;
  border: none;
}

.chatbot-btn:hover {
  transform: scale(1.05);
}

.chatbot-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 360px;
  height: 500px;
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chatbot-widget.is-open .chatbot-panel {
  display: flex;
}

/* Sticky Utility Bar */
.sticky-utility-bar {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 800;
  display: flex;
  flex-direction: column;
  background-color: var(--color-white);
  box-shadow: -4px 0 20px rgba(27, 58, 75, 0.12);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  overflow: hidden;
  width: 56px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-utility-bar:hover {
  width: 220px;
}

.sticky-utility-item {
  display: flex;
  align-items: center;
  height: 56px;
  min-width: 220px; /* Force internal width for content alignment */
  color: var(--color-bleu-nuit);
  border-bottom: 1px solid var(--color-gray-100);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 0 18px; /* Alignment for the icon */
}

.sticky-utility-item:last-child {
  border-bottom: none;
}

.sticky-utility-item svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.sticky-utility-item:hover {
  background-color: var(--color-bleu-nuit);
  color: var(--color-white);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  opacity: 1; /* Override global a:hover opacity */
}

.sticky-utility-item:hover svg {
  color: var(--color-ambre-chaleur);
  transform: scale(1.1);
}

.sticky-utility-label {
  margin-left: 16px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.sticky-utility-bar:hover .sticky-utility-label {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.1s;
}

@media (max-width: 768px) {
  .sticky-utility-bar {
    display: none;
  }
}
