@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Mobile Safari/Chrome specific resets */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  touch-action: pan-y;
}

/* Fix mobile Safari viewport issues */
@supports (-webkit-appearance: none) {
  .container {
    min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Mobile Chrome fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  input, button, textarea {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
  }
}

html {
  height: 100%;
  width: 100%;
}

body {
  padding-top: 80px; /* adjust based on navbar height */
  background: linear-gradient(to bottom right, #a1c4fd, #c2e9fb);
  min-height: 100vh;
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 1rem 2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-sizing: border-box;
}

.navbar .logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2cb67d;
  text-decoration: none;
}

.navbar .hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.navbar .hamburger span {
  width: 25px;
  height: 3px;
  background-color: #333;
  margin: 3px 0;
  transition: 0.3s;
  display: block;
}

.navbar .hamburger.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.navbar .hamburger.active span:nth-child(2) {
  opacity: 0;
}

.navbar .hamburger.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

.navbar .nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.navbar .nav-links li a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s;
}

.navbar .nav-links li a:hover {
  color: #2cb67d;
}

/* Mobile */
@media (max-width: 768px) {
  .navbar .hamburger {
    display: flex;
  }

  .navbar .nav-links {
    display: none;
    flex-direction: column;
    gap: 1rem;
    background: white;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
  }

  .navbar .nav-links.active {
    display: flex;
  }
}
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  background: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 999;
}
nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

nav a:hover {
  color: #4CAF50;
}

.container {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  max-width: 500px;
  width: 90%;
  text-align: center;
  margin: 2rem auto;
  position: relative;
  box-sizing: border-box;
  overflow: visible;
  min-height: auto;
  left: 0;
  right: 0;
}
ul {
  list-style: none;
  padding-left: 0;
}
h1 {
  color: #333;
  margin-bottom: 10px;
  font-size: 2.5em;
  font-weight: 600;
}

p {
  color: #666;
  margin-bottom: 30px;
  font-size: 1.1em;
}

#productInput {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  margin-bottom: 20px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

/* Mobile input field fixes */
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

/* Mobile checkbox styling */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: white;
  border: 2px solid #e0e0e0;
  border-radius: 3px;
  width: 18px;
  height: 18px;
  position: relative;
  cursor: pointer;
}

input[type="checkbox"]:checked {
  background-color: #667eea;
  border-color: #667eea;
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: -1px;
  left: 2px;
  color: white;
  font-size: 14px;
  font-weight: bold;
}

#productInput:focus {
  outline: none;
  border-color: #667eea;
}

button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 30px;
}

ol {
  padding-left: 1.2rem;
  margin-bottom: 1.5rem;
}

ol li {
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

#resultBox {
  margin-top: 20px;
}

.result {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 25px;
  text-align: left;
  border-left: 5px solid #28a745;
}

.result.medium {
  border-left-color: #ffc107;
}

.result.high {
  border-left-color: #dc3545;
}

.result.unknown {
  border-left-color: #6c757d;
}

.result h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.4em;
}

.warning {
  margin-top: 0.5rem;
  padding: 10px;
  font-weight: bold;
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  border-radius: 5px;
}

.risk-level {
  font-size: 1.1em;
  margin-bottom: 20px;
  padding: 10px;
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
}

.details {
  display: grid;
  gap: 12px;
}

.detail-item {
  color: #555;
  line-height: 1.6;
}

.detail-item strong {
  color: #333;
}

.description {
  background: rgba(255,255,255,0.9);
  padding: 15px;
  border-radius: 8px;
  color: #666;
  font-style: italic;
  margin-top: 10px;
}

.loading {
  color: #667eea;
  font-size: 1.2em;
  padding: 20px;
  animation: pulse 1.5s infinite;
}

.error {
  color: #dc3545;
  background: #f8d7da;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #f5c6cb;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Desktop styles */
@media (min-width: 601px) {
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }
  
  .container {
    margin: 2rem auto;
    max-width: 600px;
    width: 90%;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 20px;
    margin: 10px;
    margin-bottom: 2rem;
    overflow: visible;
  }
  
  h1 {
    font-size: 2em;
  }
  
  /* Ensure mobile scrolling works properly */
  body {
    min-height: 100vh;
    height: auto;
    padding-bottom: 2rem;
  }
  
  /* Fix iOS Safari scrolling issues */
  html {
    height: -webkit-fill-available;
  }
  
  body {
    min-height: -webkit-fill-available;
  }
}