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

body {
  overflow: hidden;
  background: #fffefb;
  font-family: system-ui, -apple-system, sans-serif;
  cursor: url('assets/olive-cursor-medium.png') 32 32, auto;
}

body.clicking {
  cursor: url('assets/olive-cursor-medium.png') 32 32, auto;
}

/* Cursor rotation effect on click */
@keyframes cursor-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(15deg); }
}

/* Landing page */
#landing {
  position: fixed;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: pointer;
  transition: opacity 0.8s ease;
}

#landing.fade-out {
  opacity: 0;
  pointer-events: none;
}

.landing-gif {
  width: 600px;
  max-width: 90vw;
  height: auto;
}

/* Search bar */
#search-bar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 500px;
  max-width: 90vw;
  display: flex;
  gap: 12px;
  align-items: center;
}

#search-bar.hidden {
  display: none;
}

#search-input {
  flex: 1;
  padding: 14px 20px;
  font-size: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  background: #ffffff;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

#search-input:focus {
  border-color: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#search-input::placeholder {
  color: #b0b0b0;
  font-weight: 300;
}

.country-btn {
  padding: 8px 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

.country-btn:hover {
  border-color: #999;
}

.country-btn.selected {
  background: #000;
  color: white;
  border-color: #000;
}

.confirm-btn {
  margin-top: 8px;
  padding: 8px 16px;
  background: #000;
  color: white;
  border: none;
  border-radius: 2px;
  font-size: 12px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  transition: opacity 0.15s;
  width: 100%;
}

.confirm-btn:hover:not(:disabled) {
  opacity: 0.8;
}

.confirm-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

#make-your-own-btn {
  padding: 14px 20px;
  font-size: 13px;
  background: #000;
  color: white;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  transition: opacity 0.15s;
}

#make-your-own-btn:hover {
  opacity: 0.8;
}

/* Italian flag and project info */
#flag-info {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 999;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 400px;
  background: white;
  padding: 12px;
  border-radius: 2px;
}

#flag-info.hidden {
  display: none;
}

.filippo-silhouette {
  width: 50px;
  height: auto;
  flex-shrink: 0;
  background: transparent;
  mix-blend-mode: multiply;
}

@keyframes subtle-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.project-info {
  background: #ffffff;
  padding: 16px 18px;
  border-radius: 2px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.project-info h3 {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #000;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

.project-info p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #666;
  font-weight: 400;
  letter-spacing: -0.005em;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  min-height: 20px;
}

#filippo-text {
  display: inline-block;
  border-right: 2px solid #666;
  padding-right: 2px;
  animation: blink-caret 0.75s step-end infinite;
}

#filippo-text.typing-done {
  border-right: none;
  animation: none;
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #666; }
}

.yes-btn {
  margin-top: 12px;
  padding: 10px 24px;
  background: #000;
  color: white;
  border: none;
  border-radius: 2px;
  font-size: 13px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  transition: opacity 0.15s;
}

.yes-btn:hover {
  opacity: 0.8;
}

.yes-btn.hidden {
  display: none;
}

/* Country filter inline in Filippo's box */
#country-filter-inline {
  margin-top: 16px;
}

#country-filter-inline.hidden {
  display: none;
}

.country-buttons-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.country-buttons-inline .country-btn {
  padding: 6px 12px;
  font-size: 11px;
}

/* Main canvas */
#canvas {
  position: fixed;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#canvas.hidden {
  display: none;
}

/* Bottles */
.bottle {
  position: absolute;
  cursor: url('assets/olive-cursor-medium.png') 32 32, grab;
  user-select: none;
  transition: opacity 0.4s ease, transform 0.3s ease, filter 0.3s ease;
  will-change: transform;
  z-index: 10;
}

.bottle[style*="opacity: 0"] {
  visibility: hidden;
}

.bottle:active {
  cursor: url('assets/olive-cursor-medium.png') 32 32, grabbing;
  z-index: 1000;
}

.bottle.highlight {
  filter: drop-shadow(0 0 20px rgba(139, 69, 19, 0.8)) brightness(1.2);
  animation: texture-pulse 1.5s ease-in-out;
}

@keyframes texture-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(139, 69, 19, 0.8)) brightness(1.2);
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(218, 165, 32, 1)) brightness(1.4) contrast(1.2);
  }
}

.bottle img {
  width: 100%;
  height: auto;
  pointer-events: none;
  display: block;
}

/* Info panel - background layer */
#info-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

#info-panel:not(.hidden) {
  opacity: 1;
}

#info-panel.hidden {
  opacity: 0;
}

#close-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 32px;
  color: #333;
  cursor: pointer;
  z-index: 10;
  padding: 8px;
  line-height: 1;
}

#close-panel:hover {
  color: #000;
}

#panel-content {
  position: absolute;
  bottom: 40px;
  left: 40px;
  max-width: 480px;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  color: #000;
  line-height: 1.5;
  pointer-events: auto;
}

#panel-content h2 {
  font-size: 56px;
  font-weight: 300;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  color: rgba(0, 0, 0, 0.95);
}

#panel-content .origin-claim {
  font-size: 15px;
  margin: 8px 0;
  color: rgba(0, 0, 0, 0.5);
  font-weight: 400;
}

#panel-content .actual-origin {
  font-size: 15px;
  margin: 8px 0;
  color: rgba(0, 0, 0, 0.85);
  font-weight: 400;
}

#panel-content p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(0, 0, 0, 0.7);
  margin: 16px 0;
  max-width: 420px;
}

#panel-content strong {
  font-weight: 500;
  color: rgba(0, 0, 0, 0.9);
}

.article-link {
  display: inline-block;
  margin-top: 12px;
  padding: 0;
  background: none;
  color: #000;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease;
  letter-spacing: -0.005em;
}

.article-link:hover {
  border-color: rgba(0, 0, 0, 1);
}

/* Print styles */
@media print {
  body {
    background: white;
    overflow: visible;
  }
  
  #landing, #search-bar, #canvas, #info-panel, #make-your-own {
    display: none !important;
  }
  
  .print-content {
    display: block !important;
  }
  
  .print-bottle {
    page-break-inside: avoid;
    margin-bottom: 40px;
    border-bottom: 1px solid #000;
    padding-bottom: 20px;
  }
  
  .print-bottle img {
    max-width: 150px;
    height: auto;
  }
  
  .print-bottle h2 {
    font-size: 24px;
    margin: 10px 0;
  }
  
  .print-bottle p {
    font-size: 11px;
    line-height: 1.4;
    margin: 5px 0;
  }
}

.print-content {
  display: none;
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
}

.print-title {
  font-size: 36px;
  font-weight: 300;
  margin-bottom: 40px;
  text-align: center;
}

/* Make Your Own Oil Section */
#make-your-own {
  width: 100%;
  min-height: 100vh;
  background: white;
  padding: 60px 40px;
  box-sizing: border-box;
  position: relative;
}

#make-your-own.hidden {
  display: none;
}

.back-btn {
  position: absolute;
  top: 40px;
  left: 40px;
  padding: 10px 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  font-size: 13px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  transition: all 0.15s;
}

.back-btn:hover {
  border-color: #000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.myo-container {
  max-width: 1200px;
  margin: 0 auto;
}

.myo-title {
  font-size: 56px;
  font-weight: 300;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 16px;
}

.myo-instructions {
  font-size: 15px;
  color: #666;
  text-align: center;
  margin-bottom: 60px;
}

.myo-workspace {
  display: grid;
  grid-template-columns: 1fr 300px 1fr;
  gap: 40px;
  align-items: start;
}

.olive-sources {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.olive-source {
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  padding: 30px 20px;
  text-align: center;
  cursor: grab;
  transition: all 0.15s;
  user-select: none;
}

.olive-source:hover {
  border-color: #000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.olive-source:active {
  cursor: grabbing;
}

.olive-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.olive-source span {
  display: block;
  font-size: 13px;
  color: #333;
}

.bottle-maker {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-bottle {
  width: 200px;
  height: 400px;
  border: 2px solid #000;
  border-radius: 2px;
  background: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

#olive-mix {
  width: 100%;
  height: calc(100% - 30px);
  position: relative;
  overflow-y: auto;
  padding: 10px;
  box-sizing: border-box;
}

.mix-count {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: #666;
  padding: 8px;
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  margin: 0;
}

.label-maker {
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  padding: 30px;
}

.label-maker h3 {
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 20px;
}

.label-maker input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  font-size: 13px;
  margin-bottom: 12px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.label-maker input:focus {
  outline: none;
  border-color: #000;
}

#create-bottle {
  width: 100%;
  padding: 14px;
  background: #000;
  color: white;
  border: none;
  border-radius: 2px;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

#create-bottle:hover {
  opacity: 0.8;
}

#label-preview {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  background: #f9f9f9;
  min-height: 100px;
  font-size: 12px;
  line-height: 1.6;
  display: none;
}

#label-preview.visible {
  display: block;
}

.olive-in-bottle {
  display: inline-block;
  font-size: 24px;
  margin: 4px;
  animation: drop 0.3s ease-out;
}

@keyframes drop {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Fall away animation for non-matching bottles */
@keyframes fall-away {
  from {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: translateY(100vh) rotate(20deg);
    opacity: 0;
  }
}

.bottle.falling-away {
  animation: fall-away 1s ease-in forwards;
  pointer-events: none;
}
