/**
 * ============================================================================
 * DISAWSM - Complete Stylesheet
 * ============================================================================
 *
 * Styles for the DisAWSM 6502 disassembler
 * Cleaned up and optimized for the current application
 */


/* ============================================================================
   1. CSS VARIABLES & ROOT STYLES
   ============================================================================ */

:root {
  /* Brand Colors */
  --secondary: #e6007e;
  --primary: #00C698;
  --primary-hover: #e302d8;

  /* Text Colors */
  --inactive_text: #aaaaaa;
  --active_text: #ffffff;

  /* UI Colors */
  --bg-dark: #222;
  --bg-darker: #1a1a1a;
  --bg-lighter: #2a2a2a;
  --border-color: #444;
  --border-color-light: #666;
  --border-color-dark: #333;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;

  /* Border Radius */
  --radius-sm: 3px;
  --radius-md: 4px;

  /* Transitions */
  --transition-fast: 0.15s;
  --transition-normal: 0.2s;
}


/* ============================================================================
   2. BASE ELEMENTS & RESET
   ============================================================================ */

body,
html,
p
{
  font-family: "Quicksand", sans-serif;
  margin: 0;
}

body,
html {
  /* Dotted pattern background */
  background: radial-gradient(black 25%, transparent 16%) 0 0,
    radial-gradient(black 25%, transparent 16%) 8px 8px,
    radial-gradient(rgba(255, 255, 255, 0.1) 25%, transparent 20%) 0 1px,
    radial-gradient(rgba(255, 255, 255, 0.1) 25%, transparent 20%) 8px 9px;
  background-color: #3b3b3b;
  background-size: 16px 16px;

  /* Prevent text selection on page when double clicking */
  -webkit-user-select: none;
  -moz-user-select: none;
  -khtml-user-select: none;
  -ms-user-select: none;
}

/* Remove focus outline from all elements */
*:focus {
  outline: none !important;
}

body:focus,
html:focus {
  outline: none !important;
}

p {
  margin: 8px;
  line-height: 160%;
}

a {
  text-decoration: none;
  color: var(--primary);
}

a:hover {
  color: var(--secondary);
}

h1 {
  font-size: 160%;
  color: var(--primary);
  text-align: center;
  margin-bottom: 0px;
}

h2 {
  font-size: 110%;
  color: var(--primary);
  text-align: center;
  margin: 0px 0px 12px 0px;
}


/* ============================================================================
   3. UNIFIED WINDOW/DIALOG FRAMEWORK
   ============================================================================ */

/* Base window/dialog wrapper - used by all windows and dialogs */
.dialog-wrapper {
  position: absolute;
  background: #121212 url("../ui/bg_glossy.png") 50% top repeat-x;
  border-radius: 4px;
  border: 1px solid #2a2a2a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 20px);
  max-height: calc(100% - 20px);
  box-sizing: border-box;
}

/* Title bar - draggable header */
.dialog-titlebar {
  border-bottom: 1px solid #141414;
  padding: 12px 16px;
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.dialog-title {
  color: var(--primary);
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-align: left;
  flex: 1;
}

/* Close button - positioned on the right */
.window-close-button {
  background: none;
  border: none;
  color: #aaaaaa;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s;
}

.window-close-button:hover {
  color: #ffffff;
}

/* Dialog content area */
.dialog-content {
  flex: 1 1 auto;
  overflow: auto;
  padding: 4px;
  color: var(--active_text);
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  box-sizing: border-box;
}

/* Resize handle */
.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 0%, transparent 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.2) 100%);
  border-bottom-right-radius: 4px;
  transition: background 0.2s;
}

.resize-handle:hover {
  background: linear-gradient(135deg, transparent 0%, transparent 50%, rgba(0,198,152,0.3) 50%, rgba(0,198,152,0.5) 100%);
}

/* Modal overlay for dialogs */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000; /* Must be higher than menubar (10000) and windows (1000+) */
}


/* ============================================================================
   4. MENUBAR
   ============================================================================ */

#menubar {
  background-color: #333;
  position: relative;
  z-index: 10000;
  font-family: "Quicksand", sans-serif;
}

#menubar ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#menubar li {
  float: left;
}

#menubar li a,
#menubar .dropbtn {
  display: inline-block;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}

#menubar li a:hover,
#menubar .dropdown:hover .dropbtn {
  background-color: var(--primary);
  color: white;
}

#menubar li.dropdown {
  display: inline-block;
}

/* Dropdown content */
#menubar .dropdown-content {
  display: none;
  position: absolute;
  background-color: #333;
  min-width: 240px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

#menubar .dropdown-content a {
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
  position: relative;
}

#menubar .dropdown-content a:hover {
  background-color: var(--primary);
}

#menubar .dropdown-content a.disabled {
  color: var(--inactive_text);
  cursor: not-allowed;
  pointer-events: none;
}

#menubar .dropdown:hover .dropdown-content {
  display: block;
}

/* Hotkey documentation */
#menubar .hotkey {
  position: absolute;
  right: 9px;
  color: rgba(200, 200, 200, 0.5);
}

/* Menu separator line */
#menubar hr {
  border: none;
  height: 1px;
  background: rgba(200, 200, 200, 0.15);
}


/* ============================================================================
   5. STATUS BAR & TOOLTIP
   ============================================================================ */

#statusbar {
  width: 100%;
  position: fixed;
  bottom: 0px;
  height: 20px;
  padding: 6px 12px 6px 12px;
  color: var(--primary);
  background: -webkit-linear-gradient(#181818, #111111);
  background: -o-linear-gradient(#181818, #111111);
  background: -moz-linear-gradient(#181818, #111111);
  background: linear-gradient(#181818, #111111);
  z-index: 1000;
  font-size: 110%;
}

#custom-tooltip {
  position: fixed;
  background: rgba(20, 20, 20, 0.95);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Quicksand', sans-serif;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  white-space: nowrap;
  border: 1px solid rgba(0, 185, 238, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#custom-tooltip.visible {
  opacity: 1;
}


/* ============================================================================
   END OF STYLESHEET
   ============================================================================ */
