/* ===== Variables CSS - Thème Pixel Art ===== */
:root {
    --primary-color: #5c9e31;
    --secondary-color: #8b5a2b;
    --accent-color: #ffcc00;
    --success-color: #00ff00;
    --warning-color: #ffaa00;
    --danger-color: #ff3333;
    --bg-dark: #1a1a2e;
    --bg-darker: #0f0f1a;
    --bg-card: #252540;
    --bg-table: #1e1e32;
    --text-primary: #ffffff;
    --text-secondary: #aaaacc;
    --text-green: #55ff55;
    --border-color: #3a3a5a;
    --pixel-shadow: 4px 4px 0px #000000;
    --pixel-shadow-sm: 2px 2px 0px #000000;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: 'VT323', monospace;
    background-color: var(--bg-darker);
    color: var(--text-primary);
    min-height: 100%;
    overflow-x: hidden;
    font-size: 18px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ===== Pixel Background ===== */
.pixel-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: 
        linear-gradient(180deg, 
            var(--bg-darker) 0%, 
            #1a1a2e 50%, 
            #0d1f0d 100%
        );
}

.pixel-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        );
}

/* ===== Scanlines Effect ===== */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    opacity: 0.3;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--bg-darker);
    border-bottom: 4px solid var(--primary-color);
    box-shadow: 0 4px 0 #000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    position: relative;
}

.logo h1 .letter {
    display: inline-block;
    animation: colorCycleGreen 6s linear infinite;
    text-shadow: 
        2px 2px 0 rgba(0, 0, 0, 0.5),
        0 0 10px currentColor;
    transition: transform 0.2s ease;
}

.logo h1 .letter:hover {
    transform: scale(1.3) rotate(-5deg);
    animation: retroBounce 0.5s ease infinite;
}

.logo .tld {
    color: var(--accent-color);
    text-shadow: 
        2px 2px 0 rgba(0, 0, 0, 0.5),
        0 0 15px var(--accent-color);
    animation: tldPulse 2s ease-in-out infinite;
    margin-left: 4px;
}

/* Cycle de couleurs vertes flat rétro */
@keyframes colorCycleGreen {
    0% {
        color: #55ff55;  /* Vert néon */
    }
    20% {
        color: #5c9e31;  /* Vert primary */
    }
    40% {
        color: #00ff00;  /* Vert success */
    }
    60% {
        color: #06ffa5;  /* Vert menthe */
    }
    80% {
        color: #7cfc00;  /* Vert chartreuse */
    }
    100% {
        color: #55ff55;  /* Retour au vert néon */
    }
}

/* Animation de rebond rétro */
@keyframes retroBounce {
    0%, 100% {
        transform: scale(1.3) translateY(0) rotate(-5deg);
    }
    50% {
        transform: scale(1.4) translateY(-5px) rotate(-5deg);
    }
}

/* Pulse pour le TLD */
@keyframes tldPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Effet de fond flat rétro pour le header */
header {
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 107, 157, 0.1), 
        rgba(6, 255, 165, 0.1), 
        transparent);
    animation: retroScan 4s linear infinite;
}

@keyframes retroScan {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    font-family: 'Press Start 2P', cursive;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.6rem;
    padding: 8px 12px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

nav a:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(255, 204, 0, 0.1);
}

/* ===== Hero Section ===== */
.hero {
    padding: 120px 0 30px;
    text-align: center;}

.pixel-title h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    color: var(--text-green);
    text-shadow: var(--pixel-shadow);
    margin-bottom: 20px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: var(--pixel-shadow), 0 0 10px var(--primary-color); }
    to { text-shadow: var(--pixel-shadow), 0 0 20px var(--primary-color), 0 0 30px var(--primary-color); }
}

.subtitle {
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.stats-overview {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 35px;
    background: var(--bg-card);
    border: 4px solid var(--border-color);
    box-shadow: var(--pixel-shadow);
    min-width: 150px;
}

.stat-box:hover {
    border-color: var(--primary-color);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #000000;
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.stat-number {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    color: var(--accent-color);
    text-shadow: var(--pixel-shadow-sm);
}

.stat-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: var(--text-secondary);
    margin-top: 8px;
    letter-spacing: 1px;
}

/* ===== Section Titles ===== */
.section-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
    text-shadow: var(--pixel-shadow-sm);
}

.bracket {
    color: var(--primary-color);
}

/* ===== Filter Buttons ===== */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: 'Press Start 2P', cursive;
    padding: 10px 15px;
    border: 3px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.5rem;
    cursor: pointer;
    box-shadow: var(--pixel-shadow-sm);
    transition: all 0.1s ease;
}

.filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: #7cc04a;
    color: #000;
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* ===== Servers Section ===== */
.servers-section {
    padding: 20px 0 60px;
}

/* Loading Bar */
.loading-container {
    text-align: center;
    padding: 60px 20px;
}

.loading-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

.loading-bar {
    width: 300px;
    max-width: 100%;
    height: 24px;
    background: var(--bg-darker);
    border: 4px solid var(--border-color);
    box-shadow: var(--pixel-shadow);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    width: 30%;
    background: var(--primary-color);
    box-shadow: inset -4px 0 0 rgba(0,0,0,0.3);
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(250%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.servers-table-wrapper {
    overflow-x: auto;
    border: 4px solid var(--border-color);
    box-shadow: var(--pixel-shadow);
    background: var(--bg-table);
}

.server-request-info {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 20px;
}

.server-request-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.server-request-info a:hover {
    text-decoration: underline;
}

.servers-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
}

.servers-table thead {
    background: var(--bg-card);
    border-bottom: 4px solid var(--primary-color);
}

.servers-table th {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    padding: 15px 12px;
    text-align: left;
    color: var(--accent-color);
    text-shadow: var(--pixel-shadow-sm);
    white-space: nowrap;
}

.servers-table tbody tr {
    border-bottom: 2px solid var(--border-color);
    transition: all 0.1s ease;
}

.servers-table tbody tr:hover {
    background: rgba(92, 158, 49, 0.1);
}

.servers-table tbody tr.offline {
    opacity: 0.6;
}

.servers-table td {
    padding: 22px 15px;
    vertical-align: middle;
    height: 80px;
}

/* Status cell */
.status-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border: 2px solid #000;
}

.status-indicator.online {
    background: var(--success-color);
    animation: blink 1s ease-in-out infinite;
}

.status-indicator.offline {
    background: var(--danger-color);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
}

.status-text.online {
    color: var(--success-color);
}

.status-text.offline {
    color: var(--danger-color);
}

/* Server name */
.server-name {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 1.2rem;
}

/* Game cell */
.game-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-icon {
    font-size: 1.3rem;
}

.game-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
}

.game-info {
    display: flex;
    flex-direction: column;
}

.game-name {
    color: var(--text-primary);
}

.game-version {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Players cell */
.players-cell {
    text-align: center;
}

.players-count {
    display: block;
    color: var(--accent-color);
    font-size: 1.2rem;
}

.players-bar {
    width: 80px;
    height: 8px;
    background: var(--border-color);
    border: 2px solid #000;
    margin-top: 5px;
}

.players-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.players-fill.high {
    background: var(--danger-color);
}

.players-fill.medium {
    background: var(--warning-color);
}

/* Address cell */
.address-cell {
    font-family: 'VT323', monospace;
    color: var(--text-green);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Copy button */
.copy-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.45rem;
    padding: 8px 12px;
    background: var(--primary-color);
    border: 3px solid #7cc04a;
    color: #000;
    cursor: pointer;
    box-shadow: var(--pixel-shadow-sm);
    transition: all 0.1s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #7cc04a;
}

.copy-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* ===== Info Section ===== */
.info-section {
    padding: 80px 0;
    background: rgba(0, 0, 0, 0.3);
}

.info-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.step-box {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: var(--bg-card);
    border: 4px solid var(--border-color);
    box-shadow: var(--pixel-shadow);
}

.step-box:hover {
    border-color: var(--primary-color);
}

.step-number {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: var(--accent-color);
    text-shadow: var(--pixel-shadow-sm);
    min-width: 50px;
}

.step-content h3 {
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    color: var(--text-green);
    margin-bottom: 8px;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ===== Contact Section ===== */
.contact-section {
    padding: 40px 0 60px;
}

.contact-content {
    text-align: center;
}

.contact-text {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pixel-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 15px 25px;
    text-decoration: none;
    border: 4px solid;
    box-shadow: var(--pixel-shadow);
    transition: all 0.1s ease;
    display: inline-block;
    min-width: 140px;
    text-align: center;
}

.pixel-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #000000;
}

.pixel-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.pixel-btn.teamspeak {
    background: #2580c3;
    border-color: #3498db;
    color: white;
}

.pixel-btn.email {
    background: var(--primary-color);
    border-color: #7cc04a;
    color: #000;
}

.ts-address {
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    letter-spacing: 2px;
}

/* ===== Footer ===== */
footer {
    padding: 30px 0;
    border-top: 4px solid var(--border-color);
    background: var(--bg-darker);
}

.footer-content {
    text-align: center;
    margin-bottom: 15px;
}

footer p {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.last-update {
    color: var(--text-green);
}

.footer-decoration {
    text-align: center;
    color: var(--border-color);
    font-size: 0.8rem;
    letter-spacing: -1px;
    overflow: hidden;
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 4px solid var(--success-color);
    padding: 15px 25px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: var(--pixel-shadow);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-message {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--success-color);
}

/* ===== Responsive ===== */

/* Tablet */
@media (max-width: 992px) {
    .servers-table th,
    .servers-table td {
        padding: 15px 10px;
    }
    
    /* Hide MAP column on tablet */
    .servers-table th:nth-child(4),
    .servers-table td:nth-child(4) {
        display: none;
    }
}

/* Mobile landscape / small tablet */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 0.9rem;
    }
    
    nav {
        gap: 10px;
    }
    
    nav a {
        font-size: 0.5rem;
        padding: 6px 8px;
    }
    
    .pixel-title h2 {
        font-size: 1rem;
    }
    
    .servers-table {
        font-size: 1rem;
    }
    
    .servers-table th {
        font-size: 0.4rem;
        padding: 12px 8px;
    }
    
    .servers-table td {
        padding: 15px 8px;
        height: auto;
    }
    
    /* Hide MAP and GAME VERSION columns */
    .servers-table th:nth-child(4),
    .servers-table td:nth-child(4) {
        display: none;
    }
    
    .game-version {
        display: none;
    }
    
    .status-text {
        font-size: 0.4rem;
    }
    
    .copy-btn {
        font-size: 0.35rem;
        padding: 6px 8px;
    }
    
    .section-title {
        font-size: 0.7rem;
    }
    
    .contact-section {
        padding: 40px 0;
    }
    
    .pixel-btn {
        font-size: 0.5rem;
        padding: 12px 18px;
    }
}

/* Mobile portrait */
@media (max-width: 600px) {
    header .container {
        flex-direction: column;
        gap: 12px;
        padding: 12px 15px;
    }
    
    .logo h1 {
        font-size: 0.8rem;
    }
    
    nav {
        gap: 8px;
    }
    
    nav a {
        font-size: 0.45rem;
        padding: 5px 8px;
    }
    
    .hero {
        padding: 110px 0 20px;
    }
    
    .pixel-title h2 {
        font-size: 0.75rem;
    }
    
    .servers-section {
        padding: 10px 0 40px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .servers-table-wrapper {
        border-width: 3px;
        box-shadow: 3px 3px 0px #000000;
    }
    
    .servers-table {
        font-size: 0.9rem;
    }
    
    .servers-table th {
        font-size: 0.35rem;
        padding: 10px 5px;
    }
    
    .servers-table td {
        padding: 12px 5px;
    }
    
    /* Hide MAP, GAME, JOUEURS columns on small mobile */
    .servers-table th:nth-child(3),
    .servers-table td:nth-child(3),
    .servers-table th:nth-child(4),
    .servers-table td:nth-child(4),
    .servers-table th:nth-child(5),
    .servers-table td:nth-child(5) {
        display: none;
    }
    
    .server-name {
        font-size: 1rem;
    }
    
    .status-cell {
        flex-direction: column;
        gap: 4px;
    }
    
    .status-text {
        font-size: 0.35rem;
    }
    
    .address-cell {
        font-size: 0.85rem;
        word-break: break-all;
    }
    
    .copy-btn {
        font-size: 0.3rem;
        padding: 5px 6px;
    }
    
    .section-title {
        font-size: 0.55rem;
    }
    
    .contact-section {
        padding: 30px 0;
    }
    
    .contact-text {
        font-size: 1rem;
    }
    
    .contact-links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .pixel-btn {
        font-size: 0.45rem;
        padding: 12px 20px;
        width: 100%;
        max-width: 200px;
        text-align: center;
    }
    
    footer {
        padding: 20px 0;
    }
    
    footer p {
        font-size: 0.4rem;
    }
    
    .toast {
        padding: 10px 15px;
    }
    
    .toast-message {
        font-size: 0.45rem;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .logo h1 {
        font-size: 0.65rem;
    }
    
    .pixel-title h2 {
        font-size: 0.6rem;
    }
    
    /* On very small screens, only show STATUS, NAME, ADDRESS, ACTION */
    .servers-table th:nth-child(3),
    .servers-table td:nth-child(3),
    .servers-table th:nth-child(4),
    .servers-table td:nth-child(4),
    .servers-table th:nth-child(5),
    .servers-table td:nth-child(5) {
        display: none;
    }
    
    .address-cell {
        font-size: 0.75rem;
    }
}

/* ===== Pixel Art Decorations ===== */
.servers-table-wrapper::before {
    content: '████████████████████████████████████████';
    display: block;
    background: var(--bg-card);
    color: var(--primary-color);
    font-size: 0.6rem;
    letter-spacing: -2px;
    padding: 5px;
    overflow: hidden;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border: 2px solid var(--border-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border: 2px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: #7cc04a;
}
