@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/rubik:vf@latest/latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===============================
   Global Variables
   =============================== */
:root {
  --sans-font: "Rubik", sans-serif;
  --mono-font: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;

  --standard-border-radius: 0.75rem;

  --bg: #fff;
  --accent-bg: #f0f0f0;
  --text: #282828;
  --text-light: #585858;
  --border: #898ea4;
  --accent: #ff6b6b;
  --accent-hover: #ff5353;
  --accent-text: var(--bg);
  --code: #ff985f;
  --preformatted: #282828;
  --marked: #c5ff4c;
  --disabled: #efefef;

  --text-dark: #333;
  --text-mid: #555;
  --light-border: #eee;

  --section-bg-light: #fffaf5;
  --section-bg-alt: #fdfdfd;
  --section-bg-hero: #ffecec;

  --danger: #c53030;
  --danger-hover: #9b2c2c;
  --danger-bg: #fff5f5;
  --danger-border: #fc8181;

  --hero-gradient: linear-gradient(var(--bg), var(--section-bg-hero));
}

/* ===============================
   Reset & Base Styles
   =============================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

textarea,
select,
input,
progress {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

html {
  font-family: var(--sans-font);
  scroll-behavior: smooth;
  height: 100%;
}

body {
  color: var(--text);
  background-color: var(--bg);
  font-size: 1.15rem;
  line-height: 1.5;
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 1em;
}

a:not(.button) {
  color: var(--text);
}

a:hover {
  text-decoration: none;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: 0.5em;
}

/* ===============================
   Layout: Content Grid
   =============================== */
.content-grid {
  --padding-inline: 1rem;
  --content-max-width: 900px;
  --breakout-max-width: 1100px;
  --breakout-size: calc((var(--breakout-max-width) - var(--content-max-width)) / 2);

  display: grid;
  grid-template-columns:
    [full-width-start] minmax(var(--padding-inline), 1fr)
    [breakout-start] minmax(0, var(--breakout-size))
    [content-start] min(100% - (var(--padding-inline) * 2), var(--content-max-width))
    [content-end]
    minmax(0, var(--breakout-size)) [breakout-end]
    minmax(var(--padding-inline), 1fr) [full-width-end];
}

.content-grid > :not(.breakout, .full-width),
.full-width > :not(.breakout, .full-width) {
  grid-column: content;
}

.content-grid > .breakout {
  grid-column: breakout;
}

.content-grid > .full-width {
  grid-column: full-width;
  display: grid;
  grid-template-columns: inherit;
}

/* ===============================
   Header
   =============================== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1em 0;
  position: relative;
  z-index: 2;
}

.logo {
  font-size: 2rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--accent) !important;
  display: flex;
  align-items: center;
  gap: 0em;
}

.logo svg {
  width: 1.5em;
  height: 1.5em;
}

header nav {
  display: flex;
  align-items: center;
  gap: 1em;
}

@media (max-width: 768px) {
  header a {
    margin-bottom: 0 !important;
  }
}

/* ===============================
   Typography Sections
   =============================== */
section > h1,
section > h2,
section > h3 {
  margin-top: 0;
}

/* ===============================
   Gift Lists & Items
   =============================== */
#gift_lists {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.gift-list-container,
.gift,
.bordered-section {
  padding: 1em;
  position: relative;
  z-index: 2;
  border-radius: var(--standard-border-radius);
  border: 1px solid var(--accent-bg);
  background-color: var(--bg);
}

.gift,
.gift-list-container {
  background: var(--section-bg-light);
}

.gift-list-container {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 1em;
  position: relative;
}

.gift-list-container img {
  width: 60px;
  aspect-ratio: 1;
}

.gift-list-container h2 {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  font-size: 1.2rem;
  text-overflow: ellipsis;
}

.gift-list-container p {
  margin: 0;
}

.gift-list-container .event-date {
  color: #666;
  font-size: 1rem;
  margin: 0.5em 0;
}

.gift-list-container .list-status {
  border-radius: 30px;
  display: inline-block;
  font-size: 0.8rem;
  padding: 1px 6px;
  background-color: var(--accent-bg);
}

.gift-list-container .list-status.primary {
  background-color: var(--accent);
  color: var(--accent-bg);
}

.gift-list-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.gift-list-container .description {
  margin: 1em 0;
  line-height: 1.4;
}

.gift-list-container a {
  font-size: 1.4rem;
  text-decoration: none;
  text-align: right;
}
.gift-list-container a:after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.gift-list-container button,
.gift-list-container form {
  position: relative;
  z-index: 1;
}

#gifts_list {
  list-style-type: none;
  padding: 0;
}

.gift {
  list-style: none;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  padding: 1em;
  margin-bottom: 1em;
  gap: 1em;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
gift-list-header .gift:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.gift img {
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gift-edit-controls {
  display: flex;
  gap: 0.5em;
}
.gift a {
  text-decoration: none;
}
.gift a:after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.gift button,
.gift form,
.status-container {
  position: relative;
  z-index: 1;
}

.gift .status {
  display: inline-block;
  padding: 0.4em 0.8em;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--accent-bg);
  color: var(--text-dark);
}

.status-container {
  display: flex;
  align-items: center;
  gap: 0.75em;
  flex-wrap: wrap;
}

.status-container button {
  margin: 0;
  font-size: 0.9rem;
  padding: 0.5em 1em;
}

@media (max-width: 768px) {
  .gift {
    grid-template-columns: 64px 1fr;
  }
  .status-container {
    display: flex;
    align-items: center;
    gap: 1em;
  }
  .status-container button {
    margin-bottom: 0;
  }
  .gift-edit-controls {
    flex-direction: column;
  }
}

/* ===============================
   Privacy & Shared Users
   =============================== */
.privacy-settings {
  padding: 15px;
}

.shared-users {
  list-style: none;
  padding: 0;
}

.shared-users li {
  margin: 5px 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.shared-users li div {
  flex-grow: 1;
}

.shared-users li button {
  margin-bottom: 0.25rem;
}

.shared-users input[readonly] {
  background-color: #f8f9fa;
  cursor: pointer;
}

.shared-users .text-muted {
  font-size: 0.875em;
}

.list-actions {
  margin: 1rem 0;
  display: flex;
  justify-content: space-between;
}

.edit-list-container section {
  margin-bottom: 2rem;
}

.edit-list-container textarea,
input[type="date"] {
  width: 100%;
}

/* Danger Zone */
.danger-zone {
  background-color: var(--danger-bg);
  border-color: var(--danger-border);
}

.danger-zone h2 {
  color: var(--danger);
  margin-top: 0;
}

/* ===============================
   List Settings
   =============================== */
.list-settings {
  border-radius: var(--standard-border-radius);
  border: 1px solid var(--accent-bg);
  padding: 1em;
}

/* ===============================
   Forms & Buttons
   =============================== */
textarea,
select,
input,
button,
.button {
  font-size: inherit;
  font-family: inherit;
  padding: 10px;
  margin-bottom: 0.5rem;
  border-radius: 40px;
  box-shadow: none;
  max-width: 100%;
  display: inline-block;
}

textarea,
select,
input {
  color: var(--text);
  background-color: var(--bg);
  border: 1px solid var(--border);
}

textarea {
  border-radius: var(--standard-border-radius);
}

input[type="checkbox"] {
  border-radius: 5px;
}

input[type="range"] {
  padding: 0;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
}

select:not([multiple]) {
  background-image: linear-gradient(45deg, transparent 49%, var(--text) 51%), linear-gradient(135deg, var(--text) 51%, transparent 49%);
  background-position: calc(100% - 15px), calc(100% - 10px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 25px;
}

input[type="checkbox"],
input[type="radio"] {
  vertical-align: middle;
  position: relative;
  width: min-content;
}

input[type="checkbox"] + label,
input[type="radio"] + label {
  display: inline-block;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: var(--accent);
}

input[type="checkbox"]:checked::after {
  content: " ";
  width: 0.18em;
  height: 0.32em;
  position: absolute;
  top: 0.05em;
  left: 0.17em;
  border-right: solid var(--bg) 0.08em;
  border-bottom: solid var(--bg) 0.08em;
  transform: rotate(45deg);
}

details > summary {
  list-style: none;
  position: relative;
  padding-right: 1.25rem;
}

details > summary::marker,
details > summary::-webkit-details-marker {
  display: none;
}

details > summary:after,
details > summary:before {
  position: absolute;
  content: "";
  display: block;
  background-color: var(--text);
  border-radius: 1px;
}

details > summary:before {
  width: 12px;
  height: 2px;
  right: 5px;
  top: 50%;
}

details > summary:after {
  width: 2px;
  height: 12px;
  top: calc(50% - 5px);
  right: 10px;
  transition: all 200ms ease-out;
}

details[open] > summary:after {
  transform: rotate(90deg);
}

input[type="color"] {
  height: 2.5rem;
  padding: 0.2rem;
}

input[type="file"] {
  border: 0;
}

/* Buttons */
.btn-primary,
button,
.button,
a.button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
  background: var(--accent);
  color: #fff;
  padding: 15px 25px;
  border-radius: 30px;
  font-weight: bold;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  margin-right: 10px;
  transition: background 0.3s;
  text-decoration: none;
}

.btn-primary:hover,
button:hover,
.button:hover,
a.button:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 13px 23px;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
}

.delete-button {
  background-color: var(--danger);
  border-color: var(--danger);
}

.delete-button:hover {
  background-color: var(--danger-hover);
  border-color: var(--danger-hover);
}

/* ===============================
   Hero Section
   =============================== */
.hero {
  background: var(--hero-gradient);
  padding: 9em 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: -100px;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  background-repeat: no-repeat;
  background-size: contain;
}

.hero::before {
  top: 30%;
  left: -50px;
  width: 250px;
  height: 250px;
  background-image: url("/assets/26-3d1df879.svg");
}

.hero::after {
  bottom: -20px;
  right: 10%;
  width: 150px;
  height: 150px;
  background-image: url("/assets/9-03061f83.svg");
}

.hero h2 {
  font-size: 4.8rem;
  color: var(--text-dark);
  margin-bottom: 15px;
  position: relative;
  line-height: 1.1;
}

.hero h2::after {
  content: "🎁";
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
}

.hero p {
  max-width: 600px;
  margin: 0 auto 30px;
  color: var(--text-light);
}
.hero .button {
  justify-self: center;
}

@media (max-width: 860px) {
  .hero h2 {
    font-size: 2.8rem;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 7em 0;
    margin-top: -140px;
  }
  .hero h2 {
    margin-top: 1rem;
    line-height: 1.1;
    font-size: 2.2rem;
  }
  .hero::before {
    display: none;
  }
  .hero::after {
    right: calc(50% - 75px);
  }
}

/* ===============================
   How It Works Section
   =============================== */
.how-it-works {
  padding: 60px 0;
  text-align: center;
  background: var(--section-bg-light);
  position: relative;
}

.how-it-works::before {
  content: "";
  position: absolute;
  bottom: 20px;
  left: 20%;
  width: 150px;
  height: 150px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("/assets/4-98ffccdd.svg");
}

@media (max-width: 768px) {
  .how-it-works::before {
    left: 4%;
  }
}

.how-it-works h3 {
  font-size: 2rem;
  margin-bottom: 40px;
  color: var(--text-dark);
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.step {
  background: var(--bg);
  border: 1px solid var(--light-border);
  border-radius: 10px;
  width: 300px;
  padding: 20px;
  text-align: center;
  position: relative;
}

.step img {
  width: 80px;
  margin-bottom: 15px;
}

.step h4 {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.step p {
  font-size: 0.95rem;
  color: var(--text-mid);
}

/* ===============================
   Why Choose Giftko
   =============================== */
.why {
  padding: 60px 0;
  background: var(--section-bg-alt);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.why::after {
  content: "";
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 150px;
  height: 150px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("/assets/8-04d2aed1.svg");
}

@media (max-width: 768px) {
  .why::after {
    bottom: -10px;
    right: -30px;
  }
}

.why h3 {
  font-size: 2rem;
  margin-bottom: 40px;
  color: var(--text-dark);
  position: relative;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 0.8fr));
  gap: 20px;
  justify-content: center;
}

.feature {
  background: var(--bg);
  border: 1px solid var(--light-border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.feature img {
  width: 50px;
  margin-bottom: 15px;
}

.feature-emoji {
  font-size: 50px;
  margin-bottom: 15px;
}

.feature h4 {
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.feature p {
  color: var(--text-mid);
  font-size: 0.95rem;
}

/* ===============================
   FAQ Section
   =============================== */
.faq {
  padding: 60px 0;
  background: var(--section-bg-light);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.faq::before {
  content: "";
  position: absolute;
  top: 20%;
  left: -50px;
  background-repeat: no-repeat;
  background-size: contain;
  width: 180px;
  height: 180px;
  background-image: url("/assets/59-c0dbf0c2.svg");
}

@media (max-width: 768px) {
  .faq::before {
    width: 90px;
    height: 90px;
    top: -30px;
    left: -30px;
  }
}

.faq h3 {
  font-size: 2rem;
  margin: 0 auto 40px;
  color: var(--text-dark);
  max-width: 600px;
  width: 100%;
  text-align: left;
  padding-left: 30px;
  position: relative;
  z-index: 2;
}

.faq-list {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}

.faq-item {
  margin-bottom: 20px;
  position: relative;
  padding-left: 30px;
}

.faq-item strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 5px;
  color: var(--text-dark);
}

.faq-item p {
  font-size: 0.95rem;
  margin-top: 5px;
  color: var(--text-mid);
}

/* ===============================
   Final CTA
   =============================== */
.final-cta {
  padding: 60px 0;
  text-align: center;
  background: var(--bg);
  position: relative;
}

.final-cta p {
  max-width: 600px;
  margin: 0 auto 30px;
  font-size: 1.3rem;
  color: var(--text-mid);
}

.final-cta .btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 15px 30px;
  border-radius: 30px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.final-cta .btn-primary:hover {
  background: var(--accent-hover);
}

/* ===============================
   Footer
   =============================== */
footer {
  padding: 0.5em 1em;
  border-radius: var(--standard-border-radius);
  background-color: var(--accent-bg);
  margin-top: 1em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer button {
  background: none;
  color: var(--text);
  margin: 0;
  padding: 5px 10px;
}

/* ===============================
   Gift List Show Page
   =============================== */
.notice-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1em 1.5em;
  border-radius: var(--standard-border-radius);
  margin-bottom: 2em;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.gift-list-title-section {
  position: relative;
  z-index: 1;
}

.gift-list-header h1 {
  font-size: 2rem;
  margin: 0 0 0.5em 0;
  color: var(--text-dark);
  line-height: 1.2;
  display: inline-block;
  position: relative;
  margin-right: 1em;
}

.gift-list-header h1::before {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  background: rgba(255, 162, 144, 0.4);
  height: 16px;
  z-index: -1;
  bottom: 8px;
  border-radius: 4px;
}

.event-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--accent);
  color: white;
  padding: 0.5em 1em;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
}

.event-date-badge svg {
  flex-shrink: 0;
}

.gift-list-description {
  margin-top: 1.5em;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-mid);
  position: relative;
  z-index: 1;
}

.gifts-section {
  margin-bottom: 2em;
}

.section-title {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: 1em;
  display: inline-block;
  position: relative;
}

.section-title::before {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  background: rgba(255, 162, 144, 0.4);
  height: 16px;
  z-index: -1;
  bottom: 6px;
  border-radius: 3px;
}

.empty-state-fancy {
  text-align: center;
  padding: 4em 2em;
  background: linear-gradient(135deg, #f0f0f0 0%, #fafafa 100%);
  border-radius: var(--standard-border-radius);
  border: 2px dashed var(--border);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 0.5em;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.empty-state-fancy h3 {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin: 0.5em 0;
}

.empty-state-fancy p {
  color: var(--text-mid);
  font-size: 1rem;
}

.add-gift-section {
  background: var(--section-bg-light);
  border: 1px solid var(--accent-bg);
  border-radius: var(--standard-border-radius);
  padding: 2em;
  margin-bottom: 2em;
}

.add-gift-section h3 {
  margin-top: 0;
  display: inline-block;
  position: relative;
}

.add-gift-section h3::before {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  background: rgba(255, 162, 144, 0.4);
  height: 14px;
  z-index: -1;
  bottom: 5px;
  border-radius: 3px;
}

.gift-form-row {
  display: flex;
  gap: 1em;
  align-items: flex-end;
}

.gift-form-field {
  flex: 1;
  margin: 0;
}

.gift-form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5em;
  color: var(--text-dark);
}

.gift-url-input {
  width: 100%;
  padding: 0.75em 1em;
  border: 2px solid var(--accent-bg);
  border-radius: var(--standard-border-radius);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.gift-url-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.btn-add-gift {
  margin-bottom: 0;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .gift-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-add-gift {
    width: 100%;
  }
}

.page-nav {
  display: flex;
  gap: 1em;
  justify-content: space-between;
  padding: 1.5em 0;
  border-top: 1px solid var(--accent-bg);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.75em 1.25em;
  background: var(--bg);
  border: 2px solid var(--accent-bg);
  border-radius: 30px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.nav-link svg {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .gift-list-header h1 {
    font-size: 1.8rem;
  }

  .page-nav {
    flex-direction: column;
  }

  .nav-link {
    justify-content: center;
  }
}

/* ===============================
   Responsive Adjustments
   =============================== */
@media (max-width: 400px) {
  header.authenticated {
    flex-direction: column;
  }
  header.authenticated nav {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .steps,
  .features {
    flex-direction: column;
    align-items: center;
  }
}
