
:root {
  --primary: #1a237e;
  --accent: #d32f2f;
  --light: #f5f5f5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: var(--light);
  color: #333;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 4c2.2 0 4 1.8 4 4s-1.8 4-4 4-4-1.8-4-4 1.8-4 4-4zm6 12c0 2.2-1.8 4-4 4s-4-1.8-4-4 1.8-4 4-4 4 1.8 4 4zm-12 0c0 2.2-1.8 4-4 4s-4-1.8-4-4 1.8-4 4-4 4 1.8 4 4zm12 12c0 2.2-1.8 4-4 4s-4-1.8-4-4 1.8-4 4-4 4 1.8 4 4z' fill='%23e0e0e0' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  border-radius: 8px;
}

h1 {
  color: var(--primary);
  text-align: center;
  margin-bottom: 2rem;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 1rem;
}

h2 {
  color: var(--primary);
  margin: 1.5rem 0 1rem;
  font-size: 1.2rem;
}

section {
  margin-bottom: 2rem;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

textarea {
  resize: vertical;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.generate-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  background-color: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.generate-btn:hover {
  background-color: #b71c1c;
}

#imagePreview {
  max-width: 200px;
  margin: 1rem 0;
}

#imagePreview img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.add-record-btn {
  background-color: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 1rem;
}

.add-record-btn:hover {
  background-color: #151b60;
}

.vet-record {
  margin-bottom: 1rem;
}

.emergency-sheet {
  padding: 1in;
  max-width: 8.5in;
  margin: 0 auto;
  background: white;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.photo-section img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.medical-section,
.vet-section {
  margin-bottom: 2rem;
}

.medical-details {
  display: grid;
  gap: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

th, td {
  border: 1px solid #ddd;
  padding: 0.5rem;
  text-align: left;
}

.print-btn,
.reset-btn {
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.print-btn {
  background: var(--accent);
  color: white;
}

.reset-btn {
  background: var(--primary);
  color: white;
}

@media print {
  .print-btn,
  .reset-btn {
    display: none;
  }
  
  .emergency-sheet {
    padding: 0;
  }
  
  body {
    background: none;
  }
}

@media print {
  .container {
    margin: 0.5in !important;
    padding: 0.5in !important;
    max-width: 8.5in !important;
    box-shadow: none !important;
  }
  
  .generate-btn,
  .add-record-btn {
    display: none !important;
  }

  textarea {
    height: auto !important;
    min-height: unset !important;
    overflow: visible !important;
  }

  #imagePreview img {
    max-height: 2in !important;
    width: auto !important;
    object-fit: contain;
  }
}
