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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 50%, #1a472a 100%);
  min-height: 100vh;
  color: #333;
}

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

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 30px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

header h1 {
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

#user-info {
  color: #fff;
  font-weight: 500;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #c41e3a;
  color: white;
}

.btn-primary:hover {
  background: #a01830;
}

.btn-secondary {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background: #f5f5f5;
}

.btn-link {
  background: none;
  color: #fff;
  text-decoration: underline;
  padding: 5px;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
}

.btn-icon {
  padding: 6px 10px;
  font-size: 16px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  min-width: auto;
}

.btn-icon:hover {
  background: #e9ecef;
}

.btn-icon-danger:hover {
  background: #ffebee;
  border-color: #ffcdd2;
}

/* Auth Section */
#auth-section {
  max-width: 400px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  transition: all 0.2s;
}

.tab-btn.active {
  color: #c41e3a;
  border-bottom: 2px solid #c41e3a;
  margin-bottom: -2px;
}

.auth-form h2 {
  margin-bottom: 20px;
  color: #1a472a;
}

.auth-footer {
  text-align: center;
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  color: #888;
  font-size: 13px;
  font-style: italic;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1a472a;
  box-shadow: 0 0 0 2px rgba(26, 71, 42, 0.1);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.error {
  color: #dc3545;
  font-size: 14px;
  margin-top: 10px;
}

/* Dashboard */
#dashboard-section,
#wishlist-detail-section,
#gifter-section {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2,
.section-header h3 {
  color: #1a472a;
}

/* Wishlist Cards */
.wishlist-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.2s;
  border: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.wishlist-card:hover {
  background: #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wishlist-card-content {
  flex: 1;
  cursor: pointer;
}

.wishlist-card h3 {
  color: #1a472a;
  margin-bottom: 8px;
}

.wishlist-card p {
  color: #666;
  font-size: 14px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.wishlist-card .meta {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  font-size: 13px;
  color: #888;
}

/* Share Box */
.share-box {
  background: #f0f7f0;
  border: 1px dashed #1a472a;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 25px;
}

.share-box h4 {
  color: #1a472a;
  margin-bottom: 10px;
}

.share-link-row {
  display: flex;
  gap: 10px;
}

.share-link-row input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}

/* Items */
.item-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid #eee;
}

.item-card h4 {
  color: #333;
  margin-bottom: 8px;
}

.item-card p {
  color: #666;
  font-size: 14px;
  margin-bottom: 8px;
}

.item-card a {
  color: #1a472a;
  font-size: 14px;
}

.item-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
}

.item-card.claimed {
  background: #e8f5e9;
  border-color: #a5d6a7;
}

.claim-info {
  color: #2e7d32;
  font-weight: 500;
  font-size: 14px;
}

/* Gifter View */
#gifter-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

#gifter-header h2 {
  color: #1a472a;
  margin-bottom: 10px;
}

#gifter-header p {
  color: #666;
}

.expired-message {
  text-align: center;
  font-size: 18px;
  color: #666;
  padding: 40px;
}

.gifter-item-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.gifter-item-info {
  flex: 1;
}

.gifter-item-info h4 {
  color: #333;
  margin-bottom: 8px;
}

.gifter-item-info p {
  color: #666;
  font-size: 14px;
  margin-bottom: 8px;
}

.gifter-item-info a {
  color: #1a472a;
  font-size: 14px;
}

/* Gifter claim status styles */
.gifter-item-card.claimed-by-me {
  background: #e8f5e9;
  border-color: #a5d6a7;
}

.gifter-item-card.claimed-by-other {
  background: #f5f5f5;
  border-color: #e0e0e0;
  opacity: 0.7;
}

.claim-status {
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.claim-status.claim-mine {
  background: #c8e6c9;
  color: #2e7d32;
}

.claim-status.claim-other {
  background: #eeeeee;
  color: #757575;
}

/* Thank You Section */
#thank-you-section {
  background: #fff9c4;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
}

#thank-you-section h3 {
  color: #f57f17;
  margin-bottom: 10px;
}

.thank-you-gifter {
  margin-bottom: 20px;
}

.thank-you-gifter h4 {
  color: #1a472a;
  margin-bottom: 8px;
}

.thank-you-gifter ul {
  list-style: none;
  padding-left: 15px;
}

.thank-you-gifter li {
  padding: 5px 0;
  color: #555;
}

.thank-you-gifter li::before {
  content: "🎁 ";
}

/* Modal */
.modal {
  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;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  width: 100%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h3 {
  color: #1a472a;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #888;
}

.empty-state p {
  font-size: 16px;
}

/* Stats */
.stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #666;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 10px;
  }

  header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding: 15px 0;
    margin-bottom: 20px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  #auth-section {
    padding: 20px;
    margin: 0 5px;
  }

  .auth-tabs {
    margin-bottom: 15px;
  }

  .tab-btn {
    padding: 10px;
    font-size: 14px;
  }

  .auth-form h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
  }

  #dashboard-section,
  #wishlist-detail-section,
  #gifter-section {
    padding: 15px;
    margin: 0 5px;
  }

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

  .section-header h2,
  .section-header h3 {
    font-size: 1.2rem;
  }

  .section-header .btn {
    width: 100%;
  }

  #wishlist-header h2 {
    font-size: 1.3rem;
  }

  #wishlist-header > div {
    flex-direction: column !important;
    gap: 8px !important;
  }

  #wishlist-header .btn {
    width: 100%;
  }

  .share-box {
    padding: 12px;
  }

  .share-box h4 {
    font-size: 14px;
  }

  .share-link-row {
    flex-direction: column;
    gap: 8px;
  }

  .share-link-row input {
    font-size: 12px;
    padding: 8px;
  }

  .wishlist-card {
    padding: 15px;
    flex-direction: column;
    align-items: stretch;
  }

  .wishlist-card .btn-small {
    width: 100%;
    padding: 10px;
  }

  .wishlist-card h3 {
    font-size: 1.1rem;
  }

  .item-card {
    padding: 15px;
  }

  .item-card h4 {
    font-size: 1rem;
  }

  .item-actions {
    flex-direction: row;
    gap: 8px;
  }

  .item-actions .btn-icon {
    width: auto;
    padding: 8px 12px;
  }

  .gifter-item-card {
    flex-direction: column;
    gap: 12px;
    padding: 15px;
  }

  .gifter-item-card .btn {
    width: 100%;
    padding: 12px;
  }

  #gifter-header h2 {
    font-size: 1.3rem;
  }

  .stats {
    flex-direction: column;
    gap: 5px;
  }

  .modal {
    align-items: flex-end;
  }

  .modal-content {
    margin: 0;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    max-height: 85vh;
  }

  .modal-content h3 {
    font-size: 1.2rem;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-actions .btn {
    width: 100%;
    padding: 12px;
  }

  .form-group input,
  .form-group textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .btn {
    font-size: 14px;
    padding: 12px 16px;
  }

  #thank-you-section {
    padding: 15px;
  }

  #thank-you-section h3 {
    font-size: 1.1rem;
  }

  .empty-state {
    padding: 25px;
  }

  .empty-state p {
    font-size: 14px;
  }

  #back-to-dashboard {
    font-size: 14px;
    margin-bottom: 15px;
  }

  nav {
    gap: 10px;
  }

  #user-info {
    font-size: 14px;
  }

  #logout-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}
