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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #244855;
  min-height: 100vh;
  padding: 20px;
}

.notification-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.notification-banner.show {
  transform: translateY(0);
}

.notification-banner.success {
  background-color: #874F41;
  border-bottom: 1px solid #6b3e33;
  color: #FBE9D0;
  font-weight: 600;
}

.notification-banner.error {
  background-color: #E64833;
  border-bottom: 1px solid #d73b27;
  color: #FBE9D0;
  font-weight: 600;
}

.notification-banner.info {
  background-color: #244855;
  border-bottom: 1px solid #1d3a44;
  color: #FBE9D0;
  font-weight: 600;
}

.notification-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 0;
  margin-left: 10px;
}

.notification-close:hover {
  opacity: 1;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: #FBE9D0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  padding: 40px;
}

h1 {
  text-align: center;
  color: #244855;
  margin-bottom: 30px;
  font-size: 2.5em;
  font-weight: 700;
}

.admin-section {
  margin-bottom: 40px;
  padding: 20px;
  background: #90AEAD;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.admin-section h2 {
  color: #244855;
  margin-bottom: 20px;
  font-size: 1.5em;
}

.date-range-form {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: end;
}

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

.form-group label {
  font-size: 14px;
  color: #244855;
  font-weight: 500;
}

.form-group input {
  padding: 10px;
  border: 2px solid #90AEAD;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #E64833;
}

.add-date-button {
  padding: 10px 20px;
  background: #E64833;
  color: #FBE9D0;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  height: fit-content;
}

.add-date-button:hover {
  background: #d73b27;
  transform: translateY(-2px);
}

.add-date-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.voting-form {
  margin-bottom: 40px;
}

.dates-section-title {
  color: #244855;
  margin-bottom: 20px;
  margin-top: 30px;
  font-size: 1.5em;
  font-weight: 600;
  text-align: left;
}

.name-input {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  align-items: center;
}

.name-input input {
  flex: 1;
  padding: 12px;
  border: 2px solid #90AEAD;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.name-input input:focus {
  outline: none;
  border-color: #E64833;
}

.name-input button {
  padding: 12px 24px;
  background: #244855;
  color: #FBE9D0;
  border: 2px solid #E64833;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.name-input button:hover {
  background: #E64833;
  color: #FBE9D0;
  transform: translateY(-2px);
}

.name-input button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.dates-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

.month-section {
  background: #FBE9D0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.month-header {
  background: #874F41;
  color: #FBE9D0;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.month-header:hover {
  background: #6b3e33;
}

.month-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.month-count {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.8;
}

.month-toggle {
  background: none;
  border: none;
  color: #FBE9D0;
  font-size: 16px;
  cursor: pointer;
  padding: 5px;
  transition: transform 0.2s ease;
}

.month-toggle:hover {
  transform: scale(1.1);
}

.toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
}

.month-content {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  transition: all 0.3s ease;
}

.month-content.collapsed {
  display: none;
}

.date-card {
  background: #FBE9D0;
  border: 2px solid #90AEAD;
  padding: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.date-card:hover {
  border-color: #E64833;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.date-card.selected {
  border-color: #E64833;
  background: linear-gradient(45deg, rgba(230, 72, 51, 0.1), rgba(230, 72, 51, 0.05));
}

.date-card.selected::before {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 15px;
  color: #E64833;
  font-size: 20px;
  font-weight: bold;
}

.date-card.voted {
  border-color: #874F41;
  background: linear-gradient(45deg, rgba(135, 79, 65, 0.15), rgba(135, 79, 65, 0.08));
}

.date-card.voted::before {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 15px;
  color: #874F41;
  font-size: 20px;
  font-weight: bold;
}

.date-title {
  font-size: 18px;
  font-weight: bold;
  color: #244855;
  margin-bottom: 5px;
}

.date-subtitle {
  color: #90AEAD;
  font-size: 14px;
  margin-bottom: 15px;
}

.voters-list {
  margin-top: 10px;
}

.voter-tag {
  display: inline-block;
  background: #244855;
  color: #FBE9D0;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
}

.delete-date {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #90AEAD;
  color: #244855;
  border: none;
  width: 25px;
  height: 25px;
  font-size: 12px;
  cursor: pointer;
  display: none;
}

.delete-date:hover {
  background: #E64833;
  color: #FBE9D0;
}

.date-card:hover .delete-date:not(.hidden) {
  display: block;
}

.submit-button {
  display: block;
  width: 100%;
  padding: 15px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.submit-button:hover {
  transform: translateY(-2px);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.results {
  margin-top: 40px;
  padding: 30px;
  background: #90AEAD;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.results h2 {
  color: #244855;
  margin-bottom: 20px;
  text-align: center;
}

/* Results Month Sections */
.results-month-section {
  margin-bottom: 20px;
  background: #FBE9D0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.results-month-header {
  background: #90AEAD;
  color: #244855;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.results-month-header:hover {
  background: #7a9291;
}

.results-month-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.results-month-toggle {
  background: none;
  border: none;
  color: #244855;
  font-size: 14px;
  cursor: pointer;
  padding: 5px;
  transition: transform 0.2s ease;
}

.results-month-toggle:hover {
  transform: scale(1.1);
}

.results-toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
}

.results-month-content {
  padding: 15px;
  transition: all 0.3s ease;
}

.results-month-content.collapsed {
  display: none;
}

.result-item {
  display: flex;
  flex-direction: column;
  padding: 15px;
  background: #F5E1C7;
  border: 2px solid #E1D5C7;
  margin-bottom: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.result-item:hover {
  background: #F0DCC0;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

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

.result-date {
  font-weight: 600;
  color: #244855;
  margin-bottom: 5px;
}

.result-count {
  font-weight: 600;
  color: #874F41;
  background: #90AEAD;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 14px;
  align-self: flex-start;
}

.voters-dropdown {
  margin-top: 12px;
  padding: 12px;
  background: #FBE9D0;
  border-radius: 6px;
  border: 1px solid #E1D5C7;
  transition: all 0.3s ease;
}

.voters-list-title {
  font-weight: 600;
  color: #244855;
  margin-bottom: 8px;
  font-size: 14px;
}

.voters-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.voter-name {
  background: #874F41;
  color: #FBE9D0;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.no-voters {
  color: #874F41;
  font-style: italic;
  font-size: 14px;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #90AEAD;
}

.error {
  background: #E64833;
  color: #FBE9D0;
  padding: 10px;
  margin: 10px 0;
}

.toggle-admin {
  background: #90AEAD;
  color: #244855;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.toggle-admin:hover {
  background: #244855;
  color: #FBE9D0;
}

.toggle-admin.hidden {
  display: none;
}

.hidden {
  display: none;
}

/* Authentication Screen Styles */
.auth-screen {
  max-width: 500px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

.auth-form {
  background: #90AEAD;
  padding: 40px;
  margin-top: 40px;
}

.auth-form h2 {
  color: #244855;
  margin-bottom: 15px;
  font-size: 1.8em;
}

.auth-description {
  color: #244855;
  margin-bottom: 30px;
  font-size: 1.1em;
  line-height: 1.5;
}

.email-input-group {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: center;
}

.email-input-group input {
  flex: 1;
  padding: 15px;
  border: 2px solid #244855;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.email-input-group input:focus {
  outline: none;
  border-color: #E64833;
}

.email-input-group button {
  padding: 15px 25px;
  background: #E64833;
  color: #FBE9D0;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.email-input-group button:hover {
  background: #d73b27;
  transform: translateY(-2px);
}

.email-input-group button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-message {
  padding: 15px;
  margin-top: 20px;
  font-weight: 500;
  font-size: 1.1em;
}

.auth-message.success {
  background: #874F41;
  color: #FBE9D0;
}

.auth-message.info {
  background: #244855;
  color: #FBE9D0;
}

.auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  color: #244855;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #90AEAD;
  border-top: 2px solid #244855;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Header Section */
.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-email {
  color: #244855;
  font-weight: 600;
}

.sign-out-button {
  padding: 8px 16px;
  background: #90AEAD;
  color: #244855;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sign-out-button:hover {
  background: #244855;
  color: #FBE9D0;
}

/* VIP Management Styles */
.vip-management {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #244855;
}

.vip-management h3 {
  color: #244855;
  margin-bottom: 20px;
  font-size: 1.3em;
}

.vip-form {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: center;
}

.vip-form input {
  flex: 1;
  padding: 10px;
  border: 2px solid #244855;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.vip-form input:focus {
  outline: none;
  border-color: #E64833;
}

.vip-form button {
  padding: 10px 20px;
  background: #874F41;
  color: #FBE9D0;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vip-form button:hover {
  background: #6b3e33;
  transform: translateY(-2px);
}

.vip-list {
  background: #FBE9D0;
  padding: 15px;
  margin-top: 15px;
}

.vip-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid #90AEAD;
}

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

.vip-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vip-name-display {
  color: #244855;
  font-weight: 600;
  font-size: 16px;
}

.vip-email-display {
  color: #874F41;
  font-weight: 500;
  font-size: 14px;
}

.vip-name-edit, .vip-email-edit {
  padding: 5px 8px;
  border: 2px solid #244855;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 5px;
  transition: border-color 0.3s ease;
}

.vip-name-edit:focus, .vip-email-edit:focus {
  outline: none;
  border-color: #E64833;
}

.vip-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.edit-vip-button {
  padding: 5px 10px;
  background: #874F41;
  color: #FBE9D0;
  border: none;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.edit-vip-button:hover {
  background: #6b3e33;
  transform: translateY(-2px);
}

.save-vip-button {
  padding: 5px 10px;
  background: #28a745;
  color: white;
  border: none;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.save-vip-button:hover {
  background: #218838;
  transform: translateY(-2px);
}

.cancel-vip-button {
  padding: 5px 10px;
  background: #6c757d;
  color: white;
  border: none;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.cancel-vip-button:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.remove-vip-button {
  padding: 5px 10px;
  background: #E64833;
  color: #FBE9D0;
  border: none;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.remove-vip-button:hover {
  background: #d73b27;
  transform: translateY(-2px);
}

.admin-label {
  padding: 5px 10px;
  background: #90AEAD;
  color: #244855;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
}

@media (max-width: 600px) {
  .container {
    padding: 20px;
  }

  h1 {
    font-size: 2em;
  }

  .month-content {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px;
  }

  .month-header {
    padding: 12px 15px;
  }

  .month-title {
    font-size: 16px;
  }

  .month-toggle {
    font-size: 14px;
  }

  .date-card {
    padding: 15px;
  }

  .name-input {
    flex-direction: column;
    align-items: stretch;
  }

  .date-range-form {
    flex-direction: column;
  }

  .form-group {
    width: 100%;
  }

  .email-input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .header-section {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .user-info {
    justify-content: center;
  }

  .vip-form {
    flex-direction: column;
    align-items: stretch;
  }

  .vip-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
}