/* Custom CSS Utilities for ChatGPT Design System */

/* CSS Custom Properties (Variables) */
:root {
  /* Color Tokens - ChatGPT exact colors */
  --token-bg-primary: #ffffff;
  --token-bg-secondary: #e8e8e8;
  --token-bg-tertiary: #f3f3f3;
  --token-bg-elevated-secondary: #f9f9f9;
  --token-main-surface-tertiary: #f1f1f1;
  
  --token-text-primary: #0d0d0d;
  --token-text-secondary: #5d5d5d;
  --token-text-tertiary: #8f8f8f;
  --token-text-inverted: #ffffff;
  
  --token-border-default: rgba(13, 13, 13, 0.1);
  --token-border-light: rgba(13, 13, 13, 0.05);
  --token-border-primary: rgba(13, 13, 13, 0.15);
  --token-border-heavy: rgba(13, 13, 13, 0.2);
  
  --token-interactive-bg-primary-default: #0d0d0d;
  --token-interactive-bg-primary-hover: rgba(13, 13, 13, 0.8);
  --token-icon-inverted: #ffffff;
  
  /* Layout Tokens */
  --mkt-header-height: 4rem;
  --font-oai: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Custom Utility Classes */

/* Text utilities */
.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

/* Layout utilities */
.scroll-mt-mkt-header-height {
  scroll-margin-top: var(--mkt-header-height);
}

.top-mkt-header-height {
  top: var(--mkt-header-height);
}

/* Animation utilities */
.animate-fade-in {
  animation: fade-in 0.3s ease-in-out;
}

.animate-slide-up {
  animation: slide-up 0.3s ease-out;
}

.animate-scale-in {
  animation: scale-in 0.2s ease-out;
}

/* Custom animations */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scale-in {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Button utilities */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease-in-out;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn:focus {
  outline: none;
  ring: 2px;
  ring-offset: 2px;
}

.btn-primary {
  background-color: var(--token-interactive-bg-primary-default);
  color: var(--token-text-inverted);
}

.btn-primary:hover {
  background-color: var(--token-interactive-bg-primary-hover);
}

.btn-primary:focus {
  ring-color: var(--token-interactive-bg-primary-default);
}

.btn-secondary {
  background-color: var(--token-bg-secondary);
  color: var(--token-text-primary);
  border: 1px solid var(--token-border-default);
}

.btn-secondary:hover {
  background-color: var(--token-bg-tertiary);
}

.btn-secondary:focus {
  ring-color: var(--token-border-primary);
}

.btn-ghost {
  background-color: transparent;
  color: var(--token-text-primary);
}

.btn-ghost:hover {
  background-color: var(--token-bg-secondary);
}

.btn-ghost:focus {
  ring-color: var(--token-border-primary);
}

.btn-primary-inverse {
  background-color: var(--token-text-inverted);
  color: var(--token-bg-primary);
}

.btn-primary-inverse:hover {
  background-color: rgba(var(--token-text-primary), 0.9);
}

.btn-primary-inverse:focus {
  ring-color: var(--token-text-inverted);
}

.btn-large {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Card utilities */
.card {
  background-color: var(--token-bg-primary);
  border: 1px solid var(--token-border-default);
  border-radius: 1rem;
  padding: 1.5rem;
}

.card-elevated {
  background-color: var(--token-bg-elevated-secondary);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-interactive {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Typography utilities */
.font-oai {
  font-family: var(--font-oai);
}

/* Exact ChatGPT typography definitions */
.text-mkt-h1 {
  font-size: clamp(2rem, 3.0047vw + 1.29577rem, 4rem);
  letter-spacing: -0.03em;
  line-height: clamp(2.2rem, calc(1.5662rem + 2.70423vw), 4rem);
}

.text-mkt-h2 {
  font-size: clamp(2rem, 1.50235vw + 1.64789rem, 3rem);
  font-weight: 500;
  letter-spacing: clamp(-0.03em, calc(-0.03em + 0.02704rem - 0.03005vw), -0.01em);
  line-height: clamp(2.28rem, calc(1.85746rem + 1.80282vw), 3.48rem);
}

.text-mkt-h3 {
  font-size: clamp(1.5rem, 0.56338vw + 1.36796rem, 1.875rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: clamp(1.98rem, calc(1.8057rem + 0.74366vw), 2.475rem);
}

.text-mkt-h4 {
  font-size: clamp(1.25rem, 0.187793vw + 1.20599rem, 1.375rem);
  line-height: clamp(1.5rem, calc(1.41813rem + 0.3493vw), 1.7325rem);
}

.text-mkt-h6 {
  font-size: clamp(1rem, 0.187793vw + 0.955986rem, 1.125rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: clamp(1.25rem, calc(1.16725rem + 0.35305vw), 1.485rem);
}

.text-mkt-p1 {
  font-size: 1.0625rem;
  line-height: 1.74994rem;
}

.text-mkt-p2 {
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.435rem;
}

.text-mkt-xs {
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: clamp(-0.01em, calc(-0.01em + 0.01352rem - 0.01502vw), 0em);
  line-height: 0.825rem;
}

/* Button Base Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.435rem;
  border-radius: 9999px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn.-mkt {
  padding: 0.625rem 1.25rem;
}

.btn-primary-inverse {
  background-color: #f3f3f3;
  color: var(--token-text-primary);
  border: none;
}

.btn-primary-inverse:hover {
  background-color: #e8e8e8;
}

.btn-ghost {
  background-color: transparent;
  color: var(--token-text-primary);
  border: none;
}

.btn-ghost:hover {
  background-color: #f3f3f3;
}

/* Scrollbar Utilities */
.mkt-scrollable {
  overflow-x: auto;
  overflow-y: hidden;
}

.mkt-no-scrollbar::-webkit-scrollbar {
  display: none;
}

.mkt-no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Responsive utilities */
@media (max-width: 640px) {
  .text-mkt-h1 {
    font-size: 2.5rem;
  }
  
  .text-mkt-h2 {
    font-size: 2rem;
  }
  
  .text-mkt-h3 {
    font-size: 1.5rem;
  }
}

/* Accessibility utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.focus-visible:focus {
  outline: 2px solid var(--token-interactive-bg-primary-default);
  outline-offset: 2px;
}

/* Print utilities */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
}
