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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f5f5f5;
  min-height: 100vh;
}

.container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
}

.section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hidden {
  display: none !important;
}

h1 {
  color: #1a73e8;
  font-size: 1.8rem;
  margin-bottom: 8px;
}

h2 {
  color: #333;
  font-size: 1.2rem;
  margin-bottom: 24px;
  font-weight: 500;
}

h3 {
  color: #666;
  font-size: 1rem;
  margin-bottom: 12px;
}

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

.header h1 {
  margin-bottom: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: #666;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

input, select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

input::placeholder {
  color: #999;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: #1a73e8;
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background-color: #1557b0;
}

.btn-primary:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #f1f3f4;
  color: #333;
}

.btn-secondary:hover {
  background-color: #e8eaed;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-large {
  padding: 16px 24px;
  font-size: 1.1rem;
  margin-top: 8px;
}

/* Messages */
.message, .error {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.error {
  background-color: #fdecea;
  color: #c5221f;
}

.message.success {
  background-color: #e6f4ea;
  color: #137333;
}

.message.error {
  background-color: #fdecea;
  color: #c5221f;
}

/* Recent entries */
#recent-entries {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

#entries-list {
  list-style: none;
}

#entries-list li {
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

#entries-list li .entry-time {
  color: #666;
  font-size: 0.8rem;
}

#entries-list li .entry-details {
  margin-top: 4px;
  color: #333;
}

/* Loading state */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .container {
    padding: 12px;
  }

  .section {
    padding: 16px;
    border-radius: 8px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  input, select {
    padding: 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}
