/* Import CSS variables from containers.css */
@import url('containers.css');

/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body Styles */
body {
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center content vertically */
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto; /* Allow vertical scrolling if needed */
    position: relative;
}

/* Background Elements - REMOVED BACKGROUND DIV SINCE WE USE PARALLAX NOW */

/* Background (hidden when parallax is active) */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/Background_01.webp');
    background-size: cover;
    background-position: center;
    z-index: -4;
}

/* Runes pattern overlay */
.runes-pattern-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/runes-pattern.webp');
    background-repeat: repeat;
    background-size: 400px 400px;
    opacity: 0.2; /* Independent opacity control */
    z-index: -3;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

/* Dots pattern overlay - on top of runes */
.dots-pattern-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/dot-pattern.webp');
    background-repeat: repeat;
    background-size: 2px 2px;
    opacity: 0.3; /* Independent opacity control */
    z-index: -2;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

/* Gradient overlay - black to transparent from bottom */
.gradient-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 20%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 80%);
    z-index: -1; /* Above background and texture */
    pointer-events: none;
}

/* Main Container - Centered in viewport with fixed positioning for desktop */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    margin-bottom: 60px; /* Space for footer */
    z-index: 1;
    position: relative;
    min-height: calc(100vh - 60px); /* Full height minus footer */
    overflow: visible; /* Ensure elements aren't clipped */
}

/* Content center container for wrapping logo and servers */
.content-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    /* Fixed height to maintain positioning */
    height: 600px;
}

/* Logo Container - Fixed positioning for desktop */
.logo-container {
    width: auto;
    height: auto;
    max-width: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    margin-bottom: -250px; /* Fixed negative margin for desktop */
    position: relative;
    z-index: 10;
}

/* Logo with shadow */
.logo {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px rgb(0, 0, 0));
    filter: drop-shadow(0 0 5px rgb(0, 0, 0));
}

/* Server Options Container - Fixed positioning for desktop */
.server-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 0;
    padding-top: 0;
    width: 600px; /* Fixed width for desktop */
    position: relative;
    z-index: 5;
}

/* Server link styling */
.server-link {
    display: block;
    text-decoration: none;
    position: relative;
    color: inherit;
    transition: transform 0.3s ease;
    z-index: 5; /* Keep below toggle buttons */
}

/* Hover effect for server links */
.server-link:hover {
    transform: translateY(-5px);
}

/* Click indicator that appears on hover */
.server-link::after {
    content: "View Stats";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to right, #ff8800 0%, #ffaa33 100%);
    color: #000000;
    font-family: 'ValheimFont', Arial, sans-serif;
    font-size: 14px;
    padding: 5px 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease, bottom 0.3s ease;
    z-index: 9990 !important; /* Very high z-index to ensure it's above all other elements */
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Show indicator on hover */
.server-link:hover::after {
    opacity: 1;
    bottom: -18px;
}

/* Server containers with fixed dimensions for desktop */
.server-container {
    width: 250px; /* Fixed width */
    height: auto;
    margin-top: 80px; /* Fixed top margin */
    z-index: 5; /* Ensure it's lower than the toggle buttons */
    pointer-events: auto; /* Ensure it captures clicks */
    position: relative;
}

/* Fixed dimensions for banner container */
.banner-container {
    width: 240px;
    height: 150px;
    margin: 5px;
    border-radius: 10px;
    overflow: visible;
    z-index: 3;
}

/* Server banner styling */
.server-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    border-radius: 10px;
}

/* Fixed dimensions for status container */
.server-status {
    width: 240px;
    height: auto;
    min-height: 81px;
}

/* Background switch feature */
.background.alternate {
    background-image: url('../assets/images/Background_02.webp');
}

/* Only apply responsive adjustments for mobile devices */
@media (max-width: 768px) {
    .content-center {
        height: auto; /* Remove fixed height for mobile */
    }
    
    .logo-container {
        max-width: 300px;
        margin-bottom: 0px; /* Remove negative margin on mobile */
    }
    
    .server-container {
        margin-top: 50px;
    }
    
    .server-options {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%; /* Full width on mobile */
    }
    
    .main-container {
        justify-content: flex-start;
        padding-top: 50px;
    }
    
    .content-center {
        margin-top: auto;
        margin-bottom: auto;
    }
    
    /* Adjust spacing for the server link hover text on mobile */
    .server-link::after {
        bottom: -18px;
    }
    
    .server-link:hover::after {
        bottom: -25px;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    .logo-container {
        max-width: 250px;
        margin-bottom: -30px;
    }
    
    .server-container {
        margin-top: 40px;
        width: 220px;
    }
    
    .banner-container,
    .server-status {
        width: 210px;
    }
}

/* Enhanced Discord button styling with always-on border animation */

.discord-button-container {
    width: 100%;
    max-width: 400px;
    margin: 40px auto 20px auto;
    position: relative;
    z-index: 10;
}

.discord-button {
    display: block;
    width: 100%;
    position: relative;
    text-decoration: none;
    color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.discord-button:hover {
    transform: translateY(-3px);
}

.discord-button-inner {
    background: linear-gradient(to bottom, #010101, #414141);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px 5px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
}

/* New hover effect for the inner button */
.discord-button:hover .discord-button-inner {
    box-shadow: 0 0 20px 8px rgba(255, 136, 0, 0.3);
}

/* Apply the same stroke styles as the containers - NOW ALWAYS ANIMATED */
.discord-button-inner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: linear-gradient(90deg, #414141, #ff8800, #414141) border-box;
    background-size: 300% 100%;
    -webkit-mask: 
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 1;
    pointer-events: none;
    transition: all 0.3s ease;
    /* Always animated instead of only on hover */
    animation: borderGradient 6s ease infinite;
}

@keyframes borderGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.discord-button-inner::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/images/runes-pattern.webp');
    background-size: 300px 300px;
    background-repeat: repeat;
    background-position: 0 0;
    opacity: 0.05;
    filter: invert(1);
    z-index: 0;
    pointer-events: none;
    border-radius: 10px;
}

.discord-icon {
    margin-right: 15px;
    position: relative;
    z-index: 2;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.discord-button:hover .discord-icon {
    transform: scale(1.1) rotate(-5deg);
}

.discord-logo {
    height: 30px;
    width: auto;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
}

.discord-text {
    font-family: 'ValheimFont', Arial, sans-serif;
    font-size: 22px;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.discord-button:hover .discord-text {
    color: #ff8800;
    text-shadow: 0 0 10px rgba(255, 136, 0, 0.5);
}

/* Add the underline animation */
.discord-text::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #ff8800;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.4s ease;
    box-shadow: 0 0 8px 2px rgba(255, 136, 0, 0.5);
}

.discord-button:hover .discord-text::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .discord-button-container {
        max-width: 300px;
        margin: 30px auto 20px auto;
    }
    
    .discord-text {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .discord-button-container {
        max-width: 250px;
        margin: 20px auto 15px auto;
    }
    
    .discord-text {
        font-size: 16px;
    }
    
    .discord-icon {
        margin-right: 10px;
    }
    
    .discord-logo {
        height: 24px;
    }
}
/* Server status styling */

/* Online status color (already existed) */
.online {
    color: #0f0;
}

/* Offline status color */
.offline {
    color: #ff3333;
}

/* Offline server container styling */
.server-container.server-offline {
    opacity: 0.85;
    filter: grayscale(30%);
}

/* Disable hover effect for offline servers */
.server-link:hover .server-container.server-offline {
    transform: none;
}

/* Loading animation for initial fetch */
.loading-status {
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Error indicator */
.status-error {
    position: relative;
}

.status-error::after {
    content: "!";
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    background-color: #ff3333;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Make sure nothing inside the server container blocks the toggles */
.server-container * {
    pointer-events: auto; /* All children should capture their own clicks */
}

/* Ensure toggle buttons are truly above everything else */
.extension-toggle {
    position: absolute !important;
    z-index: 9999 !important; /* Force high z-index */
}

/* Prevent runes pattern overlay from capturing clicks */
.runes-overlay {
    pointer-events: none !important;
}

/* Fix for standalone toggle buttons (new approach) */
.standalone-toggle {
    z-index: 9999 !important;
    position: fixed !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}