* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  padding: 20px;
  color: #212121;
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Material Design Card */
.card {
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
  padding: 24px;
  margin-bottom: 24px;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Header */
.header {
  text-align: center;
  color: #212121;
  margin-bottom: 24px;
  padding: 32px 24px;
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.header h1 {
  font-size: 2.125rem;
  margin-bottom: 8px;
  color: #ffffff;
  font-weight: 400;
  letter-spacing: 0.01562em;
}

.subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.87);
  font-weight: 400;
  opacity: 0.9;
}

/* Main Content */
.main-content {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
}

.input-section {
  background: #ffffff;
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.input-group {
  margin-bottom: 24px;
}

.input-group:last-child {
  margin-bottom: 0;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

label {
  font-weight: 500;
  font-size: 0.875rem;
  color: #212121;
  display: block;
  letter-spacing: 0.01071em;
  text-transform: uppercase;
}

.input-hint {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.6);
  margin-bottom: 8px;
  font-weight: 400;
}


textarea {
  width: 100%;
  min-height: 120px;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 14px;
  border: none;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px 4px 0 0;
  padding: 12px;
  resize: vertical;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  background: #fafafa;
  line-height: 1.6;
  outline: none;
}

textarea:focus {
  border-bottom-color: #1976d2;
  background: #ffffff;
}

textarea::placeholder {
  color: rgba(0, 0, 0, 0.38);
}


/* Material Design Buttons */
.button-group {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.btn-primary, .btn-secondary {
  flex: 1;
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08929em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: #1976d2;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1565c0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.24);
}

.btn-primary:active {
  background: #0d47a1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: #ffffff;
  color: #1976d2;
  border: 1px solid rgba(25, 118, 210, 0.5);
}

.btn-secondary:hover {
  background: rgba(25, 118, 210, 0.08);
}

.btn-secondary:active {
  background: rgba(25, 118, 210, 0.16);
}

.btn-example {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #1976d2;
  transition: all 0.3s ease;
  font-family: inherit;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08929em;
}

.btn-example:hover {
  background: rgba(25, 118, 210, 0.08);
  border-color: #1976d2;
}

.btn-example:active {
  background: rgba(25, 118, 210, 0.16);
}

.btn-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-primary.loading .btn-text {
  opacity: 0;
}

.btn-primary.loading .btn-loader {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Result Section */
.result-section {
  background: #ffffff;
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.result-header h2 {
  font-size: 1.5rem;
  color: #212121;
  font-weight: 400;
  letter-spacing: 0.00938em;
}

.btn-close {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  color: rgba(0, 0, 0, 0.54);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
}

.btn-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.87);
}

.btn-close:active {
  background: rgba(0, 0, 0, 0.16);
}

.result-content {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
}

.result-content::-webkit-scrollbar {
  width: 8px;
}

.result-content::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}

.result-content::-webkit-scrollbar-thumb {
  background: #bdbdbd;
  border-radius: 4px;
}

.result-content::-webkit-scrollbar-thumb:hover {
  background: #9e9e9e;
}

pre#result {
  margin: 0;
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #212121;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  overflow-x: auto;
}

.alert {
  color: #c62828;
  font-weight: 400;
  background: #ffebee;
  padding: 16px;
  border-radius: 4px;
  margin: 16px 0;
  border-left: 4px solid #f44336;
  font-size: 0.875rem;
}

/* Info Panel */
.info-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.info-card {
  background: #ffffff;
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.info-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
  color: #212121;
  margin-bottom: 16px;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.00938em;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  color: rgba(0, 0, 0, 0.87);
  line-height: 1.75;
  font-size: 0.875rem;
}

.info-card li:before {
  content: "•";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #1976d2;
  font-weight: bold;
  font-size: 1.2em;
  line-height: 1;
}

.info-card li strong {
  color: #212121;
  font-weight: 500;
}

/* Ripple Effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.75rem;
  }

  .input-section {
    padding: 16px;
  }

  .button-group {
    flex-direction: column;
  }

  .label-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .btn-example {
    align-self: flex-end;
  }

  .info-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  .header {
    padding: 24px 16px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.875rem;
  }

  .card {
    padding: 16px;
  }
}
