/*
 * 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.
 */

.phase-start-of-turn { background-color: #000000 !important; color: white !important; }
.phase-hero { background-color: #f2bc18 !important; color: black !important; }
.phase-movement { background-color: #b0b0b0 !important; color: black !important; }
.phase-shooting { background-color: #2185c5 !important; color: white !important; }
.phase-charge { background-color: #e56e25 !important; color: white !important; }
.phase-combat { background-color: #c8102e !important; color: white !important; }
.phase-end-of-turn { background-color: #5b367e !important; color: white !important; }
.phase-passive { background-color: #6c757d !important; color: white !important; }
.phase-any-phase { background-color: #343a40 !important; color: white !important; }
.phase-deployment { background-color: #34495e !important; color: white !important; }
.phase-special { background-color: #495057 !important; color: white !important; }

/* Active states for sidebar */
.border-transparent { border-color: transparent !important; }

.list-group-item.active.phase-start-of-turn { background-color: #000000 !important; border-color: #000000 !important; }
.list-group-item.active.phase-hero { background-color: #f2bc18 !important; border-color: #f2bc18 !important; color: black !important; }
.list-group-item.active.phase-movement { background-color: #b0b0b0 !important; border-color: #b0b0b0 !important; color: black !important; }
.list-group-item.active.phase-shooting { background-color: #2185c5 !important; border-color: #2185c5 !important; }
.list-group-item.active.phase-charge { background-color: #e56e25 !important; border-color: #e56e25 !important; }
.list-group-item.active.phase-combat { background-color: #c8102e !important; border-color: #c8102e !important; }
.list-group-item.active.phase-end-of-turn { background-color: #5b367e !important; border-color: #5b367e !important; }
.list-group-item.active.phase-deployment { background-color: #34495e !important; border-color: #34495e !important; }
.list-group-item.active.phase-special { background-color: #495057 !important; border-color: #495057 !important; }

/* Border colors for ability cards */
.border-phase-start-of-turn { border-color: #000000 !important; border-width: 2px !important; }
.border-phase-hero { border-color: #f2bc18 !important; border-width: 2px !important; }
.border-phase-movement { border-color: #b0b0b0 !important; border-width: 2px !important; }
.border-phase-shooting { border-color: #2185c5 !important; border-width: 2px !important; }
.border-phase-charge { border-color: #e56e25 !important; border-width: 2px !important; }
.border-phase-combat { border-color: #c8102e !important; border-width: 2px !important; }
.border-phase-end-of-turn { border-color: #5b367e !important; border-width: 2px !important; }
.border-phase-deployment { border-color: #34495e !important; border-width: 2px !important; }
.border-phase-special { border-color: #495057 !important; border-width: 2px !important; }

/* Text colors for headers */
.text-phase-start-of-turn { color: #000000 !important; }
.text-phase-hero { color: #d4a017 !important; } /* Darker yellow for text readability */
.text-phase-movement { color: #808080 !important; } /* Darker gray for text readability */
.text-phase-shooting { color: #2185c5 !important; }
.text-phase-charge { color: #e56e25 !important; }
.text-phase-combat { color: #c8102e !important; }
.text-phase-end-of-turn { color: #5b367e !important; }
.text-phase-deployment { color: #34495e !important; }
.text-phase-special { color: #495057 !important; }

/* Phase Selector Styles */
.phase-selector {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 5px 0 15px 0; /* Reduced top padding, kept bottom for shadow/border */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.phase-selector::-webkit-scrollbar {
  display: none;
}

.phase-selector-track {
  display: flex;
  align-items: stretch;
  gap: 0; /* No gaps between boxes */
  padding: 0 50%; /* Allow first and last items to be centered */
  height: 48px;
}

.phase-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  height: 100%;
  padding: 0 12px;
  border-radius: 0; /* Square boxes */
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: min-width 0.4s ease-in-out, 
              padding 0.4s ease-in-out, 
              opacity 0.3s ease, 
              border-bottom-width 0.2s ease;
  will-change: min-width, padding;
  opacity: 0.3;
  box-shadow: none;
  scroll-snap-align: center;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.05);
  border-bottom: 0 solid transparent;
}

.phase-item:first-child {
  border-left: 1px solid rgba(255,255,255,0.05);
}

.phase-item:hover {
  opacity: 0.6;
  color: inherit;
}

.phase-item.active {
  opacity: 1;
  min-width: 180px;
  padding: 0 25px;
  font-weight: 700;
  z-index: 2;
  border-bottom: 4px solid rgba(255,255,255,0.8);
}

.phase-item .phase-name {
  white-space: nowrap;
}

/* Active states for phase background colors */
.phase-item.active.phase-hero { background-color: #f2bc18 !important; color: black !important; border-bottom-color: rgba(0,0,0,0.5); }
.phase-item.active.phase-movement { background-color: #b0b0b0 !important; color: black !important; border-bottom-color: rgba(0,0,0,0.5); }
.phase-item.active.phase-shooting { background-color: #2185c5 !important; color: white !important; border-bottom-color: rgba(255,255,255,0.5); }
.phase-item.active.phase-charge { background-color: #e56e25 !important; color: white !important; border-bottom-color: rgba(255,255,255,0.5); }
.phase-item.active.phase-combat { background-color: #c8102e !important; color: white !important; border-bottom-color: rgba(255,255,255,0.5); }
.phase-item.active.phase-end-of-turn { background-color: #5b367e !important; color: white !important; border-bottom-color: rgba(255,255,255,0.5); }
.phase-item.active.phase-start-of-turn { background-color: #000000 !important; color: white !important; border-bottom-color: rgba(255,255,255,0.5); }
.phase-item.active.phase-deployment { background-color: #34495e !important; color: white !important; border-bottom-color: rgba(255,255,255,0.5); }
.phase-item.active.phase-passive { background-color: #6c757d !important; color: white !important; border-bottom-color: rgba(255,255,255,0.5); }

/* Offcanvas Warscroll Sidebar Styles */
.offcanvas-warscrolls {
  width: 400px !important;
}

.offcanvas-body .list-group-item {
  background-color: transparent;
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}

.offcanvas-body .list-group-item-action:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: white;
}

.offcanvas-body .list-group-item.text-muted {
  color: rgba(255, 255, 255, 0.4) !important;
}

.offcanvas-body .list-group-item.bg-light {
  background-color: rgba(0, 0, 0, 0.2) !important;
}

/* Scroll Highlight Effect */
@keyframes highlight-fade {
  0% { box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.5); border-color: #ffc107; }
  100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); border-color: inherit; }
}

.highlight-scroll {
  animation: highlight-fade 2s ease-out;
  border-width: 2px !important;
  z-index: 10;
  position: relative;
}

.cursor-pointer {
  cursor: pointer;
}

#play-top-bar-container [data-top-bar-target="content"] {
  transition: all 0.3s ease-in-out;
}

@media (max-width: 767.98px) {
  #play-top-bar-container h5 {
    font-size: 1rem;
  }
  
  #play-top-bar-container .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
  }

  .phase-item {
    min-width: 80px;
    font-size: 0.75rem;
    padding: 0 8px;
  }
  
  .phase-item.active {
    min-width: 130px;
    padding: 0 15px;
  }

  .phase-selector-track {
    height: 38px;
  }
}
