/* Base styles */
:root {
  --primary-color: #D4C1F9;
  --accent-color: #3644C5;
  --light-gray: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --white: #FFFFFF;
  --black: #000000;
  --border-radius: 1rem;
  --border-radius-sm: 0.5rem;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --header-height: 80px;
  --footer-height: 60px;
}

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

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  color: var(--gray-800);
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 3rem;
  background-color: var(--gray-800);
  color: white;
  border-bottom: 1px solid var(--gray-700);
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.buy-button {
  background-color: var(--primary-color);
  color: var(--gray-800);
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.buy-button:hover {
  background-color: var(--accent-color);
  box-shadow: var(--shadow);
}

/* Main content */
.main-content {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 16.7%;
  background-color: var(--primary-color);
  z-index: 10;
  overflow: hidden;
  min-height: 0;
  transition: left 0.3s ease;
  max-width: 20rem;
  min-width: 14rem;
}

.sidebar-sticky-footer {
  position: fixed;
  bottom: 0;
  width: calc(83.333% - 2rem);
  padding: 1rem;
  z-index: 40;
  display: none;
}

.close-sidebar-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  gap: 0.5rem;
  padding: 0.75rem;
  background-color: var(--gray-800);
  border: none;
  border-radius: var(--border-radius);
  color: var(--gray-200);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.close-sidebar-button:hover {
  background-color: var(--gray-300);
}

.sidebar-content {
  height: 100%;
  padding: 2rem 2rem 4rem;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-height) - var(--footer-height) - 1rem);
}

.controls-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-group {
  margin-bottom: 0.25rem;
}

.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.control-header label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.control-header span {
  font-size: 0.75rem;
  color: var(--gray-600);
}

.control-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

/* Select inputs */
.select-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  background-color: var(--white);
  font-family: 'Roboto Mono', monospace;
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

/* Sliders */
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  border: 2px solid var(--white);
}

.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  border: 2px solid var(--white);
}

/* Button groups */
.button-group {
  display: flex;
  gap: 0.5rem;
}

.icon-button {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  border: none;
  background-color: var(--gray-200);
  color: var(--gray-700);
  cursor: pointer;
  border-radius: 0.75rem;
}

.icon-button.active {
  background-color: var(--accent-color);
  color: var(--white);
}

/* Color options */
.color-options,
.bg-color-options {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

.color-option,
.bg-color-option {
  width: auto;
  height: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--gray-300);
  cursor: pointer;
}

.color-option.active,
.bg-color-option.active {
  border: 2px solid var(--gray-800);
  box-shadow: 0 0 0 2px var(--accent-color);
}

/* OpenType features */
.collapsible-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
}

.feature-count {
  background-color: var(--gray-200);
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-700);
  margin-right: 0.5rem;
}

.collapsible-content {
  display: none;
  background-color: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

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

.feature-section {
  margin-bottom: 0.75rem;
}

.feature-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.feature-header span {
  font-size: 0.875rem;
  font-weight: 500;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feature-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feature-label {
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  transition: .4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.toggle-slider {
  background-color: var(--accent-color);
}

input:checked+.toggle-slider:before {
  transform: translateX(16px);
}

/* Radio buttons */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radio-item input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--white);
  margin: 0;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--gray-400);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.radio-item input[type="radio"]::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.2s ease-in-out;
  background-color: var(--accent-color);
}

.radio-item input[type="radio"]:checked {
  border-color: var(--accent-color);
}

.radio-item input[type="radio"]:checked::before {
  transform: scale(1);
}

.radio-item label {
  font-size: 0.875rem;
  cursor: pointer;
}

/* Display Area */
.display-area {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  /*padding: 3rem;*/
  overflow: hidden;
}

.display-content {
  width: 100%;
  height: 100%;
  text-align: center;
  white-space: pre-wrap;
  transition: all 0.3s ease;
  padding: 3rem;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 1rem;
}

/* Toggle sidebar button (mobile only) */
/* Desktop/Mobile visibility classes */
.desktop-only {
  display: block;
}

.mobile-controls {
  display: none;
  padding: 1rem;
  background-color: var(--gray-100);
  gap: 1rem;
  border-top: 1px solid var(--gray-300);
}

.mobile-button {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--primary-color);
  color: var(--gray-800);
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  flex: 1;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.mobile-button svg {
  width: 18px;
  height: 18px;
}

.buy-mobile {
  background-color: var(--accent-color);
  color: white;
}

.mobile-button:hover {
  opacity: 0.9;
}

/* Footer */
.footer {
  width: 100%;
  background-color: var(--gray-800);
  border-top: 1px solid var(--gray-700);
  padding: 1rem 3rem;
  font-size: 0.85rem;
  color: white;
}

.footer-content {
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  text-align: left;
}

.footer-social {
  display: flex;
  gap: 1.5rem;
}

.social-link {
  color: white;
  text-decoration: none;
  transition: color 0.2s ease;
}

.social-link:hover {
  color: var(--primary-color);
}

.footer p {
  margin: 0;
}

/* Media Queries */
@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }

  .mobile-controls {
    display: flex;
  }

  .sidebar {
    position: fixed;
    width: 83.333%;
    height: 100%;
    left: -100%;
    z-index: 30;
  }

  .sidebar.active {
    left: 0;
  }

  .sidebar.active .sidebar-sticky-footer {
    display: block;
  }

  body {
    overflow-y: auto;
  }

  html,
  body {
    height: auto;
    overflow: auto;
  }

  .main-content {
    min-height: calc(100vh - 230px);
  }

  .header {
    justify-content: center;
    padding: 1.25rem;
  }

  .logo {
    height: 36px;
  }

  .footer-content {
    justify-content: center;
    font-size: 0.8rem;
  }

  .footer-social {
    text-align: center;
  }

  .display-content {
    width: 100%;
    height: 100%;
    padding: 1rem;
  }

  .footer {
    padding: 1rem;
  }

}

/* Custom scrollbar */
.sidebar-content::-webkit-scrollbar,
.display-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track,
.display-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb,
.display-content::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.5);
  border-radius: 20px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover,
.display-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.8);
}