body {
    font-family: 'Noto Sans TC', sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* 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.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 30px;
}

.close {
    color: #9ca3af;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #374151;
}

.hero-bg {
    background-image: url('https://www.ifantech.net/file/1920x1080_taics_event.png');
    background-size: cover;
    background-position: center;
}

/* Style for the main navigation bar */
#main-nav {
    background-color: #111827;
    /* bg-gray-900 */
    transition: box-shadow 0.3s ease-in-out;
}

#main-nav a:hover {
    color: #9CA3AF;
    /* text-gray-400 */
}

/* Ensure dropdown options are readable */
#main-nav .mobile-nav-select option {
    color: black;
    background-color: white;
}

/* Style for the sticky state of the navigation bar */
#main-nav.sticky {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 隱藏滾動條樣式 */
.scrollbar-hide {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

/* Timeline 樣式 */
.timeline {
    --col-gap: 2rem;
    --row-gap: 2rem;
    --line-w: 0.25rem;
    display: grid;
    grid-template-columns: var(--line-w) 1fr;
    grid-auto-columns: max-content;
    column-gap: var(--col-gap);
    list-style: none;
    width: min(60rem, 90%);
    margin-inline: auto;
}

/* timeline vertical line */
.timeline::before {
    content: "";
    grid-column: 1;
    grid-row: 1 / span 20;
    background: rgb(225, 225, 225);
    border-radius: calc(var(--line-w) / 2);
}

/* timeline item gaps */
.timeline li:not(:last-child) {
    margin-bottom: var(--row-gap);
}

/* timeline card */
.timeline li {
    grid-column: 2;
    --inlineP: 1.5rem;
    margin-inline: var(--inlineP);
    grid-row: span 2;
    display: grid;
    grid-template-rows: min-content min-content min-content;
}

/* timeline date */
.timeline li .date {
    --dateH: 3rem;
    height: var(--dateH);
    margin-inline: calc(var(--inlineP) * -1);
    text-align: center;
    background-color: var(--accent-color);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    display: grid;
    place-content: center;
    position: relative;
    border-radius: calc(var(--dateH) / 2) 0 0 calc(var(--dateH) / 2);
}

/* timeline date flap */
.timeline li .date::before {
    content: "";
    width: var(--inlineP);
    aspect-ratio: 1;
    background: var(--accent-color);
    background-image: linear-gradient(rgba(0, 0, 0, 0.2) 100%, transparent);
    position: absolute;
    top: 100%;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    right: 0;
}

/* timeline circle */
.timeline li .date::after {
    content: "";
    position: absolute;
    width: 2rem;
    aspect-ratio: 1;
    background: white;
    border: 0.3rem solid var(--accent-color);
    border-radius: 50%;
    top: 50%;
    transform: translate(50%, -50%);
    right: calc(100% + var(--col-gap) + var(--line-w) / 2);
}

/* timeline title and description */
.timeline li .title,
.timeline li .descr {
    background: white;
    position: relative;
    padding-inline: 1.5rem;
}

.timeline li .title {
    overflow: hidden;
    padding-block-start: 1.5rem;
    padding-block-end: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.timeline li .descr {
    padding-block-end: 1.5rem;
    font-weight: 400;
    color: #666;
}

/* timeline shadows */
.timeline li .title::before,
.timeline li .descr::before {
    content: "";
    position: absolute;
    width: 90%;
    height: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    left: 50%;
    border-radius: 50%;
    filter: blur(4px);
    transform: translate(-50%, 50%);
}

.timeline li .title::before {
    bottom: calc(100% + 0.125rem);
}

.timeline li .descr::before {
    z-index: -1;
    bottom: 0.25rem;
}

/* Desktop: alternate layout */
@media (min-width: 40rem) {
    .timeline {
        grid-template-columns: 1fr var(--line-w) 1fr;
    }

    .timeline::before {
        grid-column: 2;
    }

    .timeline li:nth-child(odd) {
        grid-column: 1;
    }

    .timeline li:nth-child(even) {
        grid-column: 3;
    }

    .timeline li:nth-child(2) {
        grid-row: 2/4;
    }

    .timeline li:nth-child(odd) .date::before {
        clip-path: polygon(0 0, 100% 0, 100% 100%);
        left: 0;
    }

    .timeline li:nth-child(odd) .date::after {
        transform: translate(-50%, -50%);
        left: calc(100% + var(--col-gap) + var(--line-w) / 2);
    }

    .timeline li:nth-child(odd) .date {
        border-radius: 0 calc(var(--dateH) / 2) calc(var(--dateH) / 2) 0;
    }
}

.satellite {
    animation: satellite-bob 4s ease-in-out infinite;
    transform-origin: center;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes satellite-bob {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* New background for rewards section */
.rewards-bg {
    background-image: url('https://images.unsplash.com/photo-1513346940221-6f673d962e97?q=80&w=1974&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.toast-notification {
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 500px;
    word-wrap: break-word;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.success {
    background: #1a8734;
}

.toast-notification.error {
    background: #912d37;
}

.toast-notification.warning {
    background: #dba604;
    color: #333;
}

.toast-notification.info {
    background: #178c9e;
}

@media (max-width: 767px) {
    .toast-notification {
        max-width: 280px;
    }
}

/* Responsive styles for File History List */
@media (max-width: 767px) {

    /* 選取檔案歷史列表中的每一個項目 */
    #fileHistoryList>div {
        flex-direction: column;
        align-items: flex-start;
    }

    /* 選取包含檔案資訊的區塊 (第一個子 div) */
    #fileHistoryList>div>div:nth-child(1) {
        margin-bottom: 0.75rem;
        /* 12px */
    }

    /* 選取包含按鈕的區塊 (第二個子 div) */
    #fileHistoryList>div>div:nth-child(2) {
        width: 100%;
        justify-content: flex-end;
        /* 將按鈕靠右對齊 */
    }

    /* 處理長檔名，使其可以斷行 */
    #fileHistoryList .font-medium.text-gray-900 {
        word-break: break-all;
    }
}

/* Responsive styles for Registration Form Captcha/Actions */
@media (max-width: 767px) {

    /* Main container: stack captcha and buttons vertically */
    #registrationForm>div:last-child>.flex {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        /* 24px */
    }

    /* Captcha inner container: allow wrapping for small screens */
    #registrationForm .flex.items-center.space-x-2 {
        flex-wrap: wrap;
        gap: 0;
    }
}

.registerCaptcha {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 767px) {
    .registerCaptcha {
        display: flex;
        flex-direction: column;
    }
}

/* Verification Success Details Layout */
#verification-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* 12px */
}

.detail-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4-column grid for desktop */
    gap: 1rem;
    /* 16px */
}

.detail-item {
    padding: 0.25rem 0;
}

.detail-item-span-3 {
    grid-column: span 3;
    /* Make this item span 3 columns */
}

/* On mobile, stack everything into a single column */
@media (max-width: 767px) {
    .detail-row {
        grid-template-columns: 1fr;
        /* Switch to a single column */
        gap: 0.5rem;
    }

    .detail-item-span-3 {
        grid-column: span 1;
        /* Reset span on mobile */
    }

    .VerificationMB {
        margin-bottom: 12px;
    }
}

.fab-rounded {
    border-radius: 3rem;
}