/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f3f6fa;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.6;
}

/* Container styles */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

/* Typography */
h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #2d3748;
  font-size: 1.75rem;
  font-weight: 600;
}

/* Grid layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

/* Event cards */
.event {
  background-color: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.countdown {
  font-weight: 700;
  margin: 16px 0;
  font-size: 1.25rem;
  color: #2d3748;
}

/* Links */
a {
  color: #4299e1;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #3182ce;
  text-decoration: underline;
}

.add-event-link {
  color: #4299e1;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  padding: 12px 24px;
  background-color: rgba(66, 153, 225, 0.1);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.add-event-link:hover {
  background-color: rgba(66, 153, 225, 0.2);
  text-decoration: none;
}

/* Authentication Forms */
.auth-form {
  max-width: 400px;
  margin: 40px auto;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 32px 24px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-form h2 {
  margin-bottom: 32px;
  color: #2d3748;
  font-size: 1.75rem;
  font-weight: 600;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: white;
}

.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus,
.auth-form input[type="text"]:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.auth-form input[type="submit"] {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  border: none;
  color: white;
  font-weight: 600;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.auth-form input[type="submit"]:hover {
  background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.auth-form input[type="submit"]:active {
  transform: translateY(0);
}

/* Flash messages */
.flash-message {
  color: #e53e3e;
  text-align: center;
  margin-bottom: 24px;
  font-weight: 500;
  padding: 12px;
  background-color: rgba(229, 62, 62, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(229, 62, 62, 0.2);
}

.flashes {
  list-style: none;
  padding: 0;
  margin: 0;
}

.flashes li {
  color: #e53e3e;
  text-align: center;
  margin-bottom: 16px;
  font-weight: 500;
  padding: 12px;
  background-color: rgba(229, 62, 62, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(229, 62, 62, 0.2);
}

/* Register form specific styles */
.register-form {
  max-width: 400px;
  margin: 40px auto;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 32px 24px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.register-form h2 {
  margin-bottom: 32px;
  color: #2d3748;
  font-size: 1.75rem;
  font-weight: 600;
}

.register-form input[type="email"],
.register-form input[type="password"] {
  width: 100%;
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: white;
}

.register-form input[type="email"]:focus,
.register-form input[type="password"]:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.register-form button[type="submit"] {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  border: none;
  color: white;
  font-weight: 600;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.register-form button[type="submit"]:hover {
  background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.register-form button[type="submit"]:active {
  transform: translateY(0);
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
  .container {
    margin: 10px;
    padding: 16px;
    border-radius: 12px;
  }
  
  .auth-form,
  .register-form {
    margin: 20px 10px;
    padding: 24px 20px;
    border-radius: 12px;
  }
  
  .auth-form h2,
  .register-form h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
  }
  
  .auth-form input[type="email"],
  .auth-form input[type="password"],
  .auth-form input[type="text"],
  .register-form input[type="email"],
  .register-form input[type="password"] {
    padding: 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .auth-form input[type="submit"],
  .register-form button[type="submit"] {
    padding: 14px;
    font-size: 16px;
  }
  
  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 0;
  }
  
  .event {
    padding: 20px;
    border-radius: 10px;
  }
  
  h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .dashboard-header h2 {
    text-align: center;
  }
  
  .event-name {
    font-size: 1.1rem;
  }
  
  .countdown {
    font-size: 1rem;
  }
  
  .event-header {
    gap: 8px;
  }
  
  .delete-icon {
    padding: 4px;
    min-width: 24px;
    height: 24px;
  }
  
  .delete-icon svg {
    width: 14px;
    height: 14px;
  }
  
  .form-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .form-header h2 {
    text-align: center;
  }
  
  .event-form input[type="text"],
  .event-form input[type="datetime-local"] {
    padding: 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .event-form button[type="submit"] {
    padding: 14px;
    font-size: 16px;
  }
  
  .modal {
    padding: 10px;
  }
  
  .modal-content {
    max-width: 100%;
    border-radius: 12px;
  }
  
  .modal-header {
    padding: 20px 20px 0 20px;
  }
  
  .modal-header h2 {
    font-size: 1.25rem;
  }
  
  .modal-body {
    padding: 0 20px 16px 20px;
  }
  
  .modal-footer {
    padding: 16px 20px 20px 20px;
  }
  
  .modal-countdown {
    font-size: 1.1rem;
    padding: 10px;
  }
  
  .modal-footer {
    flex-direction: column-reverse;
  }
  
  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 5px;
    padding: 12px;
  }
  
  .auth-form,
  .register-form {
    margin: 10px 5px;
    padding: 20px 16px;
  }
  
  .auth-form input[type="email"],
  .auth-form input[type="password"],
  .auth-form input[type="text"],
  .register-form input[type="email"],
  .register-form input[type="password"] {
    padding: 12px;
  }
  
  .auth-form input[type="submit"],
  .register-form button[type="submit"] {
    padding: 12px;
  }
}

/* Forgot password link styling */
.forgot-password {
  text-align: center;
  margin-top: 16px;
}

.forgot-password a {
  color: #718096;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-password a:hover {
  color: #4299e1;
  text-decoration: underline;
}

/* Login/Register link styling */
.auth-link {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.auth-link a {
  color: #4299e1;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-link a:hover {
  color: #3182ce;
  text-decoration: underline;
}

/* Dashboard specific styles */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

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

.logout-link {
  color: #e53e3e;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  background-color: rgba(229, 62, 62, 0.1);
  transition: all 0.2s ease;
}

.logout-link:hover {
  background-color: rgba(229, 62, 62, 0.2);
  text-decoration: none;
}

.add-event-section {
  text-align: center;
  margin-bottom: 32px;
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.event-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  flex: 1;
  padding-right: 8px;
}

.delete-icon {
  color: #e53e3e;
  text-decoration: none;
  padding: 6px;
  border-radius: 6px;
  background-color: rgba(229, 62, 62, 0.1);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.delete-icon:hover {
  background-color: rgba(229, 62, 62, 0.2);
  transform: scale(1.1);
  text-decoration: none;
}

.delete-icon svg {
  width: 16px;
  height: 16px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #718096;
}

.empty-state p {
  font-size: 1.1rem;
  margin: 0;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0 24px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #2d3748;
}

.close-button {
  background: none;
  border: none;
  color: #718096;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-body {
  padding: 0 24px 20px 24px;
}

.event-detail {
  margin-bottom: 20px;
}

.event-detail label {
  display: block;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 8px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-detail span {
  display: block;
  color: #2d3748;
  font-size: 1.1rem;
}

.modal-countdown {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4299e1;
  padding: 12px;
  background-color: rgba(66, 153, 225, 0.1);
  border-radius: 8px;
  text-align: center;
}

.modal-footer {
  padding: 20px 24px 24px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary {
  background-color: #718096;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: #4a5568;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Make event cards clickable */
.event {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

/* Add Event form styles */
.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

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

.back-link {
  color: #4299e1;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  background-color: rgba(66, 153, 225, 0.1);
  transition: all 0.2s ease;
}

.back-link:hover {
  background-color: rgba(66, 153, 225, 0.2);
  text-decoration: none;
}

.event-form {
  max-width: 500px;
  margin: 0 auto;
}

.event-form input[type="text"],
.event-form input[type="datetime-local"] {
  width: 100%;
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: white;
}

.event-form input[type="text"]:focus,
.event-form input[type="datetime-local"]:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.event-form button[type="submit"] {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  border: none;
  color: white;
  font-weight: 600;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.event-form button[type="submit"]:hover {
  background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.event-form button[type="submit"]:active {
  transform: translateY(0);
}

/* Checkbox group styles */
.checkbox-group {
  margin-bottom: 24px;
  padding: 16px;
  background-color: #f7fafc;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label:last-child {
  margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  cursor: pointer;
  accent-color: #4299e1;
}

.checkbox-label span {
  font-size: 16px;
  color: #2d3748;
  font-weight: 500;
}

.checkbox-label:hover span {
  color: #4299e1;
}
