/* Global box sizing to prevent overflow math issues */
*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: url('egg-background.png') center/cover no-repeat;
  background-color: #f5f5f5;
  color: #333;
}

h1 {
  font-family: 'Edu NSW ACT Foundation', cursive;
  font-size: 2.5rem;
  color: #2c3e50;
  margin: 0;
  padding: 1rem;
  text-align: center;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: linear-gradient(90deg, #FFDA44 60%, #ffecb3 100%);
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.07);
}

header h1 { 
  margin: 0; 
  color: #333; 
}

header nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 0.5rem auto;
  max-width: 900px; /* keep nav within safe bounds */
  padding-left: 1rem;
  padding-right: 1rem;
}

header nav a {
  font-weight: 700;
  color: #2c3e50;
  text-decoration: none;
  font-size: 1.1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

header nav a:hover {
  background: #fffbe6;
  color: #ff8c00;
}

header nav button#bookmark-btn {
  margin-left: 1rem;
}

header nav button#install-btn {
  margin-left: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff3d0;
  border: 2px solid #2c3e50;
  border-radius: 6px;
  cursor: pointer;
}
header nav button#install-btn:hover {
  background: #ffeaa3;
}

main {
  max-width: 800px;
  width: 100%;
  padding: 2rem 2rem;
  background: rgba(255,255,255,0.85);
  border-radius: 8px;
  margin: 2rem auto; /* center without expanding beyond viewport */
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding-top: 110px; /* Adjust based on header height */
}

article {
  line-height: 1.6;
}

h2 {
  color: #d2691e;
  margin-bottom: 1.5rem;
}

ol {
  padding-left: 1.5rem;
}

ol li {
  margin-bottom: 1rem;
}

strong {
  color: #d2691e;
}

/* Blog specific styles */
.blog-list {
  list-style: none;
  padding: 0;
}

.blog-list li {
  background: #fff3d0;
  margin: 0.75rem 0;
  padding: 1rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.blog-list li:hover {
  background: #ffeaa3;
}

.blog-list a {
  color: #d2691e;
  text-decoration: none;
  font-weight: bold;
}

/* Timer specific styles */
#timer {
  text-align: center;
  margin-bottom: 1.5rem;
}

#timer label {
  font-weight: bold;
  margin-right: 0.5rem;
}

#timer select,
#timer button {
  margin: 0.5rem;
  padding: 0.75rem;
  font-size: 1rem;
  max-width: 100%;
}

#timer button {
  min-width: 150px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.1s ease;
}

#timer button:active {
  transform: scale(0.98);
}

#countdown {
  font-size: 2rem;
  margin-top: 1rem;
}

/* Instructions section styles */
#instructions {
  margin-top: 0;
  padding-top: 2rem;
  border-top: 2px solid #fff3d0;
}

#instructions h2 {
  margin-bottom: 1.5rem;
}

#instructions h3 {
  color: #d2691e;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.method-instructions {
  background: #fff3d0;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Inline note callout */
.note {
  background: #fff9e6;
  border-left: 4px solid #ffcc00;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin: 1rem 0;
}

.method-instructions ol {
  margin: 0;
  padding-left: 1.5rem;
}

.method-instructions ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.method-instructions li {
  margin-bottom: 0.75rem;
}

.method-instructions li:last-child {
  margin-bottom: 0;
}

.method-instructions ul li {
  margin-bottom: 0.5rem;
}

/* Bookmark button styles */
#bookmark-btn {
  margin-left: 1rem;
  padding: 0.5rem 1rem;
  background: #fff3d0;
  border: 2px solid #d2691e;
  border-radius: 4px;
  color: #d2691e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

#bookmark-btn:hover {
  background: #d2691e;
  color: white;
}

#bookmark-btn .bookmark-icon {
  font-size: 1.2rem;
}

#bookmark-btn .bookmark-text {
  font-weight: bold;
}

/* Bookmark message styles */
.bookmark-message {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1rem 2rem;
  border-radius: 4px;
  z-index: 1000;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* Blog page styles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.blog-card {
  background: #fff3d0;
  padding: 1.5rem;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.blog-card h3 {
  color: #d2691e;
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.blog-card p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.read-more {
  display: inline-block;
  color: #d2691e;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s ease;
}

.read-more:hover {
  color: #a0522d;
}

/* Timer Controls */
.timer-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
}

.timer-controls button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

#start-btn {
  background: #4CAF50;
  color: white;
}

#start-btn:hover {
  background: #45a049;
  transform: translateY(-2px);
}

#stop-btn {
  background: #f44336;
  color: white;
}

#stop-btn:hover {
  background: #da190b;
  transform: translateY(-2px);
}

#confirm-btn {
  background: #2196F3;
  color: white;
  animation: pulse 1.5s infinite;
}

#confirm-btn:hover {
  background: #1976D2;
  transform: translateY(-2px);
  animation: none;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
  }
}

.timer-display {
  font-size: 3rem;
  font-weight: bold;
  text-align: center;
  margin: 1rem 0;
  color: #2c3e50;
}

#timer-status {
  text-align: center;
  margin-top: 1rem;
  font-weight: 500;
  min-height: 1.5em;
}

/* Timer Options */
.timer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 140px;
}

.option-group label {
  font-weight: 600;
  color: #2c3e50;
}

.option-group select {
  padding: 0.5rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.option-group select:hover {
  border-color: #ffd700;
}

.option-group select:focus {
  outline: none;
  border-color: #ff8c00;
  box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.2);
}

/* Time Buttons */
.time-button {
  padding: 0.75rem 1.5rem;
  margin: 0.5rem;
  border: none;
  border-radius: 25px;
  background: #FFDA44;
  color: #2c3e50;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.time-button:hover {
  background: #ffd000;
  color: #2c3e50;
  transform: translateY(-2px);
}

.time-button.selected {
  background: #ff8c00;
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
} 

/* Accessibility: visible focus */
button:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid #ff8c00;
  outline-offset: 2px;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  body {
    background-attachment: scroll;
  }
  header nav {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem 1rem; /* add horizontal breathing room */
  }
  header h1 {
    font-size: 1.8rem;
  }
  main {
    margin: 0; /* avoid horizontal overflow */
    padding: 1rem 1.5rem; /* generous inner padding for edges */
    padding-top: 90px;
  }
  .note {
    padding: 1rem 1.25rem;
    margin-left: 0; /* align with main padding */
    margin-right: 0;
  }
  #timer button, #timer select {
    min-height: 44px;
    font-size: 1rem;
  }
  .timer-display {
    font-size: 2.2rem;
  }
}

/* Better scroll offset for in-page anchors when header is fixed */
html { scroll-padding-top: 120px; }