/* Servers Section */
.servers-section {
    min-height: 100vh;
    background: linear-gradient(180deg, #1a1a1a 0%, #1a1a1a 10%, #242424 100%);
    position: relative;
    padding: 4rem 4rem;
    padding-bottom: calc(200px + 4rem); /* Account for the slant height plus padding */
}

.servers-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: #242424;
    clip-path: polygon(0 100%, 100% 30%, 100% 100%);
    z-index: 0; /* Changed from 1 to 0 */
}

.servers-container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 6rem;
    align-items: start;
    position: relative;
    z-index: 1; /* Added to ensure content stays above the slant */
}

.servers-info {
    position: relative;
    z-index: 1;
}

.servers-info::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 140%;
    background: radial-gradient(circle at left, 
        rgba(255,255,255,0.1) 0%,
        rgba(255,255,255,0.05) 35%,
        transparent 70%
    );
    filter: blur(40px);
    z-index: -1;
    pointer-events: none
}

.servers-info h2,
.servers-description {
    position: relative;
}

.servers-info h2 {
    font-family: 'Teko', sans-serif;
    font-size: 5.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    letter-spacing: 2px;
    line-height: 1;
    max-width: 800px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

/* Style for the heading spans */
.servers-info h2 .heading-first,
.servers-info h2 .heading-second {
    position: relative;
    display: inline-block;
}

/* First triangle positioned relative to the first span */
.servers-info h2 .heading-first::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -15px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 12px 0 0;
    border-color: var(--text-color) transparent transparent transparent;
    opacity: 0.8;
}

/* Second triangle positioned relative to the second span */
.servers-info h2 .heading-second::after {
    content: '';
    position: absolute;
    bottom: 0px;
    right: -12px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 12px 12px;
    border-color: transparent transparent var(--text-color) transparent;
    opacity: 0.8;
}

/* Remove the original triangles */
.servers-info h2::before,
.servers-info h2::after {
    display: none;
}

.servers-description {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 3rem;
    max-width: 800px;
    line-height: 1.6;
}

.server-stats {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-value {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.stat-label {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.servers-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
    position: relative;
}

.server-card {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: minmax(300px, 2fr) auto auto;
    align-items: center;
    gap: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(var(--accent-color-rgb), 0.1) 0%,
        rgba(var(--accent-color-rgb), 0) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.server-card:hover {
    transform: translateX(4px);
    border-color: rgba(var(--accent-color-rgb), 0.3);
}

.server-card:hover::before {
    opacity: 1;
}

.server-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    min-width: 0;
}

.server-header {
    display: flex;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.server-header::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 200%;
    background: radial-gradient(circle at left,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 35%,
        transparent 70%
    );
    filter: blur(20px);
    z-index: -1;
    pointer-events: none;
    transition: background 0.3s ease;
}

.server-header h3 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.25rem;
    color: var(--text-color);
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
    flex: 1;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.server-status-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.server-region {
    background: rgba(var(--accent-color-rgb), 0.2);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    border: 1px solid rgba(var(--accent-color-rgb), 0.3);
    white-space: nowrap;
}

.server-gamemode {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    min-width: 0;
}

.gamemode-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    transition: all 0.3s ease;
    width: fit-content;
    color: var(--accent-color);
    position: relative;
    font-weight: 600;
}

.gamemode-name {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1rem;
    color: var(--accent-color);
    letter-spacing: 0.5px;
}

.gamemode-link i {
    font-size: 0.7rem;
    margin-left: 2px;
}

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

.gamemode-link:hover {
    opacity: 0.8;
}

.gamemode-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.player-count {
    color: var(--text-color);
    font-size: 0.875rem;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 500;
}

.server-status-container.is-full .player-count {
    color: #ff6b00;
    font-weight: 600;
}

.reserve-slot {
    display: none;
    color: #ff6b00;
    font-size: 0.875rem;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.9;
    padding-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    width: 100%;
}

.reserve-slot.show {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reserve-slot i {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    color: #ff6b00;
}

.reserve-slot:hover {
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 107, 0, 0.3);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0; /* Prevent the dot from being stretched */
}

.status-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
}

.status-indicator.online {
    background-color: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.status-indicator.online::after {
    background-color: rgba(76, 175, 80, 0.4);
}

.status-indicator.offline {
    background-color: #f44336;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.5);
}

.status-indicator.offline::after {
    animation: none;
}

.connect-btn {
    background: rgba(var(--accent-color-rgb), 0.2);
    color: var(--accent-color);
    border: 1px solid rgba(var(--accent-color-rgb), 0.3);
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    min-width: 120px; /* Fixed width for connect button */
    text-align: center;
}

.connect-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(var(--accent-color-rgb), 0) 0%,
        rgba(var(--accent-color-rgb), 0.2) 50%,
        rgba(var(--accent-color-rgb), 0) 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.connect-btn:hover {
    background: rgba(var(--accent-color-rgb), 0.3);
    border-color: rgba(var(--accent-color-rgb), 0.5);
}

.connect-btn:hover::before {
    transform: translateX(100%);
}

.connect-btn.mobile-only {
    display: none;
    padding: 0.5rem 1rem;
    min-width: 90px;
    font-size: 0.875rem;
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    opacity: 0.7;
    cursor: default;
}

.connect-btn.mobile-only:hover {
    background: transparent;
    border: none;
}

.connect-btn.mobile-only::before {
    display: none;
}

.connect-btn.desktop-only {
    display: block;
}

.server-status-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    min-width: 180px;
}

[data-theme="light"] .servers-section {
    background: linear-gradient(180deg, var(--background-color) 0%, var(--background-color) 10%, #e8e8e8 100%);
}

[data-theme="light"] .servers-list {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .servers-section::after {
    background: #e8e8e8;
    clip-path: polygon(0 100%, 100% 30%, 100% 100%);
}

[data-theme="light"] .servers-info::before {
    background: radial-gradient(circle at left,
        rgba(200,200,200,0.3) 0%,
        rgba(200,200,200,0.15) 35%,
        transparent 70%
    );
}

[data-theme="light"] .server-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .server-status {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .server-header::before {
    background: radial-gradient(circle at left,
        rgba(200, 200, 200, 0.2) 0%,
        rgba(200, 200, 200, 0.1) 35%,
        transparent 70%
    );
}

[data-theme="light"] .server-status-container.is-full + .server-header::before,
[data-theme="light"] .server-status-container.is-full ~ .server-info .server-header::before {
    background: radial-gradient(circle at left,
        rgba(255, 107, 0, 0.2) 0%,
        rgba(255, 107, 0, 0.1) 35%,
        transparent 70%
    );
}

.server-card:has(.server-status-container.is-full) .server-header::before {
    background: radial-gradient(circle at left,
        rgba(255, 107, 0, 0.15) 0%,
        rgba(255, 107, 0, 0.05) 35%,
        transparent 70%
    );
}

.server-card.is-offline {
    border-color: rgba(244, 67, 54, 0.2);
}

.server-card.is-offline::before {
    background: linear-gradient(90deg, 
        rgba(244, 67, 54, 0.1) 0%,
        rgba(244, 67, 54, 0) 100%
    );
}

.server-card.is-offline .server-header::before {
    background: radial-gradient(circle at left,
        rgba(244, 67, 54, 0.15) 0%,
        rgba(244, 67, 54, 0.05) 35%,
        transparent 70%
    );
}

.server-card.is-offline .player-count {
    color: #f44336;
    font-weight: 600;
}

.server-card.is-offline .connect-btn {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
    opacity: 0.8;
    cursor: not-allowed;
}

.server-card.is-offline .connect-btn:hover {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.2);
}

.server-card.is-offline .connect-btn::before {
    display: none;
}

.server-card.is-offline .connect-btn.mobile-only {
    color: #f44336;
    opacity: 0.8;
}

[data-theme="light"] .server-card.is-offline {
    border-color: rgba(244, 67, 54, 0.3);
}

[data-theme="light"] .server-card.is-offline .server-header::before {
    background: radial-gradient(circle at left,
        rgba(244, 67, 54, 0.2) 0%,
        rgba(244, 67, 54, 0.1) 35%,
        transparent 70%
    );
}

.server-card:has(.server-status-container.is-full) {
    border-color: rgba(255, 107, 0, 0.2);
}

.server-card:has(.server-status-container.is-full)::before {
    background: linear-gradient(90deg, 
        rgba(255, 107, 0, 0.1) 0%,
        rgba(255, 107, 0, 0) 100%
    );
}

.server-card:has(.server-status-container.is-full) .connect-btn {
    background: rgba(255, 107, 0, 0.1);
    border-color: rgba(255, 107, 0, 0.2);
    color: #ff6b00;
    opacity: 0.8;
    cursor: not-allowed;
}

.server-card:has(.server-status-container.is-full) .connect-btn:hover {
    background: rgba(255, 107, 0, 0.1);
    border-color: rgba(255, 107, 0, 0.2);
}

.server-card:has(.server-status-container.is-full) .connect-btn::before {
    display: none;
}

.server-card:has(.server-status-container.is-full) .connect-btn.mobile-only {
    color: #ff6b00;
    opacity: 0.8;
}

[data-theme="light"] .server-card:has(.server-status-container.is-full) {
    border-color: rgba(255, 107, 0, 0.3);
}

[data-theme="light"] .gamemode-link,
[data-theme="light"] .gamemode-link:hover,
[data-theme="light"] .gamemode-link:visited,
[data-theme="light"] .gamemode-link:active {
    color: var(--accent-color);
}

[data-theme="light"] .gamemode-name {
    color: var(--accent-color);
}

[data-theme="light"] .gamemode-link::after {
    background-color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .servers-section {
        padding: 4rem 3rem;
        padding-bottom: calc(200px + 3rem);
    }

    .server-card {
        grid-template-columns: minmax(250px, 2fr) auto auto;
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .servers-section {
        padding: 4rem 2rem;
        padding-bottom: calc(200px + 2rem);
    }

    .servers-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .servers-info {
        text-align: center;
    }

    .servers-info h2,
    .servers-description {
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
    }

    .server-stats {
        flex-direction: row;
        justify-content: center;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .servers-section {
        padding: 3rem 1.5rem;
        padding-bottom: calc(150px + 2rem);
    }

    .servers-section::after {
        height: 150px;
    }

    .servers-info h2 {
        font-size: 4rem;
        text-align: center; /* Ensure heading stays centered */
    }

    .servers-description {
        font-size: 1.1rem;
        margin-bottom: 2.5rem;
        text-align: center; /* Ensure description stays centered */
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .server-card {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .server-status-container {
        width: 100%;
    }

    .server-status {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.5rem 0.75rem;
        width: 100%;
    }

    .server-status-info {
        gap: 0.5rem;
    }

    .connect-btn.mobile-only {
        display: block;
        padding: 0.5rem 0;
        min-width: 120px;
        text-align: right;
    }

    .connect-btn.desktop-only {
        display: none;
    }

    .reserve-slot {
        padding-left: 1rem;
    }

    .gamemode-name {
        font-size: 0.9rem;
    }
    
    .gamemode-link {
        font-size: 0.9rem;
    }
    
    .gamemode-link i {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .servers-section {
        padding: 2rem 1rem;
        padding-bottom: calc(100px + 2rem);
    }

    .servers-section::after {
        height: 100px;
    }

    .servers-info h2 {
        font-size: 3.5rem;
        /* Allow heading to wrap naturally but keep it centered */
        display: block;
        text-align: center; /* Change from left to center */
    }

    /* Ensure spans display properly on small screens */
    .servers-info h2 .heading-first,
    .servers-info h2 .heading-second {
        display: inline-block;
    }

    /* No need to adjust triangle positions as they're now tied to their respective spans */

    .servers-description {
        font-size: 1rem;
        margin-bottom: 2rem;
        text-align: center; /* Ensure description stays centered too */
    }

    .server-stats {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center; /* Center the stats vertically */
    }

    .stat-item {
        align-items: center; /* Center the stat items */
        text-align: center; /* Center the text within stat items */
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .server-card {
        gap: 0.75rem;
    }

    .server-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .server-header h3 {
        font-size: 1.1rem;
    }

    .connect-btn {
        min-width: 90px;
        font-size: 0.875rem;
    }

    .server-status {
        padding: 0.5rem 0.75rem;
    }

    .gamemode-name {
        font-size: 0.85rem;
    }
    
    .gamemode-link {
        font-size: 0.85rem;
    }
    
    .gamemode-link i {
        font-size: 0.65rem;
    }
} 