@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;700&display=swap');

/* General Body Styles */
body {
    font-family: 'Rajdhani', sans-serif;
    margin: 0;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
    direction: ltr; /* Default direction */
    --grid-color: rgba(128, 128, 128, 0.2);
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 30px 30px;
}

body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%; /* Reduced height for a more subtle effect */
    background: linear-gradient(to top, rgba(139, 0, 0, 0.5) 0%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

body.rtl {
    direction: rtl;
}

#background-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.dot {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: blink 4s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Main Content */
main {
    min-height: 100vh;
    position: relative;
    z-index: 1; /* Ensure main content is above background */
    padding-top: 80px;
}

/* Header and Navigation */
header {
    width: 100%;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo a {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #8B0000;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger .line {
    width: 25px;
    height: 3px;
    background-color: #fff;
    transition: all 0.3s ease;
}

@keyframes glowing-border {
    0% { border-color: #8B0000; box-shadow: 0 0 5px #8B0000; }
    50% { border-color: #b82e2e; box-shadow: 0 0 15px #b82e2e; }
    100% { border-color: #8B0000; box-shadow: 0 0 5px #8B0000; }
}

/* Language Switcher */
.language-switcher {
    position: relative;
    width: 70px;
    height: 30px;
}

#lang-toggle {
    display: none;
}

.lang-toggle-label {
    display: block;
    width: 100%;
    height: 100%;
    background: rgba(139, 0, 0, 0.2);
    border-radius: 15px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}

.lang-toggle-label::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background-image: linear-gradient(135deg, #e02d2d, #7b1fa2);
    border-radius: 15px;
    top: 0;
    left: 0;
    transition: transform 0.3s ease;
    box-shadow: 0 0 10px rgba(224, 45, 45, 0.5);
}

#lang-toggle:checked + .lang-toggle-label::after {
    transform: translateX(40px);
}

.lang-en, .lang-fa {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    font-size: 0.9rem;
}

.lang-en {
    left: 10px;
    color: #fff;
}

.lang-fa {
    right: 10px;
    color: #aaa;
}

#lang-toggle:checked + .lang-toggle-label .lang-en {
    color: #aaa;
}

#lang-toggle:checked + .lang-toggle-label .lang-fa {
    color: #fff;
}

section {
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

#home h1 {
    font-size: 2.5rem;
    margin: 0;
    color: #fff;
    text-shadow: none;
}

.brand-name {
    font-size: 5rem;
    font-weight: bold;
    color: #8B0000;
    margin: 0 0 2rem 0;
    text-shadow: 0 0 15px rgba(139, 0, 0, 0.7);
    position: relative;
}

.brand-name::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 5s infinite linear;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

@keyframes shine {
    from { left: -150%; }
    to { left: 150%; }
}

.brand-name .grey {
    color: #808080;
}

.brand-name .grey {
    color: #808080;
}

.server-info-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ip-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #8B0000;
    border-radius: 8px;
    padding: 5px;
}

.ip-container input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    padding: 0 1rem;
    text-align: center;
    outline: none;
}

.copy-btn {
    padding: 0.7rem 1.5rem;
    border: 1px solid #8B0000;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    position: relative;
    overflow: hidden;
    animation: glowing-border 4s infinite;
}

.copy-btn:hover {
    background-color: rgba(139, 0, 0, 0.3);
    transform: translateY(-2px);
}

.copy-btn .copy-text {
    transition: opacity 0.3s;
}

.copy-btn .copied-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s, transform 0.3s;
}

.copy-btn.copied .copy-text {
    opacity: 0;
}

.copy-btn.copied .copied-text {
    opacity: 1;
    transform: translateY(0);
}

.discord-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    color: #fff;
    text-decoration: none;
    border: 1px solid #8B0000;
    border-radius: 8px;
    font-size: 1.2rem;
    margin-top: 1rem;
    transition: background-color 0.3s, color 0.3s, transform 0.3s;
    animation: glowing-border 4s infinite;
}

.discord-btn:hover {
    background-color: rgba(139, 0, 0, 0.3);
    transform: translateY(-2px);
}

.player-count {
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    position: relative;
    border: 1px solid #8B0000;
}

.player-count::before {
    content: attr(data-title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 0.5rem;
    border-radius: 5px;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.player-count:hover::before {
    opacity: 1;
    visibility: visible;
}

#player-count-value {
    font-weight: bold;
    color: #fff;
    transition: color 0.3s, text-shadow 0.3s;
}

#player-count-value.up, #player-count-value.down {
    color: #fff;
    text-shadow: 0 0 10px #fff;
    animation: flash-white 0.5s ease-out;
}

@keyframes flash-white {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}


/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    background-color: rgba(10, 10, 10, 0.5); /* Transparent gray */
    backdrop-filter: blur(10px);
    width: 100%;
    border-top: 1px solid rgba(139, 0, 0, 0.3);
}

@keyframes page-fade-in {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Page visibility */
.page {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.page.active {
    display: flex;
    animation: page-fade-in 0.5s ease-out forwards;
}


/* Launcher Page */
#launcher {
    text-align: center;
}

#launcher h2 {
    font-size: 3rem;
    color: #8B0000;
    text-shadow: 0 0 15px rgba(139, 0, 0, 0.7);
}

#launcher p {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 2rem;
    color: #ccc;
}

.download-buttons a {
    display: inline-block;
    padding: 1rem 2rem;
    margin: 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    color: #fff;
    text-decoration: none;
    border: 1px solid #8B0000;
    border-radius: 8px;
    font-size: 1.2rem;
    transition: background-color 0.3s, transform 0.3s;
    animation: glowing-border 4s infinite;
}

.download-buttons a:hover {
    background-color: rgba(139, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Info Page */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
}

.info-card {
    background: transparent; /* The content div will have the background */
    border-radius: 8px;
    padding: 1px; /* To house the border created by the laser */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: none;
    transition: transform 0.3s;
    position: relative;
    overflow: hidden;
}

.info-card-content {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    padding: 2rem;
    width: 100%;
    height: 100%;
    border-radius: 7px; /* Slightly smaller than parent to show laser */
    position: relative;
    z-index: 1;
}

.info-card:hover {
    transform: scale(1.05);
}

.info-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent,
        rgba(139, 0, 0, 0.1),
        #8B0000
    );
    animation: rotate-laser 4s linear infinite;
}

@keyframes rotate-laser {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.info-card .avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #8B0000;
    margin-bottom: 1.5rem;
    animation: glowing-border 4s infinite;
}

.info-card .name {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
    color: #fff;
    text-shadow: none;
}

.info-card .role {
    font-size: 1rem;
    font-weight: bold;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    margin: 0.5rem 0 1rem 0;
    color: #fff;
    background-color: #8B0000;
}

.info-card .bio {
    font-size: 1rem;
    color: #ccc;
}

#notification-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.notification {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-20px);
    animation: notification-fade-in-out 4s ease-in-out forwards;
}

.notification.success {
    background-color: #28a745;
    border: 1px solid #208a38;
}

@keyframes notification-fade-in-out {
    0% { opacity: 0; transform: translateY(-20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.error-message {
    color: #ff4d4d;
    background-color: rgba(255, 77, 77, 0.1);
    border: 1px solid #ff4d4d;
    border-radius: 5px;
    padding: 0.75rem;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 65px;
        left: 0;
        right: 0;
        background-color: rgba(0, 0, 0, 0.9);
        flex-direction: column;
        align-items: center;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
    }

    .nav-links.active {
        max-height: 300px; /* Adjust as needed */
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: 1.5rem;
        width: 100%;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .hamburger.active .line:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .brand-name {
        font-size: 3rem;
    }
    #home h1 {
        font-size: 2rem;
    }
    .server-info-container {
        flex-direction: column;
    }
    .discord-btn {
        width: 80%;
    }
}