:root {
  --font-sans: "Inter", sans-serif;
  --text-color: rgb(25, 25, 24);
  --bg-color: #fafafa;
  --border-color: rgba(55, 53, 47, 0.12);
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* App Specific */
  --text-main: rgb(25, 25, 24);
  --text-secondary: rgba(25, 25, 24, 0.9);
  --text-muted: rgba(25, 23, 17, 0.6);
  --bg-hover: rgba(55, 53, 47, 0.08);
  --primary: #2383E2;
  --primary-hover: #1B6DC1;
  --primary-active: #155A9E;
  --selection: rgba(35, 131, 226, 0.28);
}

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

body {
  font-family: var(--font-sans);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-32) var(--space-24);
}

/* ========== APP HEADER ========== */
.app-header {
  text-align: center;
  margin-bottom: var(--space-24);
  padding: var(--space-16) var(--space-24);
  margin: calc(-1 * var(--space-32)) calc(-1 * var(--space-24)) var(--space-24);
}

.app-header__title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-color);
  margin: 0;
  padding-bottom: var(--space-16);
}

.app-header__title::after {
  content: "";
  display: block;
  width: 40%;
  height: 1px;
  background: var(--border-color);
  margin: var(--space-16) auto 0;
}

h2 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

h3 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
  margin-bottom: 12px;
}

.card {
  border: 0.5px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mode-selector,
.platform-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.radio-group {
  display: flex;
  background: var(--bg-hover);
  padding: 4px;
  border-radius: 8px;
  width: fit-content;
}

.radio-group input[type="radio"] {
  display: none;
}

.radio-group label {
  margin-bottom: 0;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  text-transform: none;
  letter-spacing: normal;
  transition: all 0.2s;
}

.radio-group input[type="radio"]:checked+label {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 0.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-main);
  background: #fff;
  transition: border-color 0.2s;
}

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.primary-button {
  font-size: 16px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 50px;
  background: #000000;
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  font-family: "Inter";
}

.primary-button:hover {
  background: #1a1a1a;
}

.primary-button:active {
  background: #333333;
}

.primary-button:disabled {
  background: rgba(0, 0, 0, 0.3);
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

/* Result Styles */
#result-section {
  margin-top: 48px;
}

.result-card {
  border: 0.5px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.result-header {
  background: var(--bg-hover);
  padding: 16px 24px;
  border-bottom: 0.5px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-content {
  padding: 32px;
}

.formula-box {
  background: rgb(247, 246, 243);
  padding: 20px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 18px;
  margin-bottom: 24px;
  position: relative;
  word-break: break-all;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 8px;
  font-size: 12px;
  background: #fff;
  border: 0.5px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
}

.section-block {
  margin-bottom: 32px;
}

.section-block h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  border-bottom: 0.5px solid var(--border-color);
  padding-bottom: 4px;
}

.section-block p,
.section-block li,
.content-wrapper {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.section-block ul {
  padding-left: 24px;
  list-style-type: disc;
}

.section-block li {
  margin-bottom: 8px;
}

.section-block li strong {
  color: var(--text-main);
}

code {
  background: var(--bg-hover);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

footer {
  margin-top: 80px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

@media (max-width: 768px) {
  .container {
    padding: var(--space-24) var(--space-16);
  }

  .app-header {
    padding: var(--space-12) var(--space-16);
    margin: calc(-1 * var(--space-24)) calc(-1 * var(--space-16)) var(--space-20);
  }

  .app-header__title {
    font-size: 28px;
  }
}