/* === VARIABLES === */
:root {
    /* accent color: change these four lines to recolor the whole site */
    --primary: #7dd3fc;
    --primary-rgb: 125, 211, 252;
    --primary-dark: #2f8fc4;
    --on-primary: #04121c;
    --text: #e0e0e0;
    --muted: #9a9a9a;
    --online: #2ecc71;
    --offline: #e74c3c;
    /* default background; the gradient below it shows while the image loads.
       site.background in inc/config.php replaces both */
    --bg-image: url('../img/background.webp'), radial-gradient(ellipse at 30% 20%, #1d3b5a 0%, #0d1b2a 45%, #05080d 100%);
}

/* === BASE === */
html {
    overflow-x: hidden;
}

body {
    margin: 0;
    /* fixed distance from the top, so the menu stays in place on short and long pages */
    padding: 50px 1rem 2rem;
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    font-family: "Liberation Sans", Arial, sans-serif;
    color: var(--text);
    background-color: #05080d;
    background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* === TOP MENU === */
.container.site-nav {
    margin-bottom: 1.2rem;
    padding: 0.9rem 1rem;
    display: flex;
    /* the language switcher lines up with the text of the first row of links */
    align-items: baseline;
    gap: 10px;
}

/* links take the free space; with many entries they wrap into centered rows,
   the language switcher stays on the right, also on phones */
.nav-links {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.site-nav .nav-link {
    padding: 8px 9px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.site-nav .lang-switch {
    flex-shrink: 0;
}

.nav-link.active {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* === LANGUAGE SWITCHER === */
.lang-switch {
    font-size: 0.7rem;
    font-weight: bold;
}

.lang-switch a {
    color: #666;
    text-decoration: none;
    padding: 0 5px;
    transition: 0.3s;
}

.lang-switch a:hover,
.lang-switch a.active {
    color: var(--primary);
}

/* === CONTAINER === */
.container {
    background: rgba(8, 16, 26, 0.72);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    width: 100%;
    max-width: 680px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === HEADINGS === */
h1,
h2 {
    text-align: center;
    color: var(--primary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

h1 {
    font-size: 1.4rem;
    margin: 1rem 0 1.5rem;
}

h2 {
    font-size: 0.95rem;
    margin: 0 0 1rem;
}

/* === SERVER STATUS === */
.status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-online {
    color: var(--online);
}

.status-online .status-dot {
    background: var(--online);
    box-shadow: 0 0 10px var(--online);
    animation: pulse 2s ease-in-out infinite;
}

.status-offline {
    color: var(--offline);
}

.status-offline .status-dot {
    background: var(--offline);
}

@keyframes pulse {
    50% { opacity: 0.4; }
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    text-align: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.stat-value {
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
}

.stat-label {
    color: var(--muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === HOW TO CONNECT === */
.section {
    margin-bottom: 1.8rem;
}

.connect {
    background: rgba(var(--primary-rgb), 0.06);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.2rem;
}

/* === ABOUT THE SERVER === */
.about-text {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    line-height: 1.6;
    text-align: center;
}

.rates {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0;
}

.rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.rate dt {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rate dd {
    margin: 0;
    color: var(--primary);
    font-weight: bold;
}

/* === DOWNLOADS === */
.downloads {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.download {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--text);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.download::before {
    content: "\2193";
    font-weight: bold;
    color: var(--primary);
}

.download-label {
    flex: 1;
    font-weight: 600;
}

.download-note {
    color: var(--muted);
    font-size: 0.75rem;
}

.download:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.2);
}

.connect ol {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.85rem;
    line-height: 1.6;
}

.connect li + li {
    margin-top: 0.4rem;
}

code {
    display: block;
    margin-top: 0.4rem;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    color: var(--primary);
    font-family: "Liberation Mono", monospace;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
    user-select: all;
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
}

input {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.7);
}

small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

/* honeypot against bots, never visible to people */
.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* === BUTTONS === */
button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: var(--on-primary);
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.3s;
    margin-top: 1rem;
}

button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
}

/* === MESSAGES === */
.message {
    margin-bottom: 1.5rem;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
}

.message-success {
    background: rgba(39, 174, 96, 0.2);
    color: var(--online);
    border: 1px solid var(--online);
}

.message-error {
    background: rgba(192, 57, 43, 0.2);
    color: var(--offline);
    border: 1px solid var(--offline);
}

/* === NAV LINKS === */
.nav-link {
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 18px;
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.2);
}

/* === NEWS === */
.news-latest {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0.8rem;
}

.news-teaser {
    display: block;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--text);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.news-teaser:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}

.news-teaser-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.news-teaser-title {
    font-weight: 600;
    color: #fff;
}

.news-teaser-text {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--muted);
}

time {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.more-link {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
}

.more-link:hover {
    text-decoration: underline;
}

.news {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    line-height: 1.6;
}

.news:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.news h2 {
    text-align: left;
    margin-bottom: 0.3rem;
    font-size: 1.05rem;
    text-transform: none;
    letter-spacing: 0.5px;
}

.news a {
    color: var(--primary);
}

.news p,
.news ul {
    margin: 0.8rem 0 0;
}

.pager {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.pager .nav-link:only-child {
    margin-left: auto;
}

.empty {
    text-align: center;
    color: var(--muted);
}

/* === RANKING === */
.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 1.5rem;
}

.tabs .nav-link {
    padding: 7px 10px;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

/* wide tables scroll sideways on phones instead of breaking the panel */
.table-wrap {
    overflow-x: auto;
}

.ranking {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.ranking th {
    padding: 8px 6px;
    text-align: left;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.ranking th .sort {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.3);
}

.ranking th .sort:hover,
.ranking th .sort.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.ranking th .sort.active::after {
    content: " \25B2";
    font-size: 0.55rem;
}

.ranking td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.ranking tbody tr:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

.ranking .num {
    text-align: right;
}

.ranking .pos {
    color: var(--muted);
}

.ranking .name {
    font-weight: 600;
}

.ranking .guild {
    color: var(--muted);
}

.ranking .members {
    white-space: normal;
}

.ranking .members span + span::before {
    content: ", ";
    color: var(--muted);
}

.faction-alliance {
    color: #4a9eff;
}

.faction-horde {
    color: #e5484d;
}

/* class colors as in the game */
.class-1 { color: #c79c6e; }
.class-2 { color: #f58cba; }
.class-3 { color: #abd473; }
.class-4 { color: #fff569; }
.class-5 { color: #ffffff; }
.class-6 { color: #c41f3b; }
.class-7 { color: #2d8ff0; }
.class-8 { color: #69ccf0; }
.class-9 { color: #9482c9; }
.class-11 { color: #ff7d0a; }

/* === CREDITS === */
.credits {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.credits a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
}

.credits a:hover {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4);
}

/* === MOBILE === */
@media (max-width: 640px) {
    .rates {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.8rem 1.4rem;
    }

    .container.site-nav {
        padding: 0.8rem;
    }

    .stats,
    .rates {
        grid-template-columns: 1fr;
    }
}
