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

body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

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

header {
  text-align: center;
  margin-bottom: 40px;
  color: white;
}

header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-text {
  flex: 1;
}

/* Hamburger Menu Styles */
.hamburger-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.hamburger-menu.active {
  visibility: visible;
  opacity: 1;
}

.menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 350px;
  height: 100%;
  background: white;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.hamburger-menu.active .menu-content {
  transform: translateX(0);
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid #e2e8f0;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.menu-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.close-menu {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.close-menu:hover {
  background: rgba(255, 255, 255, 0.2);
}

.menu-section {
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.menu-section:last-child {
  border-bottom: none;
}

.menu-section h4 {
  margin: 0 0 15px 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2d3748;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f7fafc;
}

.shortcut-item:last-child {
  border-bottom: none;
}

.shortcut-key {
  background: #f7fafc;
  padding: 5px 10px;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5568;
  border: 1px solid #e2e8f0;
}

.shortcut-desc {
  color: #718096;
  font-size: 0.95rem;
}

.feature-list,
.tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li,
.tips-list li {
  padding: 8px 0;
  color: #4a5568;
  font-size: 0.95rem;
  border-bottom: 1px solid #f7fafc;
}

.feature-list li:last-child,
.tips-list li:last-child {
  border-bottom: none;
}

/* Timer Settings Styles */
.timer-setting {
  margin-bottom: 15px;
}

.timer-setting label {
  display: block;
  font-weight: 500;
  color: #4a5568;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.timer-select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  color: #2d3748;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.timer-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.timer-select:hover {
  border-color: #cbd5e0;
}

.timer-info {
  background: #f7fafc;
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.timer-info p {
  margin: 0;
  font-size: 0.9rem;
  color: #4a5568;
}

.timer-info span {
  font-weight: 600;
  color: #2d3748;
}

/* Hamburger Button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 25px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 20px;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn:hover span {
  background: rgba(255, 255, 255, 0.8);
}

/* Hamburger button animation */
.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

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

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

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.timer-section {
  grid-column: 1 / -1;
}

.timer-card,
.dog-info-card,
.activity-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Ensure dog info and activity cards match height within the same grid row */
.dog-info-card,
.activity-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.timer-card:hover,
.dog-info-card:hover,
.activity-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.timer-card h2,
.dog-info-card h2,
.activity-card h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #2d3748;
  text-align: center;
}

/* Timer Header */
.timer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.timer-header h2 {
  margin: 0;
  text-align: left;
}

.settings-btn {
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  transform: rotate(90deg);
}

/* Timer Settings Panel */
.timer-settings-panel {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  display: none;
  animation: slideDown 0.3s ease;
}

.timer-settings-panel.active {
  display: block;
}

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

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.settings-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2d3748;
}

.close-settings {
  background: none;
  border: none;
  color: #718096;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.close-settings:hover {
  background: rgba(113, 128, 150, 0.1);
  color: #4a5568;
}

/* Timer Styles */
.timer-display {
  text-align: center;
  margin-bottom: 30px;
}

.time-left {
  font-size: 4rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 10px;
  font-family: "Courier New", monospace;
}

.timer-status {
  font-size: 1.2rem;
  color: #718096;
  font-weight: 500;
}

.timer-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: visible;
  margin-top: 30px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  width: 0%;
  transition: width 1s ease;
}

/* Jumping Dog Animation */
.jumping-dog {
  position: absolute;
  top: -30px;
  left: 0;
  font-size: 28px;
  transition: left 1s ease;
  animation: jump 0.8s infinite alternate;
  z-index: 10;
  transform: scaleX(-1);
}

@keyframes jump {
  0% {
    transform: translateY(0px) rotate(0deg) scaleX(-1);
  }
  50% {
    transform: translateY(-8px) rotate(5deg) scaleX(-1);
  }
  100% {
    transform: translateY(0px) rotate(0deg) scaleX(-1);
  }
}

/* Make progress bar relative for absolute positioning */
.progress-bar {
  position: relative;
}

/* Button Styles */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: 44px; /* Touch-friendly minimum height */
  touch-action: manipulation; /* Optimize for touch */
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.btn-warning {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  color: white;
}

.btn-info {
  background: linear-gradient(135deg, #a8edea, #fed6e3);
  color: #2d3748;
  margin: 5px;
}

/* Dog Header */
.dog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.dog-header h2 {
  margin: 0;
  text-align: left;
}

.dog-selector {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-width: 0;
  margin-top: 10px;
}

.dog-selector label {
  font-weight: 500;
  color: #4a5568;
  font-size: 0.9rem;
}

.dog-select {
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  background: white;
  color: #2d3748;
  cursor: pointer;
  transition: border-color 0.3s ease;
  min-height: 44px; /* Touch-friendly minimum height */
}

.dog-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dog-select:hover {
  border-color: #cbd5e0;
}

/* Dog Actions */
.dog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-danger {
  background: linear-gradient(135deg, #f56565, #e53e3e);
  color: white;
}

/* Form Styles */
.dog-form {
  display: grid;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 500;
  color: #4a5568;
  font-size: 0.95rem;
}

.form-group input {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  min-height: 44px; /* Touch-friendly minimum height */
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Activity Section */
.activity-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.activity-meta {
  text-align: center;
  color: #718096;
  font-size: 0.9rem;
  margin: 8px 0 12px 0;
}

.activity-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 15px;
}

.no-activities {
  text-align: center;
  color: #a0aec0;
  font-style: italic;
  padding: 20px;
}

.activity-item {
  background: #f7fafc;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.activity-item:last-child {
  margin-bottom: 0;
}

.activity-info {
  flex: 1;
}

.activity-actions button {
  background: none;
  border: none;
  color: #e53e3e;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
}

.activity-actions button:hover {
  background: rgba(229, 62, 62, 0.1);
}

.activity-type {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 5px;
}

.activity-time {
  font-size: 0.9rem;
  color: #718096;
}

/* Responsive Design */
@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .container {
    padding: 15px;
  }

  header h1 {
    font-size: 2.5rem;
  }

  .time-left {
    font-size: 3rem;
  }

  .timer-controls {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .btn {
    width: 100%;
    max-width: 200px;
    padding: 12px;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .activity-controls {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .dog-form {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .dog-form input,
  .dog-form select {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 12px;
  }

  .timer-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .settings-btn {
    align-self: flex-end;
  }

  .progress-bar {
    margin-top: 35px; /* More space for larger dog emoji on mobile */
  }

  .jumping-dog {
    font-size: 32px; /* Larger on mobile for better visibility */
    top: -35px;
  }

  /* Mobile hamburger menu adjustments */
  .menu-content {
    width: 95%;
    max-width: 400px;
  }

  .hamburger-btn {
    margin-left: 15px;
  }

  .header-content {
    flex-direction: row;
    align-items: center;
  }

  .timer-card,
  .dog-info-card,
  .activity-card {
    padding: 20px;
    margin-bottom: 15px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }

  .timer-card,
  .dog-info-card,
  .activity-card {
    padding: 15px;
    margin-bottom: 10px;
  }

  .timer-header h2 {
    font-size: 1.5rem;
  }

  .dog-header h2,
  .activity-card h2 {
    font-size: 1.3rem;
  }

  .time-left {
    font-size: 2.5rem;
  }

  .timer-status {
    font-size: 0.9rem;
  }

  .btn {
    padding: 10px 15px;
    font-size: 14px;
  }

  .activity-item {
    padding: 12px;
    flex-direction: column;
    gap: 10px;
  }

  .activity-actions {
    align-self: flex-end;
  }

  .delete-activity {
    padding: 8px 12px;
    font-size: 12px;
  }

  .hamburger-btn {
    width: 40px;
    height: 40px;
  }

  .menu-content {
    width: 98%;
    padding: 20px;
  }

  header h1 {
    font-size: 2rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding: 30px;
  }

  .timer-card,
  .dog-info-card,
  .activity-card {
    padding: 25px;
  }

  .dog-form {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .activity-controls {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .time-left {
    font-size: 3.5rem;
  }
}

/* Animation for timer completion */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.timer-complete {
  animation: pulse 1s infinite;
}

/* Scrollbar styling */
.activity-list::-webkit-scrollbar {
  width: 6px;
}

.activity-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.activity-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.activity-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
