@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #008080;
  font-family: 'Tahoma', 'Segoe UI', 'Arial', sans-serif;
  font-size: 11px;
  color: #000;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  user-select: none;
}

/* Win98 Window */
.win98-window {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow: 
    inset 1px 1px 0 #dfdfdf,
    inset -1px -1px 0 #808080,
    2px 2px 8px rgba(0,0,0,0.4);
  width: 520px;
  max-width: 96vw;
  margin: 20px auto;
}

/* Title Bar */
.title-bar {
  background: linear-gradient(90deg, #000080, #1084d0);
  padding: 3px 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: default;
}

.title-bar-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.title-bar-text {
  color: #fff;
  font-weight: bold;
  font-size: 11px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.title-bar-controls {
  display: flex;
  gap: 2px;
}

.title-btn {
  width: 16px;
  height: 14px;
  background: #c0c0c0;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  cursor: pointer;
  color: #000;
  line-height: 1;
  padding: 0;
  font-family: 'Tahoma', sans-serif;
}

.title-btn:active {
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
}

/* Window Body */
.window-body {
  padding: 12px;
}

.description {
  font-size: 11px;
  line-height: 1.5;
  margin-bottom: 12px;
  color: #000;
}

/* Group Box */
.group-box {
  border: 1px solid #808080;
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
  padding: 12px 10px 10px 10px;
  margin-bottom: 10px;
  position: relative;
}

.group-box::after {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border: 1px solid transparent;
  border-top-color: #dfdfdf;
  border-left-color: #dfdfdf;
  pointer-events: none;
}

.group-label {
  position: absolute;
  top: -7px;
  left: 8px;
  background: #c0c0c0;
  padding: 0 4px;
  font-size: 11px;
  font-weight: normal;
}

/* Radio Buttons */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 11px;
}

.radio-label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border: 1px solid #808080;
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  position: relative;
}

.radio-label input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 6px;
  height: 6px;
  background: #000;
  border-radius: 50%;
}

/* Input Fields */
.key-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.key-segment {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  box-shadow: inset 1px 1px 0 #404040;
  background: #fff;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: bold;
  padding: 4px 4px;
  text-align: center;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.key-segment:focus {
  background: #ffffcc;
}

.key-segment.valid-segment {
  background: #e0ffe0;
}

.key-segment.invalid-segment {
  background: #ffe0e0;
}

.key-dash {
  font-size: 14px;
  font-weight: bold;
  color: #000;
}

.oem-label {
  font-size: 11px;
  font-weight: bold;
  color: #808080;
  background: #c0c0c0;
  padding: 3px 6px;
  border: 1px solid #808080;
}

/* Buttons */
.win98-btn {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  padding: 4px 16px;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  cursor: pointer;
  color: #000;
  outline: none;
  min-width: 75px;
}

.win98-btn:hover {
  background: #d4d0c8;
}

.win98-btn:active {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 5px 15px 3px 17px;
}

.win98-btn:focus {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

.win98-btn-primary {
  font-weight: bold;
  box-shadow: 0 0 0 1px #000;
}

.button-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
  flex-wrap: wrap;
}

/* Result Area */
.result-box {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  box-shadow: inset 1px 1px 0 #404040;
  background: #fff;
  padding: 10px;
  margin-top: 10px;
  min-height: 60px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.result-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.result-valid {
  color: #008000;
}

.result-invalid {
  color: #cc0000;
}

.result-text {
  font-size: 11px;
  line-height: 1.5;
}

.result-title {
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 4px;
}

.result-detail {
  color: #444;
  font-size: 10px;
  margin-top: 4px;
  font-style: italic;
}

.result-spacer {
  height: 6px;
  margin: 0;
}

.result-section-header {
  color: #000080;
  font-weight: bold;
  font-style: normal;
  margin-top: 8px;
  font-size: 10px;
}

/* Details Panel */
.details-panel {
  margin-top: 10px;
  overflow: hidden;
}

.details-content {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  box-shadow: inset 1px 1px 0 #404040;
  background: #fff;
  padding: 10px;
  font-size: 10px;
  line-height: 1.6;
  max-height: 250px;
  overflow-y: auto;
}

.details-content h4 {
  font-size: 11px;
  margin: 8px 0 4px;
  color: #000080;
}

.details-content h4:first-child {
  margin-top: 0;
}

.details-content ul ul {
  margin-top: 2px;
}

.details-content code {
  background: #f0f0f0;
  padding: 1px 3px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
}

.details-content ul {
  margin: 4px 0;
  padding-left: 16px;
}

.details-content li {
  margin-bottom: 2px;
}

/* Status Bar */
.status-bar {
  background: #c0c0c0;
  border-top: 1px solid #808080;
  display: flex;
  padding: 2px;
  gap: 2px;
}

.status-panel {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  padding: 1px 6px;
  font-size: 10px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-panel-small {
  flex: 0 0 auto;
  min-width: 140px;
}

/* Taskbar */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
  height: 30px;
}

.start-btn {
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  padding: 2px 6px;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  color: #000;
}

.start-btn:active {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.taskbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.taskbar-link {
  font-size: 10px;
  color: #000080;
  text-decoration: underline;
  font-family: 'Tahoma', sans-serif;
}

.taskbar-clock {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  padding: 1px 8px;
  font-size: 10px;
  font-family: 'Tahoma', sans-serif;
}

/* Desktop icons area */
.desktop-watermark {
  position: fixed;
  bottom: 40px;
  right: 10px;
  font-family: 'Tahoma', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
  text-align: right;
  line-height: 1.4;
}

/* Separator line */
.separator {
  height: 2px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #ffffff;
  margin: 8px 0;
}

/* Copy notification */
.copy-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  padding: 8px 16px;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  z-index: 9999;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* PIDGEN key row */
.pidgen-row {
  gap: 3px !important;
}

.base24-hint {
  margin-top: 8px;
  font-size: 9px;
  color: #666;
  text-align: center;
  line-height: 1.4;
}

.base24-hint code {
  background: #f0f0f0;
  padding: 1px 4px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: #000080;
}

/* Bit field visualizer */
.bitfield-viz {
  margin-top: 10px;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  box-shadow: inset 1px 1px 0 #404040;
  background: #fff;
  padding: 8px;
}

.bitfield-label {
  font-size: 10px;
  font-weight: bold;
  color: #000080;
  margin-bottom: 4px;
}

.bitfield-bar {
  display: flex;
  height: 22px;
  border: 1px solid #404040;
  overflow: hidden;
}

.bitfield-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-right: 1px solid rgba(0,0,0,0.3);
  cursor: default;
  min-width: 4px;
  overflow: hidden;
}

.bitfield-segment:last-child {
  border-right: none;
}

.bitfield-seg-label {
  font-size: 7px;
  color: #fff;
  font-weight: bold;
  text-shadow: 0 0 2px rgba(0,0,0,0.5);
  white-space: nowrap;
  overflow: hidden;
}

.bitfield-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.bitfield-legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: #444;
}

.bitfield-legend-color {
  width: 8px;
  height: 8px;
  border: 1px solid #404040;
  flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 560px) {
  .win98-window {
    width: 100%;
    margin: 10px;
  }
  
  .key-segment {
    font-size: 11px;
    padding: 3px 2px;
  }
  
  .key-input-row {
    gap: 2px;
  }
  
  .pidgen-row .key-segment {
    width: 58px !important;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 3px 2px;
  }
  
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .win98-btn {
    width: 100%;
  }
}

/* Scrollbar styling for details */
.details-content::-webkit-scrollbar {
  width: 16px;
}

.details-content::-webkit-scrollbar-track {
  background: #c0c0c0;
  border: 1px solid #808080;
}

.details-content::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
}

.padding-bottom {
  padding-bottom: 40px;
}