/* 
  ========================================
  Back to Top Button - Enhanced with Original Colors
  ========================================
*/

/* 1. Custom Properties using YOUR original colors */
:root {
  --btt-size: 50px;
  --btt-bg-start: #0F122A;
  --btt-bg-end: #6C7A89;
  --btt-text-color: #E7E0D8;
  --btt-border-color: rgba(231, 224, 216, 0.3);
  --btt-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  
  /* Hover state colors */
  --btt-bg-hover-start: #6C7A89;
  --btt-bg-hover-end: #AC9D8D;
  --btt-border-hover-color: rgba(231, 224, 216, 0.6);
  --btt-shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.3);

  --btt-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Base Button Styles */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: var(--btt-size);
  height: var(--btt-size);
  border-radius: 50%;
  
  /* Use variables for colors and effects */
  background: linear-gradient(135deg, var(--btt-bg-start), var(--btt-bg-end));
  color: var(--btt-text-color);
  border: 2px solid var(--btt-border-color);
  box-shadow: var(--btt-shadow);
  
  /* Reset default button styles and setup layout */
  appearance: none;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;

  /* Initial hidden state */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  
  /* Smooth transitions for all state changes */
  transition: var(--btt-transition);
  z-index: 900;
}

/* 3. Visible State */
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 4. Hover State */
.back-to-top:hover {
  background: linear-gradient(135deg, var(--btt-bg-hover-start), var(--btt-bg-hover-end));
  box-shadow: var(--btt-shadow-hover);
  border-color: var(--btt-border-hover-color);
  transform: translateY(-3px); /* Adds a little lift */
}

/* 5. Active (Pressed) State */
.back-to-top:active {
  transform: translateY(-1px) scale(0.95); /* Scale down for tactile feedback */
  box-shadow: var(--btt-shadow);
}

/* 6. Focus State for Keyboard Navigation */
.back-to-top:focus-visible {
  outline: 2px dashed var(--btt-text-color);
  outline-offset: 4px;
}

/* 7. SVG Icon Styling */
.back-to-top svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease-in-out;
}

/* Animate the icon on hover */
.back-to-top:hover svg {
  transform: translateY(-2px);
}