* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  padding-bottom: 60px;
}

/* ===========================
   iOS STYLE TOAST NOTIFICATION
   =========================== */
.toast-notification {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 41, 59, 0.98);
  backdrop-filter: blur(20px);
  color: white;
  padding: 16px 24px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  transition: top 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 90%;
  width: 420px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.toast-notification.show {
  top: 20px;
}

.toast-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 14px;
  opacity: 0.9;
  word-wrap: break-word;
}

/* ===========================
   HEADER
   =========================== */
header {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

/* Decorative gradient overlay */
header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  pointer-events: none;
}

.header-content {
  position: relative;
  z-index: 1;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 12px;
}

.logo-img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

header h1 {
  margin: 0;
  font-size: 2.5em;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-text {
  margin: 12px 0 20px 0;
  font-size: 1.1em;
  opacity: 0.9;
  color: #cbd5e1;
}

.header-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ===========================
   FOOTER
   =========================== */
footer {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  color: white;
  padding: 20px;
  text-align: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

footer p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

/* ===========================
   BUTTONS
   =========================== */
.button {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.button:active {
  transform: translateY(0);
}

.start-button {
  background: #22c55e;
  color: white;
  padding: 10px 18px;
  font-size: 0.95em;
}

.pause-button {
  background: #f59e0b;
  color: white;
  padding: 10px 18px;
  font-size: 0.95em;
}

.reset-button {
  background: #ef4444;
  color: white;
  padding: 10px 18px;
  font-size: 0.95em;
}

.save-button {
  background: #3b82f6;
  color: white;
}

.remote-button {
  background: #8b5cf6;
  color: white;
}

.delete-button {
  background: #dc2626;
  color: white;
  padding: 10px 18px;
  font-size: 0.95em;
}

/* ===========================
   MAIN CONTENT
   =========================== */
main {
  padding: 30px 20px;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease;
  flex: 1;
  width: 100%;
  text-align: center;
}

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

/* ===========================
   SECTIONS
   =========================== */
.section {
  background: white;
  padding: 24px;
  margin-bottom: 24px;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.section.blue {
  border-left: 6px solid #3b82f6;
}

.section.orange {
  border-left: 6px solid #f59e0b;
}

.section.red {
  border-left: 6px solid #ef4444;
}

.section h2 {
  margin: 0 0 20px 0;
  color: #1e293b;
  font-size: 1.8em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.section.blue h2::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.section.orange h2::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #f59e0b;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.section.red h2::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* ===========================
   TIMER BLOCKS
   =========================== */
.timer-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #f8fafc;
  padding: 16px 18px;
  margin-top: 12px;
  border-radius: 14px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  max-width: 800px;
  width: 100%;
}

.timer-block:hover {
  background: #f1f5f9;
}

.timer-block.active {
  background: #e0f2fe;
  border-color: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.editable {
  flex: 1;
  font-weight: 600;
  color: #1e293b;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s ease;
  cursor: text;
  margin: 0;
}

.editable:focus {
  outline: none;
  background: #e2e8f0;
}

.stopwatch {
  width: 80px;
  text-align: center;
  font-weight: bold;
  font-size: 1.3em;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.buttons {
  display: flex;
  gap: 8px;
}

/* ===========================
   ADD NEW TIMER SECTION
   =========================== */
.add-section {
  background: white;
  padding: 24px;
  margin-bottom: 40px;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-left: 6px solid #8b5cf6;
  max-width: 800px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.add-section select,
.add-section input {
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  font-size: 1em;
  transition: border-color 0.3s ease;
  width: 100%;
  max-width: 500px;
}

.add-section button {
  max-width: 500px;
  width: 100%;
}

.add-section select:focus,
.add-section input:focus {
  outline: none;
  border-color: #8b5cf6;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 768px) {
  header h1 {
    font-size: 2em;
  }
  
  .logo-img {
    width: 50px;
    height: 50px;
  }
  
  .header-text {
    font-size: 0.95em;
  }
  
  .header-buttons {
    flex-direction: column;
    width: 100%;
    align-items: center;
  }
  
  .header-buttons .button {
    width: 100%;
    max-width: 300px;
  }
  
  main {
    padding: 20px 15px;
  }
  
  .section {
    padding: 18px;
  }
  
  .section h2 {
    font-size: 1.4em;
  }
  
  .timer-block {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }
  
  .editable {
    flex: 1 1 100%;
    order: 1;
    font-size: 0.95em;
  }
  
  .stopwatch {
    flex: 0 0 auto;
    order: 2;
    width: auto;
    min-width: 60px;
    font-size: 1.1em;
  }
  
  .buttons {
    flex: 1 1 100%;
    order: 3;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }
  
  .buttons .button {
    flex: 1 1 auto;
    padding: 8px 12px;
    font-size: 0.85em;
    white-space: nowrap;
    min-width: 0;
  }
  
  .toast-notification {
    width: calc(100% - 40px);
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.6em;
  }
  
  .logo-img {
    width: 40px;
    height: 40px;
  }
  
  .timer-block {
    padding: 10px;
  }
  
  .button {
    padding: 8px 14px;
    font-size: 0.9em;
  }
  
  .buttons {
    gap: 5px;
  }
  
  .buttons .button {
    padding: 7px 10px;
    font-size: 0.8em;
  }
  
  .stopwatch {
    font-size: 1em;
  }
  
  .toast-notification {
    padding: 12px 18px;
  }
  
  .toast-icon {
    font-size: 24px;
  }
  
  .toast-title {
    font-size: 14px;
  }
  
  .toast-message {
    font-size: 12px;
  }
}