.hidden {
  display: none !important;
}

body {
  display: block;
  padding: 0 0.5rem;
  background-color: #0F0F0F;
  color: #FFFFFF;
  overflow: hidden;
  overflow-y: scroll !important;
  margin: 0;
  opacity: 1;
  padding: 0;
  font-family: 'trajan-pro-3';
}

#settings {
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0 0 20px;
}

#output {
  text-align: center;
  padding: 40px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border-bottom: 2px solid #444;
  width: 100%;
  justify-content: space-between;
}

.tab-button {
  background: transparent;
  border: none;
  color: #999;
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-icon {
  width: 18px;
  height: 18px;
  transition: all 0.2s ease;
}

.tab-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-button.active {
  color: #fff;
  border-bottom-color: #ff9800;
}

.tab-content {
  display: flex;
  flex-direction: column;
  padding: 0 10px;
  text-align: left;
}

a {
  text-decoration: none;
  color: #ff9800;
}

p.version {
  margin: 0;
}

/* Empty placeholder */
.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #999;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  color: #666;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-placeholder h3 {
  margin: 0 0 10px 0;
  color: #ccc;
  font-size: 18px;
  font-weight: 600;
}

.empty-placeholder p {
  margin: 5px 0;
  color: #999;
  font-size: 14px;
}

.empty-placeholder .hint {
  margin-top: 15px;
  color: #777;
  font-size: 12px;
  font-style: italic;
}

.discord {
  text-decoration: none;
}

/* Empty placeholder */
.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #999;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  color: #666;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-placeholder h3 {
  margin: 0 0 10px 0;
  color: #ccc;
  font-size: 18px;
  font-weight: 600;
}

.empty-placeholder p {
  margin: 5px 0;
  color: #999;
  font-size: 14px;
}

.empty-placeholder .hint {
  margin-top: 15px;
  color: #777;
  font-size: 12px;
  font-style: italic;
}

/* Settings sections */
.settings-section {
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid #333;
  background-color: var(--nis-col-back);
  overflow: hidden;
}

.settings-section ul {
  margin-bottom: 20px;
}

.settings-section li img {
  margin: 10px 0;
  max-width: 100%;
  width: 100%;
}

.settings-section.cooldowns {
  padding-top: 2px;
}

.settings-section h3 {
  margin: 0 0 15px 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.settings-section p {
  margin: 0 0 15px 0;
  color: #999;
  font-size: 14px;
  line-height: 1.5;
}

.settings-section ul {
  margin: 0;
  padding-left: 20px;
  color: #999;
}

.settings-section li {
  margin: 8px 0;
  font-size: 14px;
}

.warning-text {
  color: #ff9800 !important;
  font-size: 13px !important;
}

.overlay-warning {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 15px;
  background-color: rgba(255, 152, 0, 0.05);
  border: 1px solid #ff9800;
  margin-bottom: 20px;
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}

.warning-icon {
  width: 24px;
  height: 24px;
  color: #ff9800;
  flex-shrink: 0;
}

.overlay-warning .warning-text p {
  margin: 0;
  color: #ccc;
  font-size: 13px;
  line-height: 1.4;
}

.overlay-warning .warning-text strong {
  color: #ff9800;
}

p.version {
  text-align: center;
}

.header-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.discord-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 6px 12px;
  background-color: #5865F2;
  color: white;
  border: 1px solid #4752C4;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.discord-button:hover {
  background-color: #4752C4;
}

.discord-icon {
  width: 20px;
  height: 20px;
}

:root {
  --bar-bg: #1a1a1a;
  --bar-border: #3d3d3d;
  --hp-red-gradient: linear-gradient(180deg, #ff4d4d 0%, #cc0000 50%, #990000 100%);
  --prayer-purple-gradient: linear-gradient(180deg, #a64dff 0%, #6600cc 50%, #330066 100%);
  --adren-yellow-gradient: linear-gradient(180deg, #ffd700 0%, #ffaa00 50%, #cc8800 100%);
  --summoning-blue-gradient: linear-gradient(180deg, #4d9fff 0%, #0066cc 50%, #003366 100%);
  --text-shadow: 1px 1px 0 #000;
  --ui-bg: rgba(10, 10, 10, 0.95);
}


/* Main Action Bar Container */
.action-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 20px;
  border-top: 2px solid #555;
  border-bottom: 2px solid #000;
}

/* Individual Stat Unit */
.stat-unit {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 260px;
  /* Fixed width for consistency */
}

/* Icons */
.stat-icon {
  width: 32px;
  height: 32px;
  border: 2px solid #555;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  font-size: 18px;
  z-index: 2;
  overflow: hidden;
  background-color: #222;
  position: relative;
}

.stat-icon.buff-icon {
  border-color: #aa8800;
  background: #332200;
}

.stat-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-text {
  font-size: 14px;
  font-weight: 700;
  text-shadow: var(--text-shadow);
  letter-spacing: 0.5px;
  line-height: 1;
  margin-left: 2px;
}

/* Bar Track */
.bar-track {
  width: 100%;
  height: 12px;
  background-color: #171e24;
  border: 1px solid #444;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.8);
}

/* Bar Fills */
.bar-fill {
  height: 100%;
  width: 100%;
  transition: width 0.3s ease-out;
  position: absolute;
  background: #000;
}

.bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.hp-fill {
  background: var(--hp-red-gradient);
}

.prayer-fill {
  background: var(--prayer-purple-gradient);
}

.adren-fill {
  background: var(--adren-yellow-gradient);
}

.cooldown-fill {
  background: var(--summoning-blue-gradient);
}

/* Buff Bar (Existing functionality, restyled slightly) */
.buff-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  padding: 10px;
  margin-bottom: 20px;

}

.buttons-container {
  display: flex;
  flex-direction: row;
}

.buff-row {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: move;
  margin-bottom: 10px;
}

.alerted-buffs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  flex-wrap: wrap;
}

.alerted-buffs-row .buffs-row {
  display: flex;
  flex-direction: row;
}

.alerted-buffs-row .category {
  display: flex;
  flex-direction: column;
}

.alerted-buffs-row .category .title {
  color: #aa8800;
  margin-bottom: 2px;
  font-weight: bold;
}

.buff-row:last-child {
  margin-bottom: 0;
}

h2 {
  margin-top: 0;
}

.disabled {
  filter: grayscale(100%);
  opacity: .5;
}

.buff-row.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.buff-row:hover:not(.dragging) {
  background-color: rgba(255, 255, 255, 0.05);
}

.buff-icon-img {
  height: 42px;
}

.tracks-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.buff-bar-track.cooldown {
  height: 11px;
}

.tracks-container .cooldown .buff-label {
  font-size: 8px;
  top: -4px;
}

.buff-bar-track {
  width: 150px;
  height: 16px;
  border: 1px solid #444;
  display: flex;
  position: relative;
  background-color: #171e24;
  overflow: hidden;
}

.buff-bar-fill {
  height: 100%;
  background: #f39c12;
}

.stat-icon .timer {
  position: absolute;
  font-size: 32px;
  color: white;
  text-shadow: 2px 2px 10px black;
  font-weight: bold;
}

.stat-icon .stacks {
  position: absolute;
  font-size: 18px;
  color: white;
  text-shadow: 2px 2px 10px black;
  font-weight: bold;
  bottom: -2px;
  right: 2px;
}

.stat-icon.large {
  width: 48px;
  height: 48px;
}

.stat-icon.cooldown.disabled {
  filter: grayscale(100%);
}

.stat-icon.large .buff-icon-img {
  height: 48px;
}

.buff-label {
  display: flex;
  justify-content: space-between;
  z-index: 1;
  width: 100%;
  font-size: 10px;
  line-height: 16px;
  color: white;
  text-shadow: 1px 1px 1px black;
  pointer-events: none;
  font-weight: bold;
  padding: 0 2px;
  align-items: center;
}

.buff-name {
  width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* Text naturally aligns left, so no change needed here */
}

.buff-timer {
  font-size: 10px;
  width: 35px;
  /* Ensures the text inside the timer div is right-aligned */
  text-align: right;
}

/* Divider decoration between stats */
.divider {
  width: 1px;
  height: 30px;
  background: #444;
  margin: 0 5px;
}

/* SVGs for icons */
.svg-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Flashing animation for low timer */

.flashing {
  border-color: #ff3333 !important;
}

.flashing .bar-fill {
  background: #ff3333 !important;
  /* Turn bar red */
}

/* Pin button styling */
.pin-button {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pin-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.pin-icon {
  width: 20px;
  height: 20px;
  color: #666;
  transition: all 0.2s ease;
  transform: rotate(45deg);
}

.pin-button.pinned .pin-icon {
  color: #ffd700;
  transform: rotate(0deg);
}

.pin-button:hover .pin-icon {
  color: #999;
}

.pin-button.pinned:hover .pin-icon {
  color: #ffed4e;
}

/* Audio queue button styling */
.audio-button {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.audio-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.audio-icon {
  width: 20px;
  height: 20px;
  color: #666;
  transition: all 0.2s ease;
}

.audio-button.queued .audio-icon {
  color: #4CAF50;
}

.audio-button:hover .audio-icon {
  color: #999;
}

.audio-button.queued:hover .audio-icon {
  color: #66BB6A;
}

/* Overlay settings form styling */
.overlay-settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.overlay-settings-field {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.overlay-settings-form .nis-input {
  width: 40px;
}

.overlay-settings-input {
  max-width: 50px;
  padding: 6px;
  background: #1a1a1a;
  border: 1px solid #444;
  color: white;
  text-align: right;
}

.setting-icon {
  width: 24px;
  height: 24px;
  border: 1px solid #444;
  object-fit: contain;
  background-color: #222;
}

.overlay-settings-field-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-checkbox {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #666;
}

.settings-checkbox:hover {
  color: #999;
}

.settings-checkbox.active {
  color: #f39c12;
}

.settings-checkbox-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Profiles Section */
.profiles-section {
  margin-bottom: 10px;
}

.profile-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-select-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-select {
  width: 100px !important;
}

.profile-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.profile-actions .nis-input {
  flex-grow: 1;
}

.nis-select,
.nis-input {
  background: #1a1a1a;
  border: 1px solid #444;
  color: white;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}

.nisbutton.small {
  height: 24px;
  line-height: 24px;
  font-size: 12px;
  padding: 0 8px;
}

.nisbutton.delete {
  text-shadow: 1px 1px 2px #ff4d4d;
}

.nisbutton.delete:not(:disabled) {
  filter: hue-rotate(-120deg);
}

.nisbutton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(100%);
}