/* The following @tailwind directives require Tailwind CSS to be processed via PostCSS.
   If you see "Unknown at rule @tailwind", ensure your build tool is set up for Tailwind.
   See https://tailwindcss.com/docs/installation for setup instructions. */
@tailwind base;
@tailwind components;
@tailwind utilities;


:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}

/* Mobile-First Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #F9FAFB;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overscroll-behavior-y: contain;
}

#root {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Container - Mobile First */
.container,
.app-container,
[class*="container"] {
  width: 100%;
  max-width: 100vw;
  padding-left: 16px;
  padding-right: 16px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Typography - Responsive */
h1, h2, h3, h4, h5, h6 {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  line-height: 1.2;
}

h1 {
  font-size: clamp(24px, 6vw, 36px);
}

h2 {
  font-size: clamp(20px, 5vw, 32px);
}

h3 {
  font-size: clamp(18px, 4.5vw, 24px);
}

p {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  line-height: 1.5;
  font-size: clamp(14px, 3.5vw, 16px);
}

/* Images - Responsive */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Cards and Sections */
.card,
.section,
[class*="card"],
[class*="section"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Hero Section - Mobile Optimized */
.hero-card,
.hero-section,
[class*="hero"] {
  width: 100%;
  max-width: 100%;
  padding: 24px 16px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #2563EB 0%, #7C3AED 50%, #EC4899 100%);
}

.hero-title {
  font-size: clamp(20px, 5vw, 32px);
  color: white;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.2;
  font-weight: 700;
}

.hero-subtitle {
  font-size: clamp(12px, 3vw, 16px);
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  line-height: 1.5;
}

/* Buttons - Touch Optimized */
button,
.button,
[type="button"],
[type="submit"] {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  touch-action: manipulation;
}

button:active,
.button:active {
  transform: scale(0.98);
}

/* Button Group */
.button-group {
  display: flex;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
}

.button-group button {
  flex: 1;
  min-width: 0;
}

/* Input Fields - Mobile Optimized */
input,
textarea,
select {
  width: 100%;
  max-width: 100%;
  padding: 14px 16px;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  font-size: 16px !important; /* Prevents iOS zoom */
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  background: #F9FAFB;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2563EB;
  background: white;
}

input::placeholder {
  color: #9CA3AF;
}

/* Input Groups */
.input-group {
  width: 100%;
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  background: #F9FAFB;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  padding: 2px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.input-wrapper:focus-within {
  border-color: #2563EB;
  background: white;
}

.input-field {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 16px;
  font-size: 16px !important;
  outline: none;
  min-width: 0;
}

.input-unit {
  padding: 0 16px;
  color: #6B7280;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: 8px;
}

.gap-4 {
  gap: 16px;
}

/* Spacing Utilities */
.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.p-4 {
  padding: 16px;
}

/* Text Utilities */
.text-center {
  text-align: center;
}

.font-bold {
  font-weight: 700;
}

/* Responsive Breakpoints */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  .container,
  .app-container {
    max-width: 540px;
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .container,
  .app-container {
    max-width: 720px;
  }
  
  .hero-card,
  .hero-section {
    padding: 32px 24px;
  }
  
  button,
  .button {
    padding: 14px 20px;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .container,
  .app-container {
    max-width: 960px;
  }
}

/* Extra small devices (phones in portrait, up to 375px) */
@media (max-width: 375px) {
  .container,
  .app-container {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  .hero-card,
  .hero-section {
    padding: 20px 12px;
    border-radius: 16px;
  }
  
  button,
  .button {
    padding: 12px 12px;
    font-size: 15px;
  }
  
  .button-group {
    gap: 8px;
  }
}

/* Landscape mode optimizations */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-card,
  .hero-section {
    padding: 16px;
  }
  
  .hero-title {
    font-size: 20px;
  }
  
  .hero-subtitle {
    font-size: 12px;
  }
  
  .input-group {
    margin-bottom: 16px;
  }
}

/* Utility: Prevent text selection on buttons */
button,
.button {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* Utility: Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Utility: Hide scrollbars but keep functionality */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Accessibility: Focus visible */
*:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

/* Performance optimizations */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent double-tap zoom on iOS */
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

/* Optimize for dark mode if needed */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles if desired */
  /* For now, keeping light mode only */
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize for retina displays if needed */
}

/* Print styles */
@media print {
  body {
    background: white;
  }
  
  button {
    display: none;
  }
}
