/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

/* Document
   ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */

 html {
    line-height: 1.15; /* 1 */
    -webkit-text-size-adjust: 100%; /* 2 */
  }
  
  /* Sections
     ========================================================================== */
  
  /**
   * Remove the margin in all browsers.
   */
  
  body {
    margin: 0;
  }
  
  /**
   * Render the `main` element consistently in IE.
   */
  
  main {
    display: block;
  }
  
  /**
   * Correct the font size and margin on `h1` elements within `section` and
   * `article` contexts in Chrome, Firefox, and Safari.
   */
  
  h1 {
    font-size: 2em;
    margin: 0.67em 0;
  }
  
  /* Grouping content
     ========================================================================== */
  
  /**
   * 1. Add the correct box sizing in Firefox.
   * 2. Show the overflow in Edge and IE.
   */
  
  hr {
    box-sizing: content-box; /* 1 */
    height: 0; /* 1 */
    overflow: visible; /* 2 */
  }
  
  /**
   * 1. Correct the inheritance and scaling of font size in all browsers.
   * 2. Correct the odd `em` font sizing in all browsers.
   */
  
  pre {
    font-family: monospace, monospace; /* 1 */
    font-size: 1em; /* 2 */
  }
  
  /* Text-level semantics
     ========================================================================== */
  
  /**
   * Remove the gray background on active links in IE 10.
   */
  
  a {
    background-color: transparent;
  }
  
  /**
   * 1. Remove the bottom border in Chrome 57-
   * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
   */
  
  abbr[title] {
    border-bottom: none; /* 1 */
    text-decoration: underline; /* 2 */
    text-decoration: underline dotted; /* 2 */
  }
  
  /**
   * Add the correct font weight in Chrome, Edge, and Safari.
   */
  
  b,
  strong {
    font-weight: bolder;
  }
  
  /**
   * 1. Correct the inheritance and scaling of font size in all browsers.
   * 2. Correct the odd `em` font sizing in all browsers.
   */
  
  code,
  kbd,
  samp {
    font-family: monospace, monospace; /* 1 */
    font-size: 1em; /* 2 */
  }
  
  /**
   * Add the correct font size in all browsers.
   */
  
  small {
    font-size: 80%;
  }
  
  /**
   * Prevent `sub` and `sup` elements from affecting the line height in
   * all browsers.
   */
  
  sub,
  sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
  }
  
  sub {
    bottom: -0.25em;
  }
  
  sup {
    top: -0.5em;
  }
  
  /* Embedded content
     ========================================================================== */
  
  /**
   * Remove the border on images inside links in IE 10.
   */
  
  img {
    border-style: none;
  }
  
  /* Forms
     ========================================================================== */
  
  /**
   * 1. Change the font styles in all browsers.
   * 2. Remove the margin in Firefox and Safari.
   */
  
  button,
  input,
  optgroup,
  select,
  textarea {
    font-family: inherit; /* 1 */
    font-size: 100%; /* 1 */
    line-height: 1.15; /* 1 */
    margin: 0; /* 2 */
  }
  
  /**
   * Show the overflow in IE.
   * 1. Show the overflow in Edge.
   */
  
  button,
  input { /* 1 */
    overflow: visible;
  }
  
  /**
   * Remove the inheritance of text transform in Edge, Firefox, and IE.
   * 1. Remove the inheritance of text transform in Firefox.
   */
  
  button,
  select { /* 1 */
    text-transform: none;
  }
  
  /**
   * Correct the inability to style clickable types in iOS and Safari.
   */
  
  button,
  [type="button"],
  [type="reset"],
  [type="submit"] {
    -webkit-appearance: button;
  }
  
  /**
   * Remove the inner border and padding in Firefox.
   */
  
  button::-moz-focus-inner,
  [type="button"]::-moz-focus-inner,
  [type="reset"]::-moz-focus-inner,
  [type="submit"]::-moz-focus-inner {
    border-style: none;
    padding: 0;
  }
  
  /**
   * Restore the focus styles unset by the previous rule.
   */
  
  button:-moz-focusring,
  [type="button"]:-moz-focusring,
  [type="reset"]:-moz-focusring,
  [type="submit"]:-moz-focusring {
    outline: 1px dotted ButtonText;
  }
  
  /**
   * Correct the padding in Firefox.
   */
  
  fieldset {
    padding: 0.35em 0.75em 0.625em;
  }
  
  /**
   * 1. Correct the text wrapping in Edge and IE.
   * 2. Correct the color inheritance from `fieldset` elements in IE.
   * 3. Remove the padding so developers are not caught out when they zero out
   *    `fieldset` elements in all browsers.
   */
  
  legend {
    box-sizing: border-box; /* 1 */
    color: inherit; /* 2 */
    display: table; /* 1 */
    max-width: 100%; /* 1 */
    padding: 0; /* 3 */
    white-space: normal; /* 1 */
  }
  
  /**
   * Add the correct vertical alignment in Chrome, Firefox, and Opera.
   */
  
  progress {
    vertical-align: baseline;
  }
  
  /**
   * Remove the default vertical scrollbar in IE 10+.
   */
  
  textarea {
    overflow: auto;
  }
  
  /**
   * 1. Add the correct box sizing in IE 10.
   * 2. Remove the padding in IE 10.
   */
  
  [type="checkbox"],
  [type="radio"] {
    box-sizing: border-box; /* 1 */
    padding: 0; /* 2 */
  }
  
  /**
   * Correct the cursor style of increment and decrement buttons in Chrome.
   */
  
  [type="number"]::-webkit-inner-spin-button,
  [type="number"]::-webkit-outer-spin-button {
    height: auto;
  }
  
  /**
   * 1. Correct the odd appearance in Chrome and Safari.
   * 2. Correct the outline style in Safari.
   */
  
  [type="search"] {
    -webkit-appearance: textfield; /* 1 */
    outline-offset: -2px; /* 2 */
  }
  
  /**
   * Remove the inner padding in Chrome and Safari on macOS.
   */
  
  [type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
  }
  
  /**
   * 1. Correct the inability to style clickable types in iOS and Safari.
   * 2. Change font properties to `inherit` in Safari.
   */
  
  ::-webkit-file-upload-button {
    -webkit-appearance: button; /* 1 */
    font: inherit; /* 2 */
  }
  
  /* Interactive
     ========================================================================== */
  
  /*
   * Add the correct display in Edge, IE 10+, and Firefox.
   */
  
  details {
    display: block;
  }
  
  /*
   * Add the correct display in all browsers.
   */
  
  summary {
    display: list-item;
  }
  
  /* Misc
     ========================================================================== */
  
  /**
   * Add the correct display in IE 10+.
   */
  
  template {
    display: none;
  }
  
  /**
   * Add the correct display in IE 10.
   */
  
  [hidden] {
    display: none;
  }

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: #1a472a;
    color: #efeee9;
    font-family: 'MedievalSharp', cursive;
    background-image: url('img/background.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    z-index: 1;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    scroll-behavior: smooth;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(1, 50, 32, 0.65);
    /* backdrop-filter: blur(5px); */
    z-index: -1;
}

h1, h2, h3, h4, h5, h6 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'MedievalSharp', cursive;
    color: #eeba30;
}

header h1 {
    font-size: 4rem;
}

h2 {
    font-size: 3rem;
}

h3 {
    font-size: 2.5rem;
}

header h2.lead {
    font-size: 2rem;
}

.readable-font {
    font-family: 'Caudex', serif;
}

.full-width-text-background {
    width: 100%;
    padding: 20px 0; /* Add vertical padding */
    z-index: 1;
    flex-grow: 1; /* Allow it to grow and fill available vertical space */
    background-color:  rgba(26, 71, 42, 0.2)
}

.container {
    max-width: 960px;
    position: relative; /* Ensure container content is above the overlay */
    z-index: 2; /* Content should be above the overlay */
}

#countdown {
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.countdown-container {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.countdown-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.countdown-value {
    display: block;
    min-width: 3ch;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: transform 0.3s ease;
}

.countdown-label {
    font-size: 0.5em;
    color: #cfb53b;
    text-align: center;
}

.countdown-flip {
    animation: clockReset 0.6s ease-in-out;
}

@keyframes clockReset {
    0% {
        transform: rotateX(0deg);
        opacity: 1;
    }
    50% {
        transform: rotateX(90deg);
        opacity: 0;
    }
    51% {
        transform: rotateX(-90deg);
        opacity: 0;
    }
    100% {
        transform: rotateX(0deg);
        opacity: 1;
    }
}

.countdown-expired {
    display: block;
    font-size: 2rem;
}

.card {
    position: relative;
    overflow: visible;
    background: #efeee9;
    border: 1px solid rgba(238, 186, 48, 0.25) !important;
    border-radius: 0 !important;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35), 0 6px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(238, 186, 48, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px) rotate(var(--card-rotation, 0deg));
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45), 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 24px rgba(238, 186, 48, 0.2);
}

.card-img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    filter: sepia(25%) contrast(115%) brightness(88%) saturate(80%);
}

.card::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    aspect-ratio: 2 / 3;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.25) 100%);
    pointer-events: none;
    z-index: 1;
}

.card-body {
    position: relative;
    background: transparent;
    padding: 1.5rem 0.5rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding-bottom: 0;
}

.card-title {
    margin: 0;
    color: #1a472a;
    text-align: center;
    font-size: 2.5rem;
    text-shadow: 0 1px 3px rgba(26, 71, 42, 0.15);
}

/* Navigation */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(1, 50, 32, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(238, 186, 48, 0.12);
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0.9rem 0;
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.site-nav a {
    color: #eeba30;
    text-decoration: none;
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    position: relative;
    transition: color 0.2s ease;
}

.site-nav a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: #eeba30;
    transition: width 0.3s ease;
}

.site-nav a:hover {
    color: #ffd700;
}

.site-nav a:hover::after {
    width: 100%;
}

@media (max-width: 479px) {
    .site-nav ul {
        gap: 1.5rem;
        padding: 0.75rem 1rem;
    }
    .site-nav a {
        font-size: 1rem;
        letter-spacing: 0.08em;
    }
}

/* Placeholder sections */
.placeholder-section {
    border-top: 1px solid rgba(238, 186, 48, 0.15);
    padding-top: 2rem;
    padding-bottom: 1rem;
}

/* Confirmar section */
.confirmar-section {
    border-top: 1px solid rgba(238, 186, 48, 0.15);
    padding-top: 2rem;
    padding-bottom: 1rem;
}

.btn-confirmar {
    background: linear-gradient(135deg, rgba(1, 50, 32, 0.65), rgba(26, 71, 42, 0.5));
    border: 2px solid rgba(238, 186, 48, 0.8);
    color: #eeba30;
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.75rem 2.5rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-confirmar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transition: left 0.4s ease;
    pointer-events: none;
}

.btn-confirmar:hover {
    background: linear-gradient(135deg, rgba(1, 50, 32, 0.8), rgba(26, 71, 42, 0.7));
    border-color: #ffd700;
    color: #ffd700;
    box-shadow: 0 0 20px rgba(238, 186, 48, 0.35), 0 4px 16px rgba(0, 0, 0, 0.4);
}

.btn-confirmar:hover::before {
    left: 100%;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(1, 50, 32, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay[hidden] {
    display: none;
}

/* Modal box */
.modal-box {
    background: rgba(1, 50, 32, 0.97);
    border: 1px solid rgba(238, 186, 48, 0.2);
    padding: 2.5rem 2rem 2rem;
    max-width: 460px;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

.modal-box h3 {
    color: #eeba30;
    margin-bottom: 0.4rem;
    font-size: 1.7rem;
    text-shadow: none;
}

.modal-subtitle {
    color: #cfb53b;
    font-family: 'Caudex', serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Close button */
.modal-close {
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    background: none;
    border: none;
    color: #eeba30;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    line-height: 1;
}

.modal-close:hover {
    opacity: 1;
}

/* Name rows */
#names-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.name-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.name-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(238, 186, 48, 0.25);
    color: #efeee9;
    font-family: 'Caudex', serif;
    font-size: 1rem;
    padding: 0.65rem 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.name-input::placeholder {
    color: rgba(239, 238, 233, 0.35);
}

.name-input:focus {
    border-color: rgba(238, 186, 48, 0.7);
}

.name-input.input-error {
    border-color: #ff5349;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

/* Remove row button */
.btn-remove-name {
    background: none;
    border: none;
    color: rgba(239, 238, 233, 0.4);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.btn-remove-name:hover {
    color: #ff5349;
}

/* Add name button */
.btn-add-name {
    background: rgba(1, 50, 32, 0.35);
    border: 2px solid rgba(238, 186, 48, 0.5);
    color: #eeba30;
    font-family: 'Caudex', serif;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    width: 100%;
    letter-spacing: 0.04em;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    margin-bottom: 1.25rem;
    margin-top: 0.25rem;
    position: relative;
    overflow: hidden;
}

.btn-add-name:hover {
    background: rgba(1, 50, 32, 0.6);
    border-color: rgba(238, 186, 48, 0.8);
    color: #ffd700;
    box-shadow: 0 0 12px rgba(238, 186, 48, 0.25);
}

/* Primary confirm / close button */
.btn-submit {
    background: linear-gradient(160deg, #eeba30 0%, #ffd700 48%, #cfb53b 100%);
    border: none;
    color: #013220;
    font-family: 'MedievalSharp', cursive;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.8rem 2rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(238, 186, 48, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.btn-submit:hover {
    background: linear-gradient(160deg, #ffd700 0%, #eeba30 48%, #d4a017 100%);
    box-shadow: 0 5px 16px rgba(238, 186, 48, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-submit:hover::before {
    left: 100%;
}

/* Success view */
.modal-success-icon {
    font-size: 3rem;
    color: #eeba30;
    margin: 0 0 0.5rem;
    line-height: 1;
}

.modal-success-title {
    color: #eeba30;
    font-size: 1.7rem;
    margin-bottom: 0.4rem;
    text-shadow: none;
}

.modal-names {
    font-family: 'Caudex', serif;
    color: #efeee9;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Prevent body scroll when modal open */
body.modal-open {
    overflow: hidden;
}

/* Accessibility: Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

/* Accessibility: Focus indicators */
*:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

/* Accessibility: Ensure sufficient color contrast */
/* Card title text shadow removed for polaroid style - dark text on white background */

/* Polaroid tilt effect - cards look like they were dropped on a table */
/* Desktop cards */
.desktop-card:nth-child(1) .card {
    transform: rotate(-4deg) translate(5px, -9px);
    --card-rotation: -4deg;
}

.desktop-card:nth-child(2) .card {
    transform: rotate(2deg) translate(00px, -4px);
    --card-rotation: 2deg;
}

.desktop-card:nth-child(3) .card {
    transform: rotate(-3deg) translate(-5px, -3px);
    --card-rotation: -3deg;
}

/* Tablet cards - using nth-child to target 4th and 5th children */
.tablet-card:nth-child(4) .card {
    transform: rotate(5deg);
    --card-rotation: 5deg;
}

.tablet-card:nth-child(5) .card {
    transform: rotate(-3deg) translate(0, -30px);
    --card-rotation: -3deg;
}

/* Mobile card - 6th child */
.mobile-card:nth-child(6) .card {
    transform: rotate(-3deg);
    --card-rotation: -3deg;
}

/* Responsive card visibility */
/* Default: Hide mobile and tablet cards, show desktop cards */
.mobile-card,
.tablet-card {
    display: none;
}

/* Mobile: Show only mobile card (< 480px) */
@media (max-width: 479px) {
    .tablet-card,
    .desktop-card {
        display: none !important;
    }
    .mobile-card {
        display: block !important;
    }
    .countdown-value {
        text-align: center;
    }

    header h1 {
        font-size: 2.5rem;
    }
    header h2.lead {
        font-size: 1.3rem;
    }
    h3 {
        font-size: 1.8rem;
    }
    #countdown {
        font-size: 2rem;
    }
}

/* Tablet: Show only tablet cards + responsive font sizing (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .mobile-card,
    .desktop-card {
        display: none !important;
    }
    .tablet-card {
        display: block !important;
    }
    header h1 {
        font-size: 3rem;
    }
    header h2.lead {
        font-size: 1.5rem;
    }
}

/* Desktop: Show only desktop cards (>= 768px) */
@media (min-width: 768px) {
    .mobile-card,
    .tablet-card {
        display: none !important;
    }
    .desktop-card {
        display: block !important;
    }
}

/* Accessibility: Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .countdown-flip {
        animation: none;
    }
    .card {
        transition: none;
    }
    .countdown-value {
        transition: none;
    }
    .site-nav a,
    .site-nav a::after {
        transition: none;
    }
    .name-input.input-error {
        animation: none;
    }
}
