/* GENERAL */

* {
    box-sizing: border-box;
}

body {
    font-family: Verdana, Geneva, sans-serif;
    margin: 0;
    padding: 0;
    color: #FFFFFF;
    background-color: #343434;
}

h1,
h2,
h3,
th,
strong {
    font-weight: 700;
}

button,
input,
select {
    font-family: Verdana, Geneva, sans-serif;
}

button {
    background-color: #e96528;
    color: #FFFFFF;

    border: 2px solid #000000;
    border-radius: 18px;

    padding: 10px 20px;

    cursor: pointer;
    font-weight: 700;
}

button:hover {
    filter: brightness(1.1);
}

.logo {
    height: 85px;
    width: auto;
}

.clearfix {
    clear: both;
}


/* LOGIN PAGE */

body:has(#loginForm) {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    padding: 30px 20px;

    text-align: center;
}


/* Logo */

body:has(#loginForm) > .logo {
    display: block;

    height: 110px;
    width: auto;

    margin: 0 0 20px;
}


/* Title */

body:has(#loginForm) > h1 {
    margin: 0 0 15px;

    font-size: 2.3rem;
}


/* Subtitle */

body:has(#loginForm) > h1 + p {
    margin: 0 0 25px;

    color: #CCCCCC;
}


/* Login title */

body:has(#loginForm) > h2 {
    margin: 0 0 20px;

    font-size: 1.8rem;
}


/* Login form */

#loginForm {
    width: 520px;
    max-width: 90vw;

    margin: 0 auto;
    padding: 30px;

    background-color: #3A3A3A;

    border: 2px solid #FFFFFF;
    border-radius: 14px;

    text-align: left;
    align-self: center;
}

/* Labels */

#loginForm label {
    display: block;

    margin-bottom: 8px;

    font-weight: 700;
}


/* Inputs */

#loginForm input {
    width: 100%;

    margin-bottom: 20px;
    padding: 12px 14px;

    background-color: #2C2C2C;
    color: #FFFFFF;

    border: 1px solid #777777;
    border-radius: 6px;

    font-size: 1rem;
}

#loginForm input:focus {
    outline: 2px solid #e96528;
    border-color: #e96528;
}


/* Login button */

#loginForm button {
    width: 100%;

    margin-top: 5px;
}


/* Create account */

body:has(#loginForm) > p:last-of-type {
    margin: 20px 0 0;
}

body:has(#loginForm) > p:last-of-type a {
    color: #e96528;
    font-weight: 700;
}

body:has(#loginForm) > p:last-of-type a:hover {
    color: #FFFFFF;
}

/* REGISTRATION PAGE STUFF */

/* REGISTER PAGE */

body:has(#registerForm) {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    padding: 40px 20px;

    text-align: center;
}


/* Logo */

body:has(#registerForm) > .logo {
    display: block;

    height: 100px;
    width: auto;

    margin: 0 auto 15px;
}


/* Title */

body:has(#registerForm) > h1 {
    margin: 0 0 20px;

    font-size: 2.3rem;
}


/* Create Account title */

body:has(#registerForm) > h2 {
    margin: 0 0 20px;

    font-size: 1.8rem;
}


/* Register form */

#registerForm {
    width: 560px;
    max-width: 90vw;

    margin: 0 auto;
    padding: 30px;

    background-color: #3A3A3A;

    border: 2px solid #FFFFFF;
    border-radius: 14px;

    text-align: left;
    align-self: center;
}


/* Form groups */

#registerForm .form-group {
    margin-bottom: 18px;
}


/* Labels */

#registerForm label {
    display: block;

    margin-bottom: 8px;

    font-weight: 700;
}


/* Inputs and dropdowns */

#registerForm input,
#registerForm select {
    display: block;

    width: 100%;

    margin: 0;
    padding: 12px 14px;

    background-color: #2C2C2C;
    color: #FFFFFF;

    border: 1px solid #777777;
    border-radius: 6px;

    font-size: 1rem;
}


/* Placeholder text */

#registerForm input::placeholder {
    color: #888888;
}


/* Input focus */

#registerForm input:focus,
#registerForm select:focus {
    outline: 2px solid #e96528;
    border-color: #e96528;
}


/* Register button */

#registerForm button[type="submit"] {
    width: 100%;

    margin-top: 10px;
    padding: 12px 20px;
}


/* Admin code section */

#adminCodeGroup {
    margin-top: 18px;
}


/* Error message */

#registerForm .error-message {
    margin: 15px 0 0;

    text-align: center;
}


/* Login link */

body:has(#registerForm) > p:last-of-type {
    width: 100%;

    margin: 20px auto 0;

    text-align: center;
}

body:has(#registerForm) > p:last-of-type a {
    color: #e96528;

    font-weight: 700;
}

body:has(#registerForm) > p:last-of-type a:hover {
    color: #FFFFFF;
}

/* MAIN HEADER */

.main-header {
    width: 100%;

    padding: 20px 40px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    border-bottom: 1px solid #555555;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-brand .logo {
    height: 85px;
}

.brand-text h1 {
    margin: 0;
    font-size: 2rem;
}

.brand-text p {
    margin: 5px 0 0;
    color: #CCCCCC;
}


/* HEADER BUTTONS */

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions button {
    width: auto;
    min-width: 140px;
}

.logout-button {
    background-color: #e96528;
}


/* MAIN DASHBOARD */

.dashboard-container {
    width: 90%;
    max-width: 1200px;

    margin: 0 auto;
    padding: 20px 0 50px;
}


/* WELCOME */

.welcome-section {
    margin: 5px 0 25px;

    text-align: right;
    color: #CCCCCC;
}


/* GAME STATUS */

.game-status-section {
    width: 100%;

    margin-bottom: 35px;
    padding: 25px 30px;

    background-color: #3A3A3A;

    border: 1px solid #555555;
    border-radius: 12px;
}

.game-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 30px;
}

.game-status-header h2 {
    margin: 0 0 8px;
}

.game-status-header p {
    margin: 0;
    color: #CCCCCC;
}


/* GAME TOGGLE */

.switch {
    position: relative;

    display: inline-block;

    width: 64px;
    height: 34px;

    flex-shrink: 0;
}

.switch input {
    opacity: 0;

    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;

    cursor: pointer;

    background-color: #666666;

    border: 2px solid #222222;
    border-radius: 34px;

    transition: 0.2s;
}

.slider::before {
    content: "";

    position: absolute;

    width: 24px;
    height: 24px;

    left: 3px;
    bottom: 3px;

    background-color: #FFFFFF;

    border-radius: 50%;

    transition: 0.2s;
}

.switch input:checked + .slider {
    background-color: #e96528;
}

.switch input:checked + .slider::before {
    transform: translateX(30px);
}


/* GAME MODE */

.game-mode-row {
    margin-top: 25px;
    padding-top: 20px;

    border-top: 1px solid #555555;

    justify-content: space-between;
    align-items: center;

    gap: 30px;
}

.game-mode-row p {
    margin: 5px 0 0;
    color: #CCCCCC;
}

.game-mode-row select {
    width: 260px;

    padding: 10px 12px;

    background-color: #2C2C2C;
    color: #FFFFFF;

    border: 1px solid #777777;
    border-radius: 6px;
}


/* MERCENARY SEARCH */

.mercenary-search-section {
    width: 100%;

    margin-bottom: 35px;
    padding: 25px 30px;

    background-color: #3A3A3A;

    border: 1px solid #555555;
    border-radius: 12px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.section-header h2 {
    margin: 0 0 5px;
}

.section-header p {
    margin: 0;
    color: #CCCCCC;
}

.close-search-button {
    width: 40px;
    min-width: 40px;
    height: 40px;

    padding: 0;

    font-size: 1.6rem;
    line-height: 1;
}

.search-container {
    margin-top: 25px;
}

.search-container label {
    display: block;

    margin-bottom: 8px;

    font-weight: 700;
}

.search-container input {
    width: 100%;

    padding: 12px 14px;

    background-color: #2C2C2C;
    color: #FFFFFF;

    border: 1px solid #777777;
    border-radius: 6px;

    font-size: 1rem;
}


/* SEARCH RESULTS */

#searchResults {
    margin-top: 20px;
}

.contact-card {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    padding: 15px 20px;
    margin-bottom: 10px;

    background-color: #2C2C2C;

    border: 1px solid #555555;
    border-radius: 8px;
}

.contact-info h3 {
    margin: 0 0 8px;
}

.contact-info p {
    margin: 5px 0;
    color: #CCCCCC;
}

.contact-card button {
    width: auto;
    min-width: 100px;
}


/* MY MERCENARIES */

.mercenaries-section {
    width: 100%;
    margin-top: 20px;
}

.section-title {
    margin-bottom: 20px;
}

.section-title h2 {
    margin: 0 0 6px;
    font-size: 1.8rem;
}

.section-title p {
    margin: 0;
    color: #CCCCCC;
}


/* MERCENARY TABLE */

.table-container {
    width: 100%;

    overflow-x: auto;

    border: 1px solid #555555;
    border-radius: 10px;
}

.mercenary-table {
    width: 100%;

    border-collapse: collapse;

    background-color: #3A3A3A;
}

.mercenary-table th,
.mercenary-table td {
    padding: 15px 18px;

    text-align: left;
    vertical-align: middle;

    border-bottom: 1px solid #555555;
}

.mercenary-table th {
    background-color: #2C2C2C;

    font-weight: 700;
    font-size: 0.95rem;
}

.mercenary-table td {
    font-size: 0.95rem;
}

.mercenary-table tbody tr:hover {
    background-color: #444444;
}

.mercenary-table tbody tr:last-child td {
    border-bottom: none;
}


/* MERCENARY STATUS */

.status {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 15px;

    font-size: 0.8rem;
    font-weight: 700;
}

.status.online {
    background-color: #e96528;
    color: #FFFFFF;
}

.status.offline {
    background-color: #555555;
    color: #CCCCCC;
}


/* REMOVE BUTTON */

.remove-button {
    width: auto;
    min-width: 90px;

    padding: 7px 14px;

    background-color: #C62828;

    border-radius: 16px;
}

.remove-button:hover {
    background-color: #A51F1F;
}


/* EMPTY MESSAGE */

.empty-message {
    padding: 35px;

    text-align: center;

    color: #CCCCCC;
}

.empty-message h3 {
    color: #FFFFFF;
}


/* ERROR MESSAGE */

.error-message {
    color: #FF8B8B;
    margin-top: 10px;
}


/* ADMIN USER MANAGEMENT */

.contacts-section {
    width: 94%;
    max-width: 1500px;

    margin: 40px auto;
}

#userList {
    width: 100%;

    margin-top: 25px;

    overflow-x: auto;
}

/* ADMIN USER TABLE */

.user-table {
    width: 100%;

    table-layout: auto;
    border-collapse: collapse;

    background-color: #3A3A3A;
}

.user-table th,
.user-table td {
    padding: 18px 22px;

    text-align: left;
    vertical-align: middle;

    border-bottom: 1px solid #555555;
}

.user-table th {
    font-weight: 700;
    font-size: 1rem;
}

.user-table td {
    font-size: 1rem;
}


/* ADMIN TABLE COLUMNS */

.user-table th:nth-child(1),
.user-table td:nth-child(1) {
    width: 7%;
}

.user-table th:nth-child(2),
.user-table td:nth-child(2) {
    width: 16%;
}

.user-table th:nth-child(3),
.user-table td:nth-child(3) {
    width: 16%;
}

.user-table th:nth-child(4),
.user-table td:nth-child(4) {
    width: 20%;
}

.user-table th:nth-child(5),
.user-table td:nth-child(5) {
    width: 12%;
}

.user-table th:nth-child(6),
.user-table td:nth-child(6) {
    width: 29%;
}


/* ADMIN BUTTONS */

.user-table td:last-child {
    white-space: nowrap;
}

.edit-btn,
.delete-btn {
    display: inline-block;

    width: auto;

    padding: 9px 16px;
    margin-right: 8px;

    border: 2px solid #000000;
    border-radius: 20px;

    cursor: pointer;

    font-weight: 700;
    white-space: nowrap;
}

.edit-btn {
    background-color: #e96528;
    color: #FFFFFF;
}

.delete-btn {
    background-color: #C62828;
    color: #FFFFFF;
}

.delete-btn:hover {
    background-color: #A51F1F;
}


/* MOBILE */

@media (max-width: 800px) {

    .main-header {
        padding: 15px 20px;
        align-items: flex-start;
    }

    .header-brand .logo {
        height: 60px;
    }

    .brand-text h1 {
        font-size: 1.4rem;
    }

    .brand-text p {
        display: none;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions button {
        min-width: 120px;
    }

    .dashboard-container {
        width: 95%;
    }

    .game-status-section {
        padding: 20px;
    }

    .game-status-header {
        gap: 15px;
    }

    .game-mode-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .game-mode-row select {
        width: 100%;
    }

    .mercenary-table {
        min-width: 850px;
    }

    .contacts-section {
        width: 95%;
    }

    .user-table {
        min-width: 750px;
    }

    .user-table th,
    .user-table td {
        padding: 12px;
    }

    #loginForm,
    #registerForm {
        width: 92%;
        padding: 22px;
    }
}
