.giftcode-page {
    --content: 90ch;
}

.giftcode-intro {
    background-image: url('/assets/images/giftcodes_bg.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    place-items: end center;
    padding-top: var(--spacing-14);
    padding-bottom: var(--spacing-10);
}

@media (max-width: 590px) {
    .giftcode-intro {
        background-position: left;
        height: auto;
    }
}

.giftcode-intro h1 {
    font-family: var(--heading-font);
    font-size: var(--heading-sm-size);
    line-height: var(--heading-sm-leading-loose);
    font-weight: var(--heading-sm-weight);
    color: var(--clr-bronze-50);
    text-align: center;
    text-transform: uppercase;
}

.giftcode-intro p {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5em;
    color: var(--clr-base-200--70);
    text-align: center;
    margin-top: var(--spacing-2);
    max-width: 60ch;
    margin-inline: auto;
}

.giftcode-content {
    background-color: var(--clr-base-800);
    padding-top: var(--spacing-10);
    padding-bottom: var(--spacing-12);
}

/* ========================================
   Gift Code Table — inspired by MUMAD.net
   ======================================== */

.giftcode-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.giftcode-table {
    max-width: 100%;
    width: 100%;
    border-collapse: collapse;
}

.giftcode-table th,
.giftcode-table td {
    padding: var(--spacing-4);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1rem;
    text-align: left;
    border: 1px solid var(--clr-base-600--30);
}

.giftcode-table th {
    background-color: var(--clr-base-900);
    color: var(--clr-base-400--90);
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: var(--spacing-3) var(--spacing-4);
}

.giftcode-table th:first-child {
    border-top-left-radius: var(--radius-3);
}

.giftcode-table th:last-child {
    border-top-right-radius: var(--radius-3);
}

.giftcode-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-3);
}

.giftcode-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-3);
}

.giftcode-table td {
    background-color: var(--clr-base-800);
    color: var(--clr-base-200--80);
    font-family: var(--font-sans);
    transition: background-color 200ms ease-out;
}

.giftcode-table tbody tr:hover td {
    background-color: var(--clr-base-700);
}

/* Number column */
.giftcode-table td:first-child {
    color: var(--clr-base-400);
    font-size: 0.875rem;
    font-weight: 500;
    width: 60px;
    text-align: center;
}

/* Code column — highlighted */
.giftcode-table .code-cell {
    font-family: var(--font-monospace);
    font-size: 1rem;
    font-weight: 500;
    color: var(--clr-bronze-300);
    letter-spacing: 0.05em;
    position: relative;
}

.giftcode-table .code-cell .code-text {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-1) var(--spacing-2);
    background-color: var(--clr-bronze-600--20);
    border: 1px solid var(--clr-bronze-600--30);
    border-radius: var(--radius-2);
    cursor: pointer;
    transition: background-color 200ms ease-out, border-color 200ms ease-out;
    user-select: all;
}

.giftcode-table .code-cell .code-text:hover {
    background-color: var(--clr-bronze-600--40);
    border-color: var(--clr-bronze-400--30);
}

.giftcode-table .code-cell .copy-icon {
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity 200ms ease-out;
    color: var(--clr-bronze-400);
    flex-shrink: 0;
}

.giftcode-table .code-cell .code-text:hover .copy-icon {
    opacity: 1;
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--spacing-1) var(--spacing-3);
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-badge--active {
    background-color: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.status-badge--active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #4ade80;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Expired status badge */
.status-badge--expired {
    background-color: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-badge--expired::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #f87171;
    opacity: 0.5;
}

/* Expired code text */
.giftcode-table .code-cell .code-text--expired {
    cursor: default;
    user-select: none;
    opacity: 0.5;
    text-decoration: line-through;
}

.giftcode-table .code-cell .code-text--expired:hover {
    background-color: var(--clr-bronze-600--20);
    border-color: var(--clr-bronze-600--30);
}

/* Expired table */
.giftcode-table--expired td {
    opacity: 0.7;
}

/* ========================================
   Expired Section — Expandable
   ======================================== */

.giftcode-expired-section {
    margin-top: var(--spacing-8);
}

.giftcode-expired-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-3) var(--spacing-5);
    background-color: var(--clr-base-700);
    border: 1px solid var(--clr-base-600--30);
    border-radius: var(--radius-3);
    color: var(--clr-base-300);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 200ms ease-out, color 200ms ease-out, border-color 200ms ease-out;
    width: 100%;
    justify-content: center;
}

.giftcode-expired-toggle:hover {
    background-color: var(--clr-base-600);
    color: var(--clr-base-200);
    border-color: var(--clr-base-500--30);
}

.giftcode-expired-toggle__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 300ms ease-out;
}

.giftcode-expired-toggle.open .giftcode-expired-toggle__icon {
    transform: rotate(180deg);
}

.giftcode-expired-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 400ms cubic-bezier(0.4, 0, 0.2, 1), opacity 300ms ease-out;
    opacity: 0;
}

.giftcode-expired-content.open {
    max-height: 2000px;
    opacity: 1;
    margin-top: var(--spacing-4);
}

/* Copy toast notification */
.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--clr-bronze-600);
    color: var(--clr-bronze-50);
    padding: var(--spacing-3) var(--spacing-6);
    border-radius: var(--radius-4);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 300ms ease-out;
    pointer-events: none;
    box-shadow: var(--shadow-xl);
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Empty state */
.giftcode-empty {
    text-align: center;
    padding: var(--spacing-10) var(--spacing-4);
}

.giftcode-empty__icon {
    width: 64px;
    height: 64px;
    margin-inline: auto;
    margin-bottom: var(--spacing-4);
    color: var(--clr-base-500);
}

.giftcode-empty__title {
    font-family: var(--heading-font);
    font-size: var(--heading-xs-size);
    font-weight: var(--heading-xs-weight);
    color: var(--clr-base-300);
    margin-bottom: var(--spacing-2);
}

.giftcode-empty__text {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--clr-base-400);
    line-height: 1.5em;
}

/* Responsive */
@media (width >=50rem) {
    .giftcode-intro h1 {
        font-size: var(--heading-base-size);
        line-height: var(--heading-base-leading-loose);
        font-weight: var(--heading-base-weight);
    }

    .giftcode-intro p {
        font-size: 1.125rem;
    }

    .giftcode-table th,
    .giftcode-table td {
        padding: var(--spacing-4) var(--spacing-5);
    }
}

@media (max-width: 640px) {

    .giftcode-table th,
    .giftcode-table td {
        padding: var(--spacing-3);
        font-size: 0.875rem;
    }

    .giftcode-table .code-cell {
        font-size: 0.875rem;
    }
}