/* ==========================================================================
   Guild Wars 2 In-Game Hero / Achievement UI Theme
   Pixel-accurate match to in-game GW2 Hero Panel (References)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* GW2 Authentic Colors */
  --gw2-bg-world: #080706;
  --gw2-bg-window: rgba(18, 15, 13, 0.94);
  --gw2-bg-sidebar-rail: #0a0908;
  --gw2-bg-sidebar-panel: rgba(15, 13, 11, 0.96);
  --gw2-bg-content: rgba(22, 19, 16, 0.92);
  --gw2-bg-track: #12100e;
  --gw2-bg-input: #0e0d0b;

  /* Borders & Dividers */
  --gw2-border-window: #1f1a14;
  --gw2-border-separator: #2c251e;
  --gw2-border-track: #2a241d;
  --gw2-border-gold: #c5973b;

  /* Typography */
  --gw2-text-white: #ffffff;
  --gw2-text-cream: #fbf7ee;
  --gw2-text-khaki: #b8ac98;
  --gw2-text-muted: #827768;
  --gw2-text-gold: #e5b34b;
  --gw2-text-amber: #d98d28;

  /* GW2 Signature Amber Progress Bars */
  --gw2-amber-fill: #d98d28;
  --gw2-amber-gradient: linear-gradient(180deg, #ec9d2a 0%, #b8690e 100%);
  --gw2-amber-glow: 0 0 8px rgba(230, 145, 30, 0.6);

  /* Fonts */
  --gw2-font-serif: 'Cinzel', 'Georgia', serif;
  --gw2-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Viewport */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--gw2-font-sans);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  background-color: var(--gw2-bg-world);
  background-image: 
    radial-gradient(circle at 50% 30%, rgba(60, 45, 30, 0.25) 0%, rgba(8, 7, 6, 0.98) 80%),
    linear-gradient(to bottom, #110e0c 0%, #050404 100%);
  background-attachment: fixed;
  color: var(--gw2-text-cream);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 10px;
  overflow-y: scroll;
}

/* Custom In-Game Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #110f0d;
}
::-webkit-scrollbar-thumb {
  background: #383025;
  border-radius: 1px;
}
::-webkit-scrollbar-thumb:hover {
  background: #544937;
}

/* ==========================================================================
   Window Container (Authentic GW2 Hero Panel)
   ========================================================================== */
.gw2-hero-window {
  width: 1220px;
  max-width: calc(100vw - 20px);
  min-height: 740px;
  background: var(--gw2-bg-window);
  border: 1px solid var(--gw2-border-window);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px #050504;
  position: relative;
  border-radius: 1px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
  overflow: hidden;
}

/* Painterly Top Brush Edge */
.gw2-hero-window::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(140, 115, 75, 0.4) 15%, 
    rgba(220, 180, 100, 0.7) 45%, 
    rgba(140, 115, 75, 0.4) 80%, 
    transparent 100%
  );
  pointer-events: none;
}

/* ==========================================================================
   Window Top Header
   ========================================================================== */
.gw2-top-header {
  height: 44px;
  background: linear-gradient(180deg, rgba(28, 23, 19, 0.95) 0%, rgba(18, 15, 12, 0.95) 100%);
  border-bottom: 1px solid var(--gw2-border-separator);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  position: relative;
  z-index: 10;
}

/* Left Title Group with White Emblem */
.gw2-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* White GW2 Shield/Wing Emblem */
.gw2-crest-badge {
  width: 28px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffffff 0%, #e0d8c8 60%, #998c77 100%);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
  color: #1a1612;
  font-family: var(--gw2-font-serif);
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.7);
  margin-top: 4px;
}

.gw2-header-title {
  font-family: var(--gw2-font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gw2-text-white);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.gw2-header-sub {
  font-family: var(--gw2-font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gw2-text-khaki);
  letter-spacing: 0.3px;
}

/* Header Right Controls */
.gw2-top-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Clocks */
.gw2-header-clocks {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--gw2-text-khaki);
}

.gw2-clock-tag {
  font-weight: 600;
  color: var(--gw2-text-white);
  font-variant-numeric: tabular-nums;
}

/* Close Box Button [X] */
.gw2-close-btn {
  width: 20px;
  height: 20px;
  background: #25201b;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-family: var(--gw2-font-sans);
  font-weight: 700;
  cursor: pointer;
  border-radius: 1px;
  transition: all 0.12s ease;
}

.gw2-close-btn:hover {
  background: #6b261e;
  border-color: #a83d31;
}

/* ==========================================================================
   Window Body: 3-Column Layout
   1) Far-Left Icon Rail (38px)
   2) Left Category Sidebar (230px)
   3) Right Content Area (1fr)
   ========================================================================== */
.gw2-window-body {
  display: flex;
  flex: 1;
  min-height: 690px;
}

/* 1) Far-Left Icon Rail */
.gw2-icon-rail {
  width: 40px;
  background: var(--gw2-bg-sidebar-rail);
  border-right: 1px solid var(--gw2-border-separator);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 10px;
}

.gw2-rail-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--gw2-text-khaki);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 2px;
  font-size: 1.05rem;
  transition: all 0.12s ease;
  position: relative;
}

.gw2-rail-btn:hover {
  color: var(--gw2-text-white);
  background: rgba(255, 255, 255, 0.05);
}

/* Selected Tab: White brush highlight behind icon */
.gw2-rail-btn.active {
  color: #1a1510;
  background: linear-gradient(135deg, #ffffff 0%, #ede5d5 100%);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  font-weight: bold;
}

/* 2) Left Category Sidebar */
.gw2-category-panel {
  width: 240px;
  background: var(--gw2-bg-sidebar-panel);
  border-right: 1px solid var(--gw2-border-separator);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 14px;
}

/* Total Points Header */
.gw2-total-points-block {
  text-align: center;
  padding-bottom: 4px;
}

.gw2-total-points-label {
  font-family: var(--gw2-font-serif);
  font-size: 1.15rem;
  color: var(--gw2-text-white);
  letter-spacing: 0.5px;
}

.gw2-total-points-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #e8a938;
}

/* Laurel / Coin Icon */
.gw2-laurel-icon {
  width: 24px;
  height: 24px;
  background: radial-gradient(circle, #f3ca65 0%, #b88220 70%, #68460b 100%);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #241604;
  border: 1px solid #ffd880;
  box-shadow: 0 1px 3px rgba(0,0,0,0.6);
  font-weight: 900;
}

/* Dropdown Select ("No Title" in screenshot) */
.gw2-dropdown-select {
  background: #181512;
  border: 1px solid #362e24;
  color: var(--gw2-text-khaki);
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.gw2-dropdown-select:hover {
  border-color: #584c3c;
  color: var(--gw2-text-white);
}

.gw2-dropdown-arrow {
  font-size: 0.65rem;
  color: #8c806f;
}

/* Sunken Inset Search */
.gw2-search-input-wrap {
  position: relative;
  margin-top: -4px;
}

.gw2-search-input-field {
  width: 100%;
  background: var(--gw2-bg-input);
  border: 1px solid #29231a;
  color: var(--gw2-text-white);
  font-size: 0.82rem;
  font-style: italic;
  padding: 5px 8px;
  border-radius: 1px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.gw2-search-input-field:focus {
  outline: none;
  border-color: #6d5b43;
}

.gw2-search-input-field::placeholder {
  color: #635a4d;
}

/* Categories List Section */
.gw2-categories-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gw2-text-khaki);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.gw2-categories-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: 420px;
}

.gw2-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: 1px;
  color: var(--gw2-text-cream);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s ease;
}

.gw2-cat-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.gw2-cat-row.active {
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  color: #ffffff;
}

.gw2-cat-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Circular Category Icon (Like Daily purple star, Monthly green star) */
.gw2-cat-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: #ffffff;
  font-weight: bold;
}

.gw2-cat-pct {
  font-size: 0.75rem;
  color: var(--gw2-text-khaki);
}

/* 3) Right Main Content Area */
.gw2-main-content {
  flex: 1;
  min-width: 0;
  background: var(--gw2-bg-content);
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

/* Top Hero Header: Category Title + "5 of 14 Complete" */
.gw2-content-top-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.gw2-category-big-title {
  font-family: var(--gw2-font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--gw2-text-white);
  letter-spacing: 0.5px;
}

.gw2-completion-stat {
  font-size: 0.88rem;
  color: var(--gw2-text-khaki);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Signature Big GW2 Progress Bar with Reward Chest */
.gw2-big-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gw2-big-bar-track {
  flex: 1;
  height: 28px;
  background: var(--gw2-bg-track);
  border: 1px solid var(--gw2-border-track);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.85);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

.gw2-big-bar-fill {
  height: 100%;
  background: var(--gw2-amber-fill);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: none;
}

/* Wooden Chest Icon */
.gw2-chest-box {
  width: 36px;
  height: 32px;
  background: linear-gradient(180deg, #875c34 0%, #543417 60%, #301d0c 100%);
  border: 1px solid #a87d4a;
  border-radius: 3px 3px 1px 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.4);
  color: #ffd880;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.gw2-chest-box:hover {
  box-shadow: 0 0 10px rgba(255, 200, 80, 0.6);
}

/* "Achievements" Section Header with Subtle Brush Line */
.gw2-achievements-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gw2-text-cream);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gw2-border-separator);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Scrollable Events Feed */
.gw2-feed-scroll {
  flex: 1;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 6px;
  max-height: 520px;
}

/* Individual Achievement / Event Row */
.gw2-event-row {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 110px;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: rgba(18, 15, 12, 0.4);
  border-bottom: 1px solid rgba(44, 37, 30, 0.35);
  transition: background-color 0.12s ease;
  box-sizing: border-box;
  width: 100%;
}

.gw2-event-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.gw2-event-row.is-active {
  background: linear-gradient(90deg, rgba(217, 141, 40, 0.12) 0%, rgba(18, 15, 12, 0.4) 100%);
  border-left: 2px solid var(--gw2-amber-fill);
}

/* Left Column: Event Name & Objective details */
.gw2-event-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 250px;
  overflow: hidden;
}

.gw2-event-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gw2-event-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gw2-text-white);
  text-decoration: none;
  transition: color 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.gw2-event-name:hover {
  color: #ffdf8c;
  text-decoration: underline;
}

.gw2-event-meta-line {
  font-size: 0.78rem;
  color: var(--gw2-text-khaki);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Center Column: GW2 In-Game Amber Pill Progress Bar */
.gw2-bar-center {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.gw2-bar-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--gw2-text-khaki);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
  gap: 8px;
}

.gw2-bar-status-text {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

.gw2-bar-status-active {
  color: var(--gw2-amber-fill);
  font-weight: 700;
  text-shadow: 0 0 6px rgba(217, 141, 40, 0.6);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

.gw2-pill-track {
  width: 100%;
  height: 14px;
  background: #14110e;
  border: 1px solid #2e261d;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.gw2-pill-fill {
  height: 100%;
  background: var(--gw2-amber-gradient);
  border-radius: 1px;
  transition: none;
  position: relative;
}

/* Right Notch Cap (GW2 Roman Numeral tier segment) */
.gw2-pill-notch {
  position: absolute;
  right: 2px;
  top: 0;
  bottom: 0;
  width: 6px;
  border-left: 1px solid rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.2);
}

/* Right Column: Reward AP & Waypoint Copy */
.gw2-event-rewards {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 110px;
  max-width: 110px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.gw2-ap-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #e5b34b;
}

/* Mini Laurel AP Icon */
.gw2-mini-laurel {
  width: 16px;
  height: 16px;
  background: radial-gradient(circle, #f3ca65 0%, #b88220 70%, #68460b 100%);
  border-radius: 50%;
  border: 1px solid #ffd880;
  display: inline-block;
}

/* Waypoint Button */
.gw2-in-game-wp-btn {
  background: #171410;
  border: 1px solid #362e24;
  color: #dfcfb2;
  font-family: monospace;
  font-size: 0.74rem;
  padding: 3px 6px;
  border-radius: 1px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.gw2-in-game-wp-btn:hover {
  background: #2a2219;
  border-color: #63533c;
  color: #fff;
}

.gw2-in-game-wp-btn.copied {
  background: #1e3816;
  border-color: #4b8f3a;
  color: #a7f794;
}

/* Checkmark Completed Icon */
.gw2-done-check {
  background: transparent;
  border: none;
  color: var(--gw2-text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  transition: color 0.12s ease;
}

.gw2-done-check.done {
  color: #4eb538;
}

/* Bottom Footer Bar */
.gw2-window-footer {
  height: 32px;
  background: #110e0c;
  border-top: 1px solid var(--gw2-border-separator);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  font-size: 0.75rem;
  color: var(--gw2-text-muted);
}

.gw2-window-footer a {
  color: var(--gw2-text-khaki);
  text-decoration: none;
}

.gw2-window-footer a:hover {
  text-decoration: underline;
  color: var(--gw2-text-white);
}

/* Toast */
.gw2-toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(22, 17, 13, 0.96);
  border: 1px solid var(--gw2-border-gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  padding: 8px 16px;
  border-radius: 1px;
  color: var(--gw2-text-white);
  font-size: 0.85rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
}
