/* Reset and base styles */
:root {
  --primary-color: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --secondary-bg: #f8fafc;
  --border-color: #e2e8f0;
  --success-color: #059669;
  --success-light: #34d399;
  --accent-color: #8b5cf6;
  --accent-light: #a78bfa;
  --warning-color: #f59e0b;
  --error-color: #dc2626;
  --cooking-color: #ec4899;
  --length-color: #06b6d4;
  --weight-color: #8b5cf6;
  --volume-color: #f97316;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: linear-gradient(135deg, var(--secondary-bg), var(--bg-color));
  min-height: 100vh;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.conversion-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.two-column-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

@media (max-width: 768px) {
  .two-column-grid {
    grid-template-columns: 1fr;
  }
}

/* Card styles */
.card {
  background: var(--bg-color);
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  padding: 2rem;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.quick-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.quick-list li {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  font-size: 1.1rem;
}

.quick-list li:last-child {
  border-bottom: none;
}

.highlight {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.2rem;
}

.icon-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.icon-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--secondary-bg);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.icon-list li:hover {
  transform: translateX(5px);
  background: var(--primary-light);
  color: white;
}

.icon-list li:hover i {
  color: white;
}

.check-list li {
  position: relative;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success-color);
  font-weight: bold;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-color);
  opacity: 0.8;
}

#cooking .card::before {
  background: var(--cooking-color);
}

#length .card::before {
  background: var(--length-color);
}

#weight .card::before {
  background: var(--weight-color);
}

#volume .card::before {
  background: var(--volume-color);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.cardbutton {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button {
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  font-weight: 600;
  min-width: 250px;
  margin: 25px auto;
  display: block;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button i {
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

button:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Icon styles */
.icon {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
}

#catego#result {
  font-size: 2rem;
  font-weight: bold;
  color: var(--success-color);
  transition: all 0.3s ease;
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--success-color);
  color: white;
  border-radius: 9999px;
  margin: 0.5rem 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Animation keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animated elements */
.animate-in {
  animation: fadeIn 0.5s ease-out forwards;
}

header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  padding: 2rem 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

header h1 {
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
  color: var(--primary-light);
  font-size: 1.2rem;
}

nav {
  background: var(--bg-color);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

nav a {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  transition: all 0.3s ease;
}

nav a:hover {
  background-color: var(--primary-light);
  color: white;
  transform: translateY(-1px);
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 2rem;
  flex-wrap: wrap;
}

/* Typography */
h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

h2 {
  font-size: 1.8rem;
  margin: 2rem 0 1rem;
  color: var(--text-color);
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

a:hover {
  background-color: var(--primary-light);
  color: white;
  text-decoration: underline;
}

/* Sections */
section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-color);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

#conversion-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 300px;
  margin: 0 auto;
}

#conversion-form label {
  align-self: flex-start;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

input[type='number'] {
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 9999px;
  font-size: 1rem;
  width: 100%;
  transition: all 0.3s ease;
  background: var(--secondary-bg);
  text-align: center;
}

input[type='number']:hover {
  border-color: var(--primary-light);
}

input[type='number']:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
  background: white;
}

section:hover {
  transform: translateY(-2px);
}

section ul {
  list-style: none;
  padding: 0;
}

section li {
  margin: 0.5rem 0;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

section li:last-child {
  border-bottom: none;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding: 2rem 0;
  background: var(--secondary-bg);
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.result-container {
  margin-top: 1rem;
  padding: 1.5rem;
  background: var(--secondary-bg);
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.result-container p {
  font-size: 1.2rem;
  color: var(--text-light);
}

.card.animate-in h2,
section h2 {
  text-align: center;

}

.card.animate-in {
  padding-top: 0px;
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .container {
    padding: 0 0.5rem;
  }
}

/* FAQ styles */
.faq-section {
  background: linear-gradient(135deg, var(--success-color), var(--success-light));
  color: white;
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
}

.faq-section h2 {
  color: white;
  margin: 0;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.1);
}

.faq-section .faq-item {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-section .faq-item:last-child {
  border-bottom: none;
}

.faq-section .question {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.95);
}

.faq-section .answer {
  margin-left: 2rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Info sections */
.info-section {
  background: var(--bg-color);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.info-section h2 {
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.info-section p {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.info-section ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.info-section li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--secondary-bg);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.info-section li:hover {
  transform: translateX(5px);
  background: var(--primary-light);
  color: white;
}

.info-section li:hover i {
  color: white;
}

/* Formula box */
.formula-box {
  background: var(--secondary-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
  border-left: 4px solid var(--primary-color);
}

.formula-box p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.formula-example {
  color: var(--text-light);
  font-style: italic;
  margin-top: 1rem;
  text-align: center;
  font-size: 0.95rem;
}

/* Measurement types */
.measurement-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.liquid-measurements,
.dry-measurements {
  background: var(--secondary-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.measurement-types h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.measurement-types ul {
  list-style: none;
  padding: 0;
}

.measurement-types li {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.measurement-types li::before {
  content: '•';
  color: var(--primary-color);
  position: absolute;
  left: 0;
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  nav,
  footer {
    display: none;
  }

  .container {
    max-width: 100%;
  }
}

/* Expo WebView specific styles */
body.expo-webview {
  padding-bottom: 70px;
}

body.expo-webview>nav:first-of-type {
  display: none;
}

/* Bottom Navigation Menu */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  min-width: 60px;
}

.bottom-nav-item:hover,
.bottom-nav-item:active {
  color: var(--primary-color);
  background: var(--secondary-bg);
  text-decoration: none;
}

.bottom-nav-item i {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.bottom-nav-item.nav-home i {
  color: var(--success-color);
}

.bottom-nav-item.nav-length i {
  color: var(--length-color);
}

.bottom-nav-item.nav-weight i {
  color: var(--weight-color);
}

.bottom-nav-item.nav-volume i {
  color: var(--volume-color);
}

.bottom-nav-item.nav-cooking i {
  color: var(--cooking-color);
}

.bottom-nav-item span {
  font-weight: 500;
}

/* WebView Footer styles */
.webview-footer {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 0;
}

.webview-footer a {
  color: var(--text-light);
  font-size: 0.9rem;
}

.webview-footer a:hover {
  color: var(--primary-color);
}