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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue",
    Arial, sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #667eea 100%);
  min-height: 100vh;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  overflow-x: hidden;
}

/* Background blur elements for depth */
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 60%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 80%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 50%
    );
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(-20px, -20px) rotate(1deg);
  }
  66% {
    transform: translate(20px, -10px) rotate(-1deg);
  }
}

.container {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  padding: 48px;
  width: 90%;
  max-width: 1000px;
  margin-top: 40px;
  position: relative;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  border-radius: 28px 28px 0 0;
}

h1 {
  text-align: center;
  color: #ffffff;
  font-size: 2.75rem;
  font-weight: 600;
  margin-bottom: 48px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.02em;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    rgba(255, 255, 255, 0.8) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
}

.main-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.input-section {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-radius: 20px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.input-section:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.input-group {
  margin-bottom: 24px;
}

label {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 400;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(0, 122, 255, 0.6);
  box-shadow:
    0 0 0 4px rgba(0, 122, 255, 0.1),
    0 8px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.time-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn {
  background: linear-gradient(
    135deg,
    rgba(0, 122, 255, 0.8) 0%,
    rgba(88, 86, 214, 0.8) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 16px 32px;
  border-radius: 12px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 8px 16px rgba(0, 122, 255, 0.2);
  letter-spacing: -0.01em;
  margin-top: 8px;
  width: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 122, 255, 0.3);
  background: linear-gradient(
    135deg,
    rgba(0, 122, 255, 0.9) 0%,
    rgba(88, 86, 214, 0.9) 100%
  );
  border-color: rgba(255, 255, 255, 0.3);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 8px rgba(0, 122, 255, 0.2);
}

.total-section {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 24px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.total-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
}

.total-time {
  font-size: 3rem;
  font-weight: 300;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    rgba(255, 255, 255, 0.7) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.total-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.times-list {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border-radius: 20px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  max-height: 400px;
  overflow-y: auto;
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.times-list h3 {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 24px;
  text-align: center;
  letter-spacing: -0.01em;
}

.time-entry {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.time-entry:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.time-entry-title {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  font-size: 1rem;
  flex-grow: 1;
  letter-spacing: -0.01em;
}

.time-entry-time {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  font-size: 1rem;
  margin-left: 16px;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.delete-btn {
  background: #fb4141;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 69, 58, 0.3);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-btn:hover {
  border-color: rgba(255, 69, 58, 0.5);
  transform: scale(1.05);
}

.edit-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #4f46e5;
  font-size: 18px;
  cursor: pointer;
  margin-right: 6px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-btn:hover {
   border: 1px solid #4f46e5;
  transform: scale(1.05);
}

.clear-btn {
  background: #fb4141;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 69, 58, 0.3);
  padding: 12px 24px;
  border-radius: 12px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-top: 16px;
  width: 100%;
  letter-spacing: -0.01em;
}

.clear-btn:hover {
  border-color: rgba(255, 69, 58, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(255, 69, 58, 0.2);
}

.empty-state {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  padding: 48px 24px;
  font-size: 1rem;
  font-weight: 400;
}

/* Custom scrollbar with Apple style */
.times-list::-webkit-scrollbar {
  width: 6px;
}

.times-list::-webkit-scrollbar-track {
  background: transparent;
}

.times-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.times-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Custom Alert Modal */
.custom-alert {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-alert.show {
  opacity: 1;
  visibility: visible;
}

.custom-alert-content {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  padding: 32px;
  max-width: 90%;
  width: 320px;
  text-align: center;
  color: #ffffff;
  font-size: 1.1rem;
  line-height: 1.5;
  position: relative;
}

.custom-alert-content p {
  margin-bottom: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.alert-btn {
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.8) 0%, rgba(200, 50, 40, 0.8) 100%);
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 12px rgba(255, 69, 58, 0.2);
}

.alert-btn:hover {
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.9) 0%, rgba(200, 50, 40, 0.9) 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(255, 69, 58, 0.3);
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .container {
    padding: 32px 24px;
    margin-top: 20px;
    width: 95%;
  }

  h1 {
    font-size: 2.25rem;
    margin-bottom: 32px;
  }

  .main-layout {
    gap: 1.5rem;
  }

  .input-section {
    padding: 24px;
  }

  .total-section {
    padding: 24px;
    margin-bottom: 20px;
  }

  .times-list {
    padding: 24px;
  }

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

@media (max-width: 576px) {
  .time-inputs {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .time-entry {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .time-entry-time {
    margin-left: 0;
    align-self: flex-end;
  }

  .delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
  }
  .edit-btn {
    position: absolute;
    top: 48px;
    right: 12px;
    margin: 0;
  }

  .time-entry {
    position: relative;
    padding-right: 50px;
  }
}
