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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #828491 0%, #000000 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 60px);
}

.header {
  background: rgba(255, 255, 255, 0.95);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
  font-size: 2.5em;
  color: #4a5568;
  margin-bottom: 10px;
  font-weight: 700;
}

.header p {
  color: #718096;
  font-size: 1.1em;
}

.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.tab-button {
  flex: 1;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1em;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.tab-button.active {
  background: rgba(255, 255, 255, 0.9);
  color: #4a5568;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tab-content {
  display: none;
  background: rgba(255, 255, 255, 0.95);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-content.active {
  display: block;
}

.input-section {
  margin-bottom: 30px;
}

.input-section label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #4a5568;
}

.input-section textarea {
  width: 100%;
  min-height: 120px;
  padding: 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.3s ease;
}

.input-section textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.decode-controls {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.decode-controls select,
.decode-controls input {
  padding: 10px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.decode-controls select:focus,
.decode-controls input:focus {
  outline: none;
  border-color: #4a4c55;
}

.hidden {
  display: none !important;
}

.btn {
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn.primary {
  background: linear-gradient(135deg, #828491 0%, #000000 100%);
  color: white;
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn.secondary {
  background: #f7fafc;
  color: #4a5568;
  border: 2px solid #e2e8f0;
}

.btn.secondary:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.results-section h3 {
  margin-bottom: 20px;
  color: #4a5568;
  font-size: 1.3em;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.result-item {
  background: #f8fafc;
  padding: 15px;
  border-radius: 10px;
  border-left: 4px solid #7c8195;
  transition: all 0.3s ease;
}

.result-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.result-item label {
  display: block;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 8px;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-item .result-value {
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: #2d3748;
  word-break: break-all;
  background: white;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  position: relative;
  cursor: pointer;
}

.result-item .result-value:hover {
  background: #f7fafc;
}

.copy-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #525669;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.result-item:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: #5a67d8;
}

.single-result {
  background: #f8fafc;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #48bb78;
  font-family: "Courier New", monospace;
  font-size: 14px;
  color: #2d3748;
  word-break: break-all;
  min-height: 60px;
  display: flex;
  align-items: center;
}

.analysis-results {
  background: #f8fafc;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #ed8936;
}

.analysis-item {
  margin-bottom: 15px;
  padding: 10px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.analysis-item strong {
  color: #4a5568;
}

.error {
  color: #e53e3e;
  background: #fed7d7;
  padding: 15px;
  border-radius: 10px;
  border-left: 4px solid #e53e3e;
  margin-top: 10px;
}

.success {
  color: #38a169;
  background: #c6f6d5;
  padding: 15px;
  border-radius: 10px;
  border-left: 4px solid #38a169;
  margin-top: 10px;
}

.footer {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9em;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: #4a5568;
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .header h1 {
    font-size: 2em;
  }

  .tabs {
    flex-direction: column;
    gap: 10px;
  }

  .tab-button {
    padding: 12px 15px;
  }

  .decode-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .result-item .result-value {
    font-size: 12px;
  }
}
