/* Full-screen application layout */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  font-weight: 400;
}

.fullscreen-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.app-header {
  background: #1a1a1a;
  border-bottom: 2px solid #3a3a3a;
  padding: 16px 24px;
  flex-shrink: 0;
  z-index: 1000;
}

.header-content {
  max-width: 100%;
  margin: 0 auto;
}

.header-title {
  font-size: 1.5em;
  font-weight: 700;
  color: #ffd700;
  margin: 0 0 4px 0;
  font-family: 'Montserrat', sans-serif;
}

.header-subtitle {
  font-size: 0.9em;
  color: #b0b0b0;
  margin: 0;
  font-weight: 300;
  font-family: 'Montserrat', sans-serif;
}

/* Main content area */
.app-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
}

/* Footer */
.app-footer {
  background: #1a1a1a;
  border-top: 2px solid #3a3a3a;
  padding: 12px 24px;
  flex-shrink: 0;
  text-align: center;
}

.footer-content {
  max-width: 100%;
  margin: 0 auto;
}

.footer-content p {
  margin: 0;
  color: #888;
  font-size: 0.85em;
  font-weight: 300;
  font-family: 'Montserrat', sans-serif;
}

/* Link styles */
a {
  color: #4a9eff;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #6bb3ff;
  opacity: 0.9;
}

a:active {
  opacity: 0.8;
}

/* Links in header/footer */
.app-header a,
.app-footer a {
  color: #4a9eff;
}

.app-header a:hover,
.app-footer a:hover {
  color: #6bb3ff;
}

/* Spreadsheet-style layout for keybinds */

.spreadsheet-container {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: auto;
  border: none;
  background: #1a1a1a;
  flex: 1;
}

.keybinds-table {
  width: 100%;
  border-collapse: collapse;
  background: #1a1a1a;
  font-size: 0.9em;
}

/* Frozen header row */
.keybinds-table thead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #2a2a2a;
}

.keybinds-table thead th {
  background: #2a2a2a;
  color: #ffd700;
  font-weight: 700;
  padding: 12px 8px;
  text-align: center;
  border-bottom: 2px solid #3a3a3a;
  border-right: 1px solid #3a3a3a;
  position: sticky;
  top: 0;
  font-family: 'Montserrat', sans-serif;
}

.key-column-header {
  background: #2a2a2a !important;
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  left: 0;
  z-index: 102;
  border-right: 2px solid #4a4a4a !important;
  padding: 0;
  /* Ensure sticky works on mobile */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.class-header {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
}

/* WoW Class Colors */
.class-warrior {
  background: linear-gradient(135deg, #D4A87A 0%, #C69B6D 50%, #B88D5F 100%) !important;
  color: #fff !important;
}

.class-paladin {
  background: linear-gradient(135deg, #FF9FD1 0%, #F48CBA 50%, #E679A3 100%) !important;
  color: #fff !important;
}

.class-deathknight {
  background: linear-gradient(135deg, #D42E48 0%, #C41E3A 50%, #B01A32 100%) !important;
  color: #fff !important;
}

.class-demonhunter {
  background: linear-gradient(135deg, #B844E1 0%, #A330C9 50%, #922CB1 100%) !important;
  color: #fff !important;
}

.class-druid {
  background: linear-gradient(135deg, #FF9224 0%, #FF7C0A 50%, #E66D08 100%) !important;
  color: #fff !important;
}

.class-monk {
  background: linear-gradient(135deg, #1AFFB0 0%, #00FF98 50%, #00E088 100%) !important;
  color: #1a1a1a !important;
}

/* Subtle column background hints - alphabetical order: DK, DH, Druid, Monk, Paladin, Warrior */
.keybinds-table tbody td:nth-child(2) { /* Death Knight column */
  background: rgba(196, 30, 58, 0.05);
}

.keybinds-table tbody td:nth-child(3) { /* Demon Hunter column */
  background: rgba(163, 48, 201, 0.05);
}

.keybinds-table tbody td:nth-child(4) { /* Druid column */
  background: rgba(255, 124, 10, 0.05);
}

.keybinds-table tbody td:nth-child(5) { /* Monk column */
  background: rgba(0, 255, 152, 0.05);
}

.keybinds-table tbody td:nth-child(6) { /* Paladin column */
  background: rgba(244, 140, 186, 0.05);
}

.keybinds-table tbody td:nth-child(7) { /* Warrior column */
  background: rgba(198, 155, 109, 0.05);
}

.keybinds-table tbody td:nth-child(n+2):hover { /* Class columns on hover */
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Key column (frozen left) */
.key-cell {
  position: sticky;
  left: 0;
  background: #1a1a1a;
  z-index: 50;
  padding: 0;
  border-right: 2px solid #4a4a4a;
  border-bottom: 1px solid #3a3a3a;
  width: 70px;
  height: 70px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Ensure sticky works on mobile */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.key-label-cell {
  font-weight: 700;
  font-size: 1.15em;
  color: #d0d0d0;
  letter-spacing: 0.3px;
  font-family: 'Montserrat', sans-serif;
  line-height: 1;
  transition: color 0.2s ease;
}

.keybind-tooltip-trigger {
  cursor: help;
  position: relative;
}

.keybind-tooltip-trigger:hover .key-label-cell {
  color: #ffd700;
}

/* Priority tier colors for key rows - muted pastels */
.key-row.priority-s .key-cell {
  background: #252022;
  border-left: 3px solid #c99a9a;
}

.key-row.priority-a .key-cell {
  background: #252420;
  border-left: 3px solid #c9b89a;
}

.key-row.priority-b .key-cell {
  background: #222522;
  border-left: 3px solid #9ac9a9;
}

.key-row.mouse-row .key-cell {
  /* No italic styling */
}

/* Table rows - ensure consistent height */
.keybinds-table tbody tr {
  height: 70px;
}

.keybinds-table tbody td {
  height: 70px;
  vertical-align: middle;
}

/* Ability cells */
.ability-cell {
  padding: 8px;
  border-right: 1px solid #3a3a3a;
  border-bottom: 1px solid #3a3a3a;
  background: #1a1a1a;
  vertical-align: middle;
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  height: 70px;
  position: relative;
  overflow: hidden;
}

.ability-cell[style*="--ability-bg-icon"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--ability-bg-icon);
  background-size: auto 105%;
  background-position: left center;
  background-repeat: no-repeat;
  opacity: 0.15;
  filter: grayscale(100%) brightness(0.8) blur(3px);
  pointer-events: none;
  z-index: 0;
}

.ability-cell[style*="--ability-bg-icon"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, transparent 0%, transparent 25%, rgba(26, 26, 26, 0.2) 40%, rgba(26, 26, 26, 0.5) 55%, rgba(26, 26, 26, 0.8) 70%, #1a1a1a 90%, #1a1a1a 100%);
  pointer-events: none;
  z-index: 1;
}

.ability-cell:hover {
  background: #2a2a2a;
}

.ability-cell:hover::before {
  opacity: 0.20;
}

.ability-cell:hover::after {
  background: linear-gradient(to right, transparent 0%, transparent 25%, rgba(42, 42, 42, 0.2) 40%, rgba(42, 42, 42, 0.5) 55%, rgba(42, 42, 42, 0.8) 70%, #2a2a2a 90%, #2a2a2a 100%);
}

.ability-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background 0.2s ease;
  border-radius: 4px;
}

.ability-display:hover {
  background: rgba(255, 255, 255, 0.05);
}

.ability-icon-small {
  width: 40px;
  height: 40px;
  background-size: cover;
  background-position: center;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  flex-shrink: 0;
}

.ability-icon-placeholder {
  background: rgba(255, 255, 255, 0.1);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7em;
}

.ability-name {
  color: #e0e0e0;
  font-size: 0.9em;
  line-height: 1.3;
  flex: 1;
  font-weight: 300;
  font-family: 'Montserrat', sans-serif;
}

.ability-empty {
  color: #666;
  text-align: center;
  font-style: italic;
  padding: 8px;
}

/* Tooltip for abilities */
.ability-display[data-tooltip] {
  position: relative;
}

.ability-display[data-tooltip]:hover .ability-tooltip {
  display: block;
}

.ability-tooltip {
  display: none;
  position: fixed;
  min-width: 250px;
  max-width: 350px;
  padding: 12px;
  background: #1a1a1a;
  border: 2px solid #ffd700;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85em;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
}

.ability-display[data-tooltip]:hover .ability-tooltip {
  display: block;
}

.ability-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
}

.ability-tooltip.tooltip-above::after {
  top: 100%;
  border-top-color: #ffd700;
}

.ability-tooltip.tooltip-below::after {
  bottom: 100%;
  border-bottom-color: #ffd700;
}

.tooltip-title {
  color: #ffd700;
  font-weight: 700;
  font-size: 1.1em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #3a3a3a;
  font-family: 'Montserrat', sans-serif;
}

.tooltip-description {
  color: #e0e0e0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Tooltip for keybinds */
.keybind-tooltip-trigger[data-keybind-tooltip] {
  position: relative;
}

.keybind-tooltip {
  display: none;
  position: fixed;
  min-width: 250px;
  max-width: 350px;
  padding: 12px;
  background: #1a1a1a;
  border: 2px solid #ffd700;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.85em;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
}

.keybind-tooltip::after {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: #ffd700;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .spreadsheet-container {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .keybinds-table {
    font-size: 0.85em;
  }
  
  .key-column-header {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
  }
  
  .key-cell {
    width: 60px;
    height: 60px;
  }
  
  .keybinds-table tbody tr {
    height: 60px;
  }
  
  .keybinds-table tbody td {
    height: 60px;
  }
  
  .ability-cell {
    height: 60px;
    min-width: calc(100vw - 80px);
    width: calc(100vw - 80px);
  }
  
  .class-header {
    min-width: calc(100vw - 80px);
    width: calc(100vw - 80px);
  }
  
  .ability-icon-small {
    width: 36px;
    height: 36px;
  }
  
  .ability-name {
    font-size: 0.9em;
  }
  
  .key-label-cell {
    font-size: 1em;
  }
  
  .ability-tooltip {
    min-width: 200px;
    max-width: calc(100vw - 40px);
    font-size: 0.8em;
  }
}

