/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Electrolize', 'Noto Sans JP', sans-serif;
    overflow-x: hidden;
    visibility: hidden;
}

body.loaded {
    visibility: visible;
}

/* Downloads page container */
.downloads-page {
    min-height: 100vh;
    width: 100%;
    background-image: url('../images/background.png');
    background-repeat: repeat;
    background-size: 50px 50px;
    background-position: 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px;
    gap: 22px;
    position: relative;
    animation: backgroundFlow 10s linear infinite;
}

@keyframes backgroundFlow {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* Head section */
.head {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
    max-width: 700px;
    padding-bottom: 14px;
    padding-right: 0;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.2s forwards;
}

/* Menu button */
.menu-button {
    background: transparent;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: -14px;
    transition: transform 0.3s ease;
    z-index: 10;
}

.menu-button:hover {
    transform: scale(1.1);
}

.menu-button:active {
    transform: scale(0.95);
}

.menu-icon {
    width: 32px;
    height: 32px;
}

/* Header */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    width: 100%;
    margin-bottom: -14px;
}

/* Page title */
.page-title {
    font-family: 'Electrolize', sans-serif;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 10.08px;
    text-align: center;
    color: white;
    line-height: 1.261;
    -webkit-text-stroke: 5px black;
    text-stroke: 5px black;
    paint-order: stroke fill;
}

/* Downloads list */
.downloads-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    max-width: 700px;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.4s forwards;
}

/* Download card */
.download-card {
    background-color: white;
    border: 2px solid black;
    border-radius: 13px;
    box-shadow: 3px 3px 0px 0px black;
    padding: 15px 18px;
    width: 100%;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    overflow: visible;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    text-decoration: none;
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: 5px 5px 0px 0px black;
}

.download-card:active {
    transform: translateY(0);
    box-shadow: 2px 2px 0px 0px black;
}

.download-card.animate-in {
    animation: cardSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Staggered animation */
.download-card:nth-child(1).animate-in { animation-delay: 0.5s; }
.download-card:nth-child(2).animate-in { animation-delay: 0.55s; }
.download-card:nth-child(3).animate-in { animation-delay: 0.6s; }
.download-card:nth-child(4).animate-in { animation-delay: 0.65s; }
.download-card:nth-child(5).animate-in { animation-delay: 0.7s; }
.download-card:nth-child(6).animate-in { animation-delay: 0.75s; }
.download-card:nth-child(7).animate-in { animation-delay: 0.8s; }
.download-card:nth-child(8).animate-in { animation-delay: 0.85s; }

/* File type icon */
.file-type-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

/* Download data */
.download-data {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* Download meta */
.download-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: 14px;
    line-height: 1.09;
}

.part-number {
    color: black;
}

.scene-range {
    color: #959595;
}

/* Download title */
.download-title {
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: black;
    line-height: 1.09;
}

/* Download button (icon container) */
.download-button {
    width: 56px;
    height: 56px;
    background-color: #7fff00;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.download-icon {
    width: 40px;
    height: 46px;
}

/* Keyframe animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes cardSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-3px) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Menu overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(233, 231, 231, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 700px;
    height: 100%;
    position: relative;
}

/* Close button */
.close-button {
    background: transparent;
    border: none;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 0;
    padding: 0;
    transition: transform 0.3s ease;
}

.close-button:hover {
    transform: rotate(90deg) scale(1.1);
}

.close-button:active {
    transform: rotate(90deg) scale(0.95);
}

.close-icon {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-line {
    position: absolute;
    width: 3px;
    height: 30px;
    background-color: black;
    border-radius: 1.5px;
}

.close-line-1 {
    transform: rotate(45deg);
}

.close-line-2 {
    transform: rotate(135deg);
}

/* Menu navigation */
.menu-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 41px;
    width: 100%;
    flex: 1;
    padding-bottom: 56px;
}

.menu-link {
    font-family: 'Electrolize', sans-serif;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 10.08px;
    text-align: center;
    color: white;
    line-height: 1.261;
    -webkit-text-stroke: 6px black;
    text-stroke: 6px black;
    paint-order: stroke fill;
    text-decoration: none;
    width: 100%;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.menu-overlay.active .menu-link {
    animation: menuLinkSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.menu-overlay.active .menu-link:nth-child(1) {
    animation-delay: 0.1s;
}

.menu-overlay.active .menu-link:nth-child(2) {
    animation-delay: 0.2s;
}

.menu-overlay.active .menu-link:nth-child(3) {
    animation-delay: 0.3s;
}

.menu-overlay.active .menu-link:nth-child(4) {
    animation-delay: 0.4s;
}

.menu-link:hover {
    transform: scale(1.05);
    text-shadow: 0 0 20px rgba(127, 255, 0, 0.5);
}

.menu-link:active {
    transform: scale(0.95);
}

@keyframes menuLinkSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .downloads-page {
        padding: 24px 12px;
        gap: 20px;
    }

    .head {
        padding-right: 8px;
    }

    .page-title {
        font-size: 32px;
        letter-spacing: 8px;
        -webkit-text-stroke: 5px black;
        text-stroke: 5px black;
    }

    .download-card {
        min-height: 80px;
    }

    .download-data {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .head {
        padding-right: 12px;
    }

    .page-title {
        font-size: 28px;
        letter-spacing: 6px;
        -webkit-text-stroke: 4px black;
        text-stroke: 4px black;
    }

    .download-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .download-meta {
        font-size: 12px;
    }

    .download-title {
        font-size: 16px;
    }

    .file-type-icon {
        width: 30px;
        height: 30px;
    }

    .download-button {
        width: 48px;
        height: 48px;
    }

    .download-icon {
        width: 32px;
        height: 38px;
    }

    /* Menu overlay responsive */
    .menu-content {
        gap: 150px;
    }

    .menu-link {
        font-size: 32px;
        letter-spacing: 8px;
        -webkit-text-stroke: 5px black;
        text-stroke: 5px black;
    }

    .close-button {
        width: 44px;
        height: 44px;
    }

    .close-line {
        width: 2.5px;
        height: 26px;
    }

    .menu-button {
        width: 28px;
        height: 28px;
    }

    .menu-icon {
        width: 28px;
        height: 28px;
    }
}
