/* Pacific Northwest Summer Color Scheme */
:root {
  --primary-green: #2d5a3d;
  --secondary-teal: #4a7c59;
  --accent-teal: #6b9e78;
  --light-teal: #a8d5ba;
  --warm-gray: #8b8680;
  --light-gray: #f5f5f0;
  --white: #ffffff;
  --error-red: #d2691e;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--primary-green);
  background: linear-gradient(
    135deg,
    var(--light-teal) 0%,
    var(--accent-teal) 100%
  );
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 3rem;
  font-weight: 300;
  margin-bottom: 0.5rem;
}

.mesh {
  color: var(--primary-green);
}

.arrow {
  color: var(--secondary-teal);
  font-size: 2.5rem;
  vertical-align: middle;
  margin: 0 0.2rem;
}

.point {
  color: var(--primary-green);
}

.subtitle {
  color: var(--warm-gray);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* Form styles */
.bearing-form {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--light-teal);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section h2 {
  color: var(--primary-green);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.input-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--secondary-teal);
}

input[type='text'] {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--light-teal);
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

input[type='text']:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(107, 158, 120, 0.1);
}

.radio-group {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: normal;
}

input[type='radio'] {
  margin: 0;
}

/* Buttons */
.primary-btn,
.secondary-btn {
  background: var(--primary-green);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
  margin-top: 1rem;
}

.primary-btn:hover,
.secondary-btn:hover {
  background: var(--secondary-teal);
}

.secondary-btn {
  background: var(--accent-teal);
  margin-top: 0.5rem;
}

.secondary-btn:hover {
  background: var(--secondary-teal);
}

/* Results */
.results {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.results h2 {
  color: var(--primary-green);
  margin-bottom: 1.5rem;
  text-align: center;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--light-gray);
  border-radius: 6px;
}

.result-item:last-child {
  margin-bottom: 0;
}

.label {
  font-weight: 500;
  color: var(--secondary-teal);
}

.value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-green);
}

/* Compass */
.compass-container {
  text-align: center;
  margin-top: 2rem;
}

.compass {
  width: 120px;
  height: 120px;
  border: 3px solid var(--primary-green);
  border-radius: 50%;
  margin: 0 auto;
  position: relative;
  background: var(--light-gray);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Compass rose markings */
.compass::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 100%;
  background: var(--primary-green);
  transform: translate(-50%, -50%);
  opacity: 0.5;
}

.compass::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--primary-green);
  transform: translate(-50%, -50%);
  opacity: 0.5;
}

/* Outer ring for degree markings */
.compass .outer-ring {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border: 1px solid var(--accent-teal);
  border-radius: 50%;
  opacity: 0.3;
}

/* Inner circle */
.compass .inner-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--primary-green);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Cardinal direction labels */
.compass .direction {
  position: absolute;
  font-weight: bold;
  color: var(--primary-green);
  font-size: 14px;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.compass .direction.north {
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
}

.compass .direction.south {
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
}

.compass .direction.east {
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
}

.compass .direction.west {
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
}

/* Intermediate direction markers */
.compass .direction.ne {
  top: 15px;
  right: 15px;
}

.compass .direction.se {
  bottom: 15px;
  right: 15px;
}

.compass .direction.sw {
  bottom: 15px;
  left: 15px;
}

.compass .direction.nw {
  top: 15px;
  left: 15px;
}

.compass-arrow {
  position: absolute;
  top: 10px;
  left: 50%;
  transform-origin: bottom center;
  font-size: 2rem;
  color: var(--error-red);
  transform: translateX(-50%);
  z-index: 2;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.3));
}

/* Error */
.error {
  background: #ffe6e6;
  color: var(--error-red);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #ffcccc;
  margin-bottom: 2rem;
  position: relative;
  z-index: 10;
}

/* Ensure error messages are visible on mobile */
@media (max-width: 768px) {
  .error {
    margin-bottom: 1rem;
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}

/* Footer */
footer {
  text-align: center;
  color: var(--warm-gray);
  margin-top: 2rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  h1 {
    font-size: 2.5rem;
  }

  .bearing-form {
    padding: 1.5rem;
  }

  .radio-group {
    flex-direction: column;
    gap: 1rem;
  }

  .result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .compass {
    width: 100px;
    height: 100px;
  }

  .compass-arrow {
    font-size: 1.5rem;
  }

  .compass .direction {
    font-size: 12px;
  }

  .compass .direction.north {
    top: 3px;
  }

  .compass .direction.south {
    bottom: 3px;
  }

  .compass .direction.east {
    right: 3px;
  }

  .compass .direction.west {
    left: 3px;
  }

  .compass .direction.ne {
    top: 10px;
    right: 10px;
  }

  .compass .direction.se {
    bottom: 10px;
    right: 10px;
  }

  .compass .direction.sw {
    bottom: 10px;
    left: 10px;
  }

  .compass .direction.nw {
    top: 10px;
    left: 10px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .bearing-form {
    padding: 1rem;
  }

  .form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
  }
}
