body {
    font-family: system-ui, sans-serif;
    margin: 0;
    padding: 0;
    background-color: rgb(249, 249, 249);
    color: rgb(34, 34, 34);
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode,
[data-theme="dark"] body {
    background-color: rgb(18, 18, 18);
    color: rgb(249, 249, 249);
}

.container {
    max-width: 600px;
    margin: auto;
    padding: 2rem;
}

h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.6rem;
    margin-bottom: 1rem;
    border: 1px solid rgb(204, 204, 204);
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    color: rgb(34, 34, 34);
    box-sizing: border-box;
}

input,
select {
    height: 42px;
    line-height: normal;
}

select {
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg fill='black' viewBox='0 0 24 24' width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: rgb(0, 123, 255) solid 2px;
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: rgb(31, 31, 31);
    color: rgb(249, 249, 249);
    border: 1px solid rgb(85, 85, 85);
}

body.dark-mode select,
[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg fill='white' viewBox='0 0 24 24' width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

body.dark-mode input:invalid,
body.dark-mode textarea:invalid,
body.dark-mode select:invalid,
[data-theme="dark"] input:invalid,
[data-theme="dark"] textarea:invalid,
[data-theme="dark"] select:invalid {
    box-shadow: rgb(255, 77, 77) 0 0 5px 1px;
    outline: none;
    border: 2px solid rgb(255, 77, 77) !important;
}

button {
    background-color: rgb(0, 123, 255);
    color: white;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: rgb(0, 86, 179);
}

.token-display {
    margin-top: 2rem;
    text-align: center;
}

.countdown {
    font-size: 0.9rem;
    color: rgb(102, 102, 102);
    margin-bottom: 1rem;
}

body.dark-mode .countdown,
[data-theme="dark"] .countdown {
    color: rgb(170, 170, 170);
}

.token {
    font-size: 3rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5rem;
    color: rgb(0, 123, 255);
    padding: 1rem;
    background-color: rgb(238, 238, 238);
    border-radius: 8px;
    margin: 1rem 0;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .token,
[data-theme="dark"] .token {
    background-color: rgb(42, 42, 42);
    color: rgb(100, 181, 246);
}

/* Dark Mode Toggle - Floating Button with Popup (matches mkeeves.github.io) */
.dark-mode-toggle-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
}

.dark-mode-toggle-button {
  width: 48px;
  height: 48px;
  background: rgba(243, 244, 246, 0.8);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  border: 1px solid rgba(209, 213, 219, 0.6);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
}

.dark-mode-toggle-button:hover {
  background: rgba(229, 231, 235, 0.8);
  transform: scale(1.1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .dark-mode-toggle-button {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .dark-mode-toggle-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.dark-mode-icon {
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

[data-theme="dark"] .dark-mode-icon {
  color: #ffffff;
}

.theme-icon-svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* Popup Menu */
.dark-mode-popup {
  position: absolute;
  bottom: 56px;
  right: 0;
  width: 160px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(229, 231, 235, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
  overflow: hidden;
}

.dark-mode-popup-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

[data-theme="dark"] .dark-mode-popup {
  background: rgba(31, 41, 55, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Theme Options */
.theme-option {
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.875rem;
  color: #374151;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s ease;
}

.theme-option:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.theme-option:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.theme-option:hover {
  background: rgba(243, 244, 246, 0.5);
}

[data-theme="dark"] .theme-option {
  color: #d1d5db;
}

[data-theme="dark"] .theme-option:hover {
  background: rgba(55, 65, 81, 0.5);
}

.theme-option-active {
  background: rgba(59, 130, 246, 0.1) !important;
  color: #2563eb !important;
}

[data-theme="dark"] .theme-option-active {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
}

.theme-option-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.theme-option-label {
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .dark-mode-toggle-container {
    bottom: 12px;
    right: 12px;
  }
  
  .dark-mode-toggle-button {
    width: 44px;
    height: 44px;
  }
  
  .theme-icon-svg {
    width: 18px;
    height: 18px;
  }
  
  .dark-mode-popup {
    bottom: 52px;
    width: 140px;
  }
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    .token {
        font-size: 2rem;
        letter-spacing: 0.3rem;
    }
}

