:root {
  --christmas-red: #d4474a;
  --christmas-green: #2d5540;
  --sage-bg: #c5dfc8;
  --white: #ffffff;
  --text-dark: #2c3e3f;
  --text-light: #666666;
  --border-light: #e8e8e8;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  background: var(--sage-bg);
  min-height: 100vh;
  color: var(--text-dark);
}

h1 {
  text-align: center;
  font-family: 'Georgia', 'Garamond', serif;
  color: var(--text-dark);
  font-size: 3.5em;
  font-weight: 700;
  margin: 0 0 10px 0;
  letter-spacing: -1px;
}

h2 {
  font-family: 'Georgia', 'Garamond', serif;
  color: var(--text-dark);
  font-size: 2em;
  font-weight: 600;
  margin: 0 0 15px 0;
  border: none;
  padding: 0;
}

h3 {
  font-family: 'Georgia', 'Garamond', serif;
  color: var(--text-dark);
  font-size: 1.3em;
  margin: 20px 0 12px 0;
}

input, textarea, select {
  width: 100%;
  padding: 14px 16px;
  margin: 10px 0;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  transition: all 0.2s ease;
  background: var(--white);
  color: var(--text-dark);
}

input::placeholder, textarea::placeholder {
  color: #999;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--christmas-red);
  background: var(--white);
}

button {
  padding: 14px 32px;
  margin: 12px 12px 12px 0;
  background: var(--christmas-red);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: 0 2px 8px rgba(212, 71, 74, 0.15);
}

button:hover {
  background: #c23a3f;
  box-shadow: 0 4px 16px rgba(212, 71, 74, 0.25);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  background: var(--white);
  color: var(--text-dark);
  border: 1.5px solid var(--border-light);
  box-shadow: none;
}

button.secondary:hover {
  background: var(--border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

th {
  background: var(--christmas-red);
  color: white;
  padding: 18px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 15px;
}

th[id^="sort"] {
  transition: background 0.2s ease;
}

th[id^="sort"]:hover {
  background: #c23a3f;
}

.sort-indicator {
  font-size: 12px;
  opacity: 0.6;
  margin-left: 4px;
}

.sort-indicator.asc::after {
  content: " ▲";
}

.sort-indicator.desc::after {
  content: " ▼";
}

td.user-highlight {
  background-color: rgba(212, 71, 74, 0.08);
  font-weight: 500;
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: #fafafa;
}

a {
  color: var(--christmas-red);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

a:hover {
  color: #c23a3f;
}

.section {
  background: var(--white);
  padding: 40px;
  margin-bottom: 30px;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: none;
  position: relative;
  z-index: 2;
}

.gift-exchange-controls {
  margin-bottom: 25px;
  text-align: center;
}

.gift-exchange-controls label {
  color: var(--text-light);
  margin-right: 15px;
  font-size: 15px;
  font-weight: 500;
}

select {
  display: inline-block;
  width: auto;
  min-width: 180px;
  padding: 12px 16px;
  margin-left: 10px;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
}

select:hover {
  border-color: var(--christmas-red);
}

select:focus {
  outline: none;
  border-color: var(--christmas-red);
}

#userGiftAssignment {
  background: linear-gradient(135deg, var(--christmas-green) 0%, var(--christmas-red) 100%);
  color: white;
  padding: 40px;
  border-radius: 20px;
  margin-bottom: 30px;
  box-shadow: 0 4px 16px rgba(212, 71, 74, 0.2);
  border: none;
}

#userGiftAssignment h3 {
  color: white;
  margin-top: 0;
  font-size: 1.5em;
}

#userGiftAssignment p {
  font-size: 17px;
  margin: 12px 0;
  line-height: 1.6;
  font-weight: 500;
}

#userGiftAssignment strong {
  font-weight: 600;
}


#gifteeInfoBox.giftbox {
  background: linear-gradient(135deg, #A89968 0%, #B5A57E 50%, #A89968 100%);
  background-size: 100% 100%;
  padding: 45px 35px 35px 35px;
  border-radius: 12px;
  position: relative;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.25),
    inset 0 0 20px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border: none;
  overflow: visible;
  min-height: 220px;
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(139, 115, 85, 0.03) 2px, rgba(139, 115, 85, 0.03) 4px),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139, 115, 85, 0.02) 2px, rgba(139, 115, 85, 0.02) 4px),
    linear-gradient(135deg, #A89968 0%, #B5A57E 50%, #A89968 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%;
}

#gifteeInfoBox p {
  color: white;
}

#gifteeDetailsContainer {
  text-align: center;
  padding: 15px 20px;
  position: relative;
  z-index: 5;
}

#gifteeDetailsContainer p {
  color: #2c3e3f;
  font-size: 16px;
  margin: 0 0 14px 0;
  line-height: 1.8;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

#gifteeDetailsContainer p:first-child {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: #1a2625;
}

#gifteeDetailsContainer p:last-child {
  margin-bottom: 0;
}

#gifteeDetailsContainer a {
  display: inline-block;
  color: var(--christmas-red);
  border: 2px solid var(--christmas-red);
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  background: white;
  transition: all 0.2s;
  margin-right: 8px;
  margin-top: 12px;
  text-decoration: none;
}

#gifteeDetailsContainer a:hover {
  background: #f5f5f5;
  color: var(--christmas-red);
  text-decoration: none;
  transform: translateY(-2px);
}

/* Snowflake animation */
@keyframes snowfall {
  0% {
    transform: translateY(-10vh) translateX(0) rotate(0deg);
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) translateX(100px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes snowsway {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(80px);
  }
}

.snowflake {
  position: absolute;
  top: -10vh;
  color: white;
  font-size: 1.5em;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
  user-select: none;
  pointer-events: none;
  animation: snowfall linear forwards;
}

/* 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.4);
  animation: fadeIn 0.25s ease;
}

.modal.show {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: var(--white);
  margin: 8% auto;
  padding: 40px;
  border: none;
  border-radius: 20px;
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  border-bottom: none;
  padding-bottom: 0;
}

.modal-header h2 {
  margin: 0;
  flex: 1;
}

.close-btn {
  background: none;
  border: none;
  font-size: 32px;
  font-weight: 300;
  color: var(--text-light);
  cursor: pointer;
  padding: 0;
  margin: -8px -8px 0 0;
  width: auto;
  height: auto;
  line-height: 1;
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--text-dark);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 15px;
}

.form-row.full {
  grid-template-columns: 1fr;
}

.form-row > div label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 14px;
}

.delivery-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.delivery-card {
  background: var(--white);
  padding: 28px;
  border-radius: 16px;
  border: none;
  border-left: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.delivery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.delivery-card h4 {
  margin: 0 0 12px 0;
  color: var(--text-dark);
  font-size: 1.1em;
  font-weight: 600;
}

.delivery-card p {
  margin: 0 0 16px 0;
  line-height: 1.7;
  font-size: 14px;
  color: var(--text-light);
}

.delivery-card p:last-of-type {
  margin-bottom: 0;
}

.delivery-card a {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 20px;
  background: var(--christmas-red);
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 8px rgba(212, 71, 74, 0.15);
  transition: all 0.2s;
}

.delivery-card a:hover {
  background: #c23a3f;
  box-shadow: 0 4px 16px rgba(212, 71, 74, 0.25);
  color: white;
  text-decoration: none;
}

#auth, #changePassword {
  border: none;
  padding: 40px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

#auth h2, #changePassword h2 {
  margin: 0 0 30px 0;
  color: var(--text-dark);
}

#changePassword p {
  color: var(--text-light);
  font-size: 15px;
  margin: 0 0 25px 0;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 14px;
}

.wishlist-entry {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 15px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.wishlist-entry > div {
  display: flex;
  flex-direction: column;
}

.wishlist-entry label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 13px;
}

.wishlist-entry input {
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
}

.wishlist-entry button {
  padding: 10px 16px;
  margin: 0;
  background: #ff6b6b;
  font-size: 14px;
}

.wishlist-entry button:hover {
  background: #ff5252;
}

/* Header styling */
.header-container {
  flex-wrap: wrap;
}

.header-buttons {
  flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 1024px) {
  body {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  body {
    padding: 20px 15px;
  }

  h1 {
    font-size: 2.2em;
    margin-bottom: 20px;
  }

  h2 {
    font-size: 1.5em;
  }

  h3 {
    font-size: 1.1em;
  }

  .section {
    padding: 30px 20px;
    margin-bottom: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .delivery-info {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .delivery-card {
    padding: 20px;
  }

  .modal-content {
    width: 95%;
    margin: 30% auto;
    padding: 30px 20px;
    max-height: 90vh;
  }

  #userGiftAssignment {
    padding: 30px 20px;
    margin-bottom: 20px;
  }

  #userGiftAssignment > div {
    grid-template-columns: 1fr !important;
    gap: 25px !important;
  }

  #userGiftAssignment p:nth-child(2) {
    font-size: 42px !important;
  }

  #gifteeInfoBox {
    min-height: auto;
  }

  .gift-exchange-controls {
    flex-direction: column;
    align-items: center;
  }

  .gift-exchange-controls label {
    margin-right: 0;
    margin-bottom: 10px;
  }

  select {
    width: 100%;
    min-width: auto;
    margin-left: 0;
    margin-top: 10px;
  }

  button {
    padding: 12px 24px;
    font-size: 14px;
    margin: 8px 8px 8px 0;
    width: auto;
  }

  .wishlist-entry {
    grid-template-columns: 1fr;
  }

  .wishlist-entry button {
    margin-top: 10px;
  }

  table {
    font-size: 14px;
  }

  th, td {
    padding: 12px 10px;
    font-size: 13px;
  }

  th {
    padding: 14px 10px;
    font-size: 13px;
  }

  input, textarea, select {
    font-size: 16px;
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 15px 12px;
  }

  h1 {
    font-size: 1.8em;
    margin-bottom: 15px;
  }

  h2 {
    font-size: 1.3em;
  }

  h3 {
    font-size: 1em;
  }

  .section {
    padding: 20px 15px;
    margin-bottom: 15px;
  }

  button {
    padding: 11px 20px;
    font-size: 13px;
    margin: 6px 6px 6px 0;
    display: block;
    width: 100%;
    margin-bottom: 8px;
    margin-right: 0;
  }

  button.secondary {
    display: inline-block;
    width: auto;
    margin-right: 6px;
  }

  #userGiftAssignment {
    padding: 20px 15px;
    margin-bottom: 15px;
  }

  #userGiftAssignment > div {
    gap: 15px !important;
  }

  #userGiftAssignment p:first-child {
    font-size: 14px;
  }

  #userGiftAssignment p:nth-child(2) {
    font-size: 32px !important;
  }

  #gifteeInfoBox {
    padding: 30px 20px 20px 20px;
    min-height: auto;
  }

  #gifteeDetailsContainer p {
    font-size: 14px;
  }

  #gifteeDetailsContainer p:first-child {
    font-size: 16px;
  }

  #gifteeDetailsContainer a {
    padding: 8px 16px;
    font-size: 12px;
    margin-right: 0;
    margin-bottom: 6px;
    display: block;
    text-align: center;
  }

  .modal-content {
    width: 95%;
    margin: 20% auto;
    padding: 20px 15px;
    border-radius: 16px;
  }

  .modal-header {
    margin-bottom: 20px;
  }

  .close-btn {
    font-size: 28px;
    margin: -4px -4px 0 0;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 10px 8px;
    font-size: 11px;
  }

  th {
    padding: 12px 8px;
  }

  .sort-indicator {
    font-size: 10px;
  }

  input, textarea, select {
    font-size: 16px;
    padding: 11px 12px;
    margin: 8px 0;
  }

  .form-row {
    margin-bottom: 10px;
  }

  .wishlist-entry {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 8px;
    margin-bottom: 10px;
  }

  .wishlist-entry input {
    padding: 10px;
  }

  .wishlist-entry button {
    padding: 10px;
    margin: 0;
    margin-top: 8px;
    font-size: 12px;
  }

  .delivery-info {
    gap: 12px;
  }

  .delivery-card {
    padding: 15px;
  }

  .delivery-card h4 {
    font-size: 1em;
    margin-bottom: 10px;
  }

  .delivery-card p {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .delivery-card a {
    font-size: 12px;
    padding: 8px 16px;
  }

  #auth, #changePassword {
    padding: 25px 15px;
  }

  #auth h2, #changePassword h2 {
    font-size: 1.3em;
    margin-bottom: 20px;
  }

  #changePassword p {
    font-size: 14px;
  }

  .gift-exchange-controls {
    gap: 0;
  }

  .gift-exchange-controls label {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .gift-exchange-controls select {
    margin-left: 0;
    margin-top: 8px;
    font-size: 14px;
  }
}
