@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;700&family=Share+Tech+Mono&display=swap');
:root {
    --bg-color: #0A0F1A;
    --text-color: #E2E2E2;
    --accent-color-1: #00A9FF; /* Blue */
    --accent-color-2: #F000FF; /* Purple */
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(255, 255, 255, 0.05);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Rajdhani', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Starfield Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px) 0 0 / 20px 20px;
    animation: animate-starfield 30s linear infinite;
    z-index: -1;
    opacity: 0.5;
}

@keyframes animate-starfield {
    from { background-position: 0 0; }
    to { background-position: -100px -100px; }
}

/* Main Layout */
.temporal-frame {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Left Side Panel */
.temporal-panel {
    width: 250px;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    z-index: 10;
}

.temporal-panel::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to top, var(--accent-color-1), transparent);
    animation: glow-bar 5s linear infinite;
}

@keyframes glow-bar {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

.temporal-logo h1 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-color-1);
    text-shadow: 0 0 5px var(--accent-color-1);
}

/* Redesigned Search Bar */
.search-field {
    position: relative;
    background: linear-gradient(45deg, var(--accent-color-1), var(--accent-color-2));
    padding: 1px; /* The "border" */
    border-radius: 8px;
    transition: all 0.4s ease-in-out;
}

.search-field:focus-within {
    box-shadow: 0 0 15px var(--accent-color-1), 0 0 25px var(--accent-color-2);
    transform: scale(1.05);
}

.search-field-inner {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 7px;
    display: flex;
    align-items: center;
}

.search-field input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    padding-left: 0.5rem;
}

.search-field input:focus {
    outline: none;
}

.search-field input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-icon {
    color: var(--accent-color-1);
    width: 20px;
    height: 20px;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-left: 2px solid transparent;
    transition: all 0.3s;
}

.category-nav a:hover {
    color: var(--accent-color-1);
    border-left: 2px solid var(--accent-color-1);
    transform: translateX(5px);
}

/* Main Content Area */
.drift-space {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.drift-space h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-color-2);
    margin-bottom: 2rem;
    text-shadow: 0 0 5px var(--accent-color-2);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.drift-card {
    position: relative;
    transform: skew(-5deg);
    transition: transform 0.4s ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.drift-card:hover {
    transform: skew(-5deg) scale(1.05);
}

.drift-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-inner {
    transform: skew(5deg);
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: box-shadow 0.4s ease-in-out;
    position: relative;
    z-index: 1;
}

.drift-card:hover .card-inner {
    box-shadow: 0 0 10px var(--accent-color-1), 0 0 20px var(--accent-color-2);
}

.card-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-in-out;
}

.drift-card:hover .card-image {
    transform: scale(1.1);
}

.card-content {
    padding: 1.5rem;
    text-align: center;
}

.card-content h3 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    text-transform: uppercase;
    margin: 0 0 0.5rem;
    color: var(--accent-color-1);
    text-shadow: 0 0 3px var(--accent-color-1);
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.4;
}

/* Footer */
.temporal-footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}
.footer-description {
    margin-bottom: 2rem;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 255, 255, 0.8);
}
.temporal-footer p, .temporal-footer a {
    font-size: 0.8rem;
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.temporal-footer a:hover {
    opacity: 1;
    color: var(--accent-color-1);
}
.footer-links {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Go-to-top button styles */
.top-button {
    display: none; /* Initially hidden */
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border: 2px solid var(--accent-color-1);
    background: rgba(0, 0, 0, 0.4);
    color: var(--accent-color-1);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.4s ease-in-out;
    box-shadow: 0 0 5px var(--accent-color-1);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
}

.top-button.show {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

.top-button:hover {
    box-shadow: 0 0 10px var(--accent-color-1), 0 0 20px var(--accent-color-2);
    transform: scale(1.1);
}

/* Mobile Search */
.mobile-search-toggle {
    display: none;
}
.mobile-search-container {
    position: fixed;
    top: -200px;
    left: 0;
    width: 100%;
    background-color: rgba(10, 15, 26, 0.95);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 9999;
    transition: top 0.4s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-search-container.open {
    top: 82px;
}

/* Centered and styled search field for mobile */
.mobile-search-field {
    position: relative;
    background: linear-gradient(45deg, var(--accent-color-1), var(--accent-color-2));
    padding: 1px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    transition: all 0.4s ease-in-out;
    margin: 0 auto; /* Center the search box itself */
}

.mobile-search-field:focus-within {
    box-shadow: 0 0 15px var(--accent-color-1), 0 0 25px var(--accent-color-2);
    transform: scale(1.02);
}

.mobile-search-field-inner {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 7px;
    display: flex;
    align-items: center;
}

.mobile-search-field-inner input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    padding-left: 0.5rem;
}

.mobile-search-field-inner input:focus {
    outline: none;
}
.mobile-search-field-inner input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}


/* Media Queries for Mobile Adaptation */
@media (max-width: 768px) {
    body {
        overflow-y: auto; /* Allow body to scroll on mobile */
    }

    .temporal-frame {
        flex-direction: column; /* Stack panels vertically */
        height: auto;
        min-height: 100vh;
    }

    .temporal-panel {
        width: auto;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .temporal-panel::after {
        display: none; /* Hide animated border on mobile */
    }

    .temporal-logo h1 {
        font-size: 1.2rem;
    }

    .search-field {
        display: none; /* Hide desktop search field on mobile */
    }

    .mobile-search-toggle {
        display: block;
        color: var(--accent-color-1);
        cursor: pointer;
        transition: transform 0.3s ease-in-out;
        z-index: 10000; /* Highest z-index to be clickable */
    }
    .mobile-search-toggle:hover {
        transform: scale(1.1);
    }

    .category-nav {
        flex-direction: row; /* Horizontal navigation on mobile */
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .category-nav a {
        white-space: nowrap;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .category-nav a:hover {
        transform: none;
        border-bottom: 2px solid var(--accent-color-1);
    }

    .drift-space {
        padding: 1rem;
        text-align: center;
    }

    .drift-space h2 {
        font-size: 1.8rem;
        margin-top: 2rem;
    }

    .game-grid {
        grid-template-columns: 1fr; /* Single column layout for cards */
        gap: 1.5rem;
    }

    .drift-card {
        transform: skew(0); /* No skew on mobile for better readability */
    }
    .card-inner {
        transform: skew(0);
    }

    .drift-card:hover {
        transform: scale(1.05);
    }

    .temporal-footer {
        margin-top: 1rem;
    }

    .top-button {
        bottom: 5rem;
        right: 1rem;
    }
}
a {
    text-decoration: none;
}