/* Font Imports */
@font-face {
    font-family: 'FFFLauta';
    src: url('https://static.essential.gg/fonts/ffflauta/standard/400/roman.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'Geist';
    src: url('https://static.essential.gg/fonts/geist/standard/variable.woff2') format('woff2');
    font-display: swap;
}

/* Root Variables */
:root {
    --black: #000000;
    --dark: #0a0a0a;
    --darker: #050505;
    --red: #ff2222;
    --red-hover: #ff4444;
    --blue: #3e8fff;
    --gray: rgba(255, 255, 255, 0.1);
    --text: rgba(255, 255, 255, 0.7);
    --text-light: rgba(255, 255, 255, 0.9);
    --transition: 0.2s cubic-bezier(0.65, 0, 0.35, 1);
    --transition-slow: 0.4s cubic-bezier(0.65, 0, 0.35, 1);
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    --header-height: 74px;
    --header-height-scroll: 60px;
    --addition-color: #4caf50;
    --bugfix-color: #ff9800;
    --addition-bg-color: rgba(129, 199, 132, 0.2);
    --bugfix-bg-color: rgba(255, 183, 77, 0.2);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scrollbar-color: var(--red) var(--black);
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 0.35rem;
    background-color: var(--black);
}

::-webkit-scrollbar-thumb {
    background-color: var(--red);
    border-radius: 1rem;
}

body {
    background: var(--black);
    color: white;
    font-family: 'Geist', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--gray);
    transition: all 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.header.scrolled {
    height: var(--header-height-scroll);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 7rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(255, 34, 34, 0) 100%);
    pointer-events: none;
    transform: translateY(100%);
    z-index: -1;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.logo {
    display: inline-block;
    height: calc(var(--header-height) - 20px);
    transition: height 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.header.scrolled .logo {
    height: calc(var(--header-height-scroll) - 15px);
}

.logo img {
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* Navigation Styles */
.nav {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    font-family: 'FFFLauta', sans-serif;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
    transform: skew(-2deg);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 2px;
    left: 0;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.nav-link:hover, 
.nav-link:focus,
.nav-link.active {
    color: var(--text-light);
    transform: skew(-2deg) scale(1.1);
    outline: none;
}

.nav-link:hover::after, 
.nav-link:focus::after,
.nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.download-button {
    font-family: 'FFFLauta', sans-serif;
    background: var(--red);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(255, 34, 34, 0.25);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.download-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.download-button:hover, 
.download-button:focus {
    transform: translateY(-2px);
    background: white;
    color: var(--red);
    box-shadow: 0 6px 16px rgba(255, 34, 34, 0.35);
    outline: none;
}

.download-button:hover::before, 
.download-button:focus::before {
    transform: translateY(0);
}

.download-icon {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    transition: all 0.3s ease;
}

.download-button:hover .download-icon {
    animation: downloadArrow 0.5s ease-in-out;
}

@keyframes downloadArrow {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(6px); opacity: 0; }
    51% { transform: translateY(-6px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.right-section {
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.header.scrolled .right-section {
    transform: scale(0.9);
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.social-icon {
    width: 24px;
    height: 24px;
    fill: white;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.social-icon:hover {
    transform: scale(1.1);
    opacity: 1;
    fill: var(--red);
}

/* Main Content Styles */
.main-content {
    padding-top: var(--header-height);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-title {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease forwards;
}

.page-title h1 {
    font-family: 'FFFLauta', sans-serif;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.page-title p {
    color: var(--text);
    max-width: 600px;
    margin: 0 auto;
}

/* Search Styles */
.search-container {
    margin: 2rem 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    animation: fadeIn 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--text);
    opacity: 0.7;
}

#search-input {
    flex-grow: 1;
    padding: 14px 14px 14px 46px;
    font-size: 16px;
    border: none;
    border-radius: 8px 0 0 8px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    transition: all 0.3s ease;
    font-family: 'Geist', sans-serif;
}

#search-input::placeholder {
    color: var(--text);
    opacity: 0.7;
}

.search-button {
    padding: 14px 24px;
    font-size: 16px;
    background-color: var(--red);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'FFFLauta', sans-serif;
}

#search-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 1px rgba(255, 34, 34, 0.3);
}

.search-button:hover {
    background-color: var(--red-hover);
    transform: translateY(-2px);
}

/* Filter Styles */
.filter-section {
    margin: 2rem 0;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    animation: fadeIn 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    color: var(--red);
}

.filter-title {
    font-family: 'FFFLauta', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.filter-container {
    display: flex;
    gap: 12px;
}

.filter-button {
    background-color: transparent;
    color: var(--text);
    border: 2px solid var(--red);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'FFFLauta', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.filter-button:hover {
    background-color: rgba(255, 34, 34, 0.1);
    color: var(--text-light);
    transform: translateY(-2px);
}

.filter-button.active {
    background-color: var(--red);
    color: white;
}

/* Version List Styles - IMPROVED */
.version-list {
    list-style-type: none;
    padding: 0;
}

.version-item {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
    margin-bottom: 2.5rem;
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.version-item:nth-child(1) { animation-delay: 0.1s; }
.version-item:nth-child(2) { animation-delay: 0.2s; }
.version-item:nth-child(3) { animation-delay: 0.3s; }
.version-item:nth-child(4) { animation-delay: 0.4s; }
.version-item:nth-child(5) { animation-delay: 0.5s; }
.version-item:nth-child(6) { animation-delay: 0.6s; }
.version-item:nth-child(7) { animation-delay: 0.7s; }
.version-item:nth-child(8) { animation-delay: 0.8s; }
.version-item:nth-child(9) { animation-delay: 0.9s; }

.version-link {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    color: white;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.version-link:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 34, 34, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

.version-image-container {
    flex: 0 0 320px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/10;
    background-color: rgba(0, 0, 0, 0.2);
}

.version-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.version-link:hover .version-image {
    transform: scale(1.05);
}

.version-content {
    flex: 1;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.version-info {
    flex: 1;
}

.version-tag {
    display: inline-block;
    font-family: 'FFFLauta', sans-serif;
    font-size: 0.7rem;
    padding: 6px 12px;
    border-radius: 50px;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.tag-update {
    background-color: var(--addition-bg-color);
    color: var(--addition-color);
}

.tag-patch {
    background-color: var(--bugfix-bg-color);
    color: var(--bugfix-color);
}

.version-title {
    font-family: 'FFFLauta', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.version-link:hover .version-title {
    color: var(--red);
}

.version-date {
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.version-date:before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23777' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.version-description {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.version-summary {
    display: flex;
    gap: 12px;
}

.version-additions,
.version-bugfixes {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.version-additions {
    background-color: var(--addition-color);
    color: white;
}

.version-bugfixes {
    background-color: var(--bugfix-color);
    color: white;
}

.version-additions:before,
.version-bugfixes:before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: white;
}

.version-link:hover .version-additions,
.version-link:hover .version-bugfixes {
    transform: scale(1.05);
}

/* No Results Styles */
#no-results {
    text-align: center;
    margin: 3rem auto;
    color: var(--text);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#no-results.show {
    opacity: 1;
    transform: translateY(0);
}

.no-results-icon {
    stroke: var(--text);
    margin-bottom: 1.5rem;
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(0.95); opacity: 0.7; }
    to { transform: scale(1.05); opacity: 1; }
}

#no-results p {
    font-family: 'FFFLauta', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

/* Footer Styles */
.footer {
    background: var(--dark);
    padding: 6rem 10% 4rem;
    border-top: 1px solid var(--gray);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--red) 0%, transparent 100%);
}

.footer-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 4rem;
}

.footer-column h3 {
    font-family: 'FFFLauta', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    color: white;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    position: relative;
    width: fit-content;
    padding: 0.2rem 0;
}

.footer-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background: var(--red);
    transition: width 0.3s ease;
}

.footer-link:hover, .footer-link:focus {
    color: white;
    outline: none;
    transform: translateX(3px);
}

.footer-link:hover::after, .footer-link:focus::after {
    width: 100%;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
    font-size: 0.8rem;
}

.footer-copyright {
    opacity: 0.7;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-icon-footer {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-icon-footer:hover {
    background: var(--red);
    transform: translateY(-3px);
}

.social-icon-footer svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--red-hover);
    transform: translateY(-5px);
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-result {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

/* Responsive Styles - IMPROVED */
@media (min-width: 1440px) {
    .version-image-container {
        flex: 0 0 380px; /* Larger on big screens */
    }
}

@media (max-width: 1024px) {
    .version-link {
        flex-direction: column;
    }
    
    .version-image-container {
        flex: 0 0 auto;
        width: 100%;
        aspect-ratio: 21/9; /* Wider aspect ratio for landscape on smaller screens */
    }
    
    .header-container {
        justify-content: space-between;
    }
    
    .social-icons {
        gap: 10px;
    }
    
    .social-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 768px) {
    .header {
        height: var(--header-height-scroll);
    }
    
    .logo {
        height: calc(var(--header-height-scroll) - 10px);
    }
    
    .download-button {
        display: none;
    }
    
    .social-icons {
        gap: 8px;
    }
    
    .social-icon {
        width: 18px;
        height: 18px;
    }

    .header-container {
         padding: 0 1rem;
     }
    
    .container {
        padding: 1rem;
    }
    
    .page-title h1 {
        font-size: 2.2rem;
    }
    
    .search-container {
        flex-direction: column;
        gap: 0;
    }
    
    #search-input {
        border-radius: 8px 0 0 8px !important; /* Left side rounded, right side flat */
    }
    
    .search-button {
        border-radius: 8px !important; /* Right side rounded, left side flat */
    }
    
    .filter-container {
        flex-wrap: wrap;
    }
    
    .filter-button {
        flex: 1;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .footer {
        padding: 4rem 1.5rem 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-copyright {
        order: 2;
    }
    
    .footer-social {
        order: 1;
        justify-content: center;
    }
    
    .version-image-container {
        aspect-ratio: 16/9; /* Standard aspect ratio for mobile */
    }
}

@media (max-width: 480px) {
    .right-section {
        gap: 10px;
    }
    
    .social-icons {
        gap: 6px;
    }
    
    .social-icon {
        width: 16px;
        height: 16px;
    }
    
    .version-summary {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links {
        align-items: center;
    }
}

/* Misc Styles */
img {
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

.version-item.animate {
    opacity: 1;
    transform: translateY(0);
}

#fade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--black);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 9999;
}

#fade-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
