/* ===== DEFINE COLOURS ===== */
:root {
    --primary-colour: #3f1b1b;
    --secondary-colour: #b13939;
    --accent-colour: #611919;
    --text-colour: #222;
    --background-colour: #e7d6d6;
    --white: #fff;
    --black: #000;

    --secondary-colour-disabled: #b87070;
    --accent-colour-disabled: #965b5b;

    --off-white: #eee;
    --link-text-colour: #222;

    --campaign-badge-colour: #8f2525;
}
















/* ===== Global Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



/* ===== Global Styles ===== */
body {
    font-family: Arial, sans-serif;
    background: var(--background-colour);
    color: var(--text-colour);
    line-height: 1.6;
    text-shadow: 0 0 3px #3332;
}

html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
}

a {
    color: var(--link-text-colour);
    text-decoration: dotted underline;
}
a:hover {
    text-decoration: underline;
}

.container {
    width: 90%;
    max-width: 1000px;
    margin: auto;
}
.pre-container {
    width: 90%;
    max-width: 1000px;
    margin: 25px auto auto auto;
}
.pre-container .container {
    width: unset;
}



/* ===== Header ===== */
.site-header {
    background: var(--primary-colour);
    color: white;
    padding: 10px 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: -5px;
}



/* ===== Logo & Title ===== */
.logo-title {
    display: flex;
    align-items: center;
    text-shadow: 0 0 10px #333a;
    gap: 15px;
}

.logo-title a {
    color: white;
    text-decoration: none;
}

.logo {
    height: 55px;
    width: 95px;
    -webkit-filter: drop-shadow(0 0 5px #333a);
    filter: drop-shadow(0 0 5px #333a);
}



/* ===== Navigation & User Links ===== */
.main-nav {
    margin-top: 5px;
}

.main-nav a, .user-login-links a {
    color: white;
    text-decoration: none;
    text-shadow: 0 0 5px #333a;
    margin-right: 20px;
    font-weight: bold;
}

.main-nav a:first-child {
    margin-left: 0;
}

.user-login-links a {
    margin: 0 20px;
}

.main-nav a:hover, .user-login-links a:hover {
    text-decoration: underline;
}



/* ===== User login box ===== */
.user-area {
    position: relative;
}

/* == If logged in == */
.user-box {
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--secondary-colour);
    background: #b1393969;
    border-radius: 5px;
    padding: 10px 15px;
    z-index: 1;
}

/* An invisible area the mouse can touch so the dropdown will stay visible: */
.invisible-spacer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
}

.avatar {
    height: 35px;
    width: 35px;
    border-radius: 20%;
    border: 1px solid var(--secondary-colour);
}

.avatar_large {
    height: 100px;
    width: 100px;
    border-radius: 20%;
    border: 1px solid var(--secondary-colour);
}

/* == Dropdown == */
.dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 56px;
    background: var(--accent-colour);
    padding: 10px;
    border-radius: 4px;
    width: 150px;
}

.dropdown a {
    display: block;
    color: white;
    padding: 8px 5px;
    text-decoration: none;
}

.dropdown a:hover {
    opacity: 0.7;
}

/* == Show dropdown on hover == */
.user-box:hover .dropdown {
    display: block;
}

/* == Not logged in == */
.user-login-links a {
    color: #fff;
    text-decoration: none;
}

.user-login-links a:hover {
    text-decoration: underline;
}



/* ===== Footer ===== */
.site-footer {
    background: var(--primary-colour);
    color: white;
    text-shadow: 0 0 3px #333a;
    padding: 15px 0;
    margin-top: 40px;
    text-align: center;
}

.site-footer a {
    color: white;
    text-decoration: dotted underline;
}

.site-footer a:hover {
    text-decoration: underline;
}



/* ===== Form Styles ===== */
form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid var(--secondary-colour);
}

.auth {
    width: 65%;
    margin-left: 17.5%;
    margin-right: 17.5%;
}

label {
    display: block;
    margin: 10px 0 5px;
}

input[type=text],
input[type=password] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

input:disabled {
    background: #eee;
}

button {
    padding: 10px 15px;
    border: 1px solid var(--accent-colour);
    background: var(--secondary-colour);
    color: var(--white);
    font-weight: 500;
    border: none;
    cursor: pointer;
    margin-top: 15px;
    border-radius: 7.5px;
}

button:disabled {
    border: 1px solid var(--accent-colour-disabled);
    background: var(--secondary-colour-disabled);
    color: var(--off-white);
    font-weight: 500;
    cursor: not-allowed;
}

button:hover {
    opacity: 0.85;
}



/* ===== Alert Bars ===== */
.alert_info {
    background: #2196f3;
    border: 1px solid #0b7dda;
    color: #333;
    padding: 10px;
    text-align: center;
    margin: 10px 0 25px 0;
    border-radius: 5px;
}

.alert_success {
    background: #4caf50;
    border: 1px solid #357a38;
    color: #333;
    padding: 10px;
    text-align: center;
    margin: 10px 0 25px 0;
    border-radius: 5px;
}

.alert_warning {
    background: #ffd000;
    border: 1px solid #da8301;
    color: #333;
    padding: 10px;
    text-align: center;
    margin: 10px 0 25px 0;
    border-radius: 5px;
}

.alert_error {
    background: #ff4c4c;
    border: 1px solid #da0101;
    color: #333;
    padding: 10px;
    text-align: center;
    margin: 10px 0 25px 0;
    border-radius: 5px;
}


/* ===== Tooltips ===== */
.tooltip {
    position: absolute;
    background: #333a;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    pointer-events: none;
    transition: opacity 0.2s;
    visibility: hidden;
}


/* ===== App Grid ===== */
.app-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 30px;
}

.app-card {
    background: white;
    border: 1px solid #b13939;
    border-radius: 8px;
    width: 200px;
    text-align: center;
    padding: 25px 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    height: 250px;
    position: relative;
}
.app-card:hover {
    transform: scale(1.05);
}

.app-card img {
    width: 150px;
    height: 150px;
    margin-bottom: 15px;
}

.app-card h3 {
    margin-bottom: 15px;
    position: absolute;
    bottom: 0;
    width: calc(100% - 50px);
    left: 25px;
    right: 25px;

    max-height: 45px;
    overflow: hidden;
    font-size: 14px;

    word-wrap: break-word;
}

.app-card .technical-text {
    position: absolute;
    bottom: 0px;
    font-size: 9px;
    width: calc(100% - 50px);
    left: 25px;
    right: 25px;
}


/* ===== Server Logs Page ===== */
.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table th,
.logs-table td {
    padding: 8px;
    border-bottom: 1px solid #ccc;
    text-align: left;
}

.icon-inline {
    height: 28px;
    width: 28px;
    margin-right: 5px;
    filter: drop-shadow(0 0 2px rgba(51, 51, 51, 0.3));
    -webkit-filter: drop-shadow(0 0 2px rgba(51, 51, 51, 0.3));
}


.filter-container {
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
}
.filter-container input, .filter-container select {
    padding: 5px 10px;
    border: 1px solid #b13939;
    border-radius: 5px;
    background: white;
    font-size: 12pt;
    margin-bottom: 0;
    height: 40px;
}


/* ===== User Management Page ===== */
.user-management-table {
    width: 100%;
    border-collapse: collapse;
}

.user-management-table th,
.user-management-table td {
    padding: 8px;
    border-bottom: 1px solid #ccc;
    text-align: left;
}

.feature-toggle {
    font-weight: bold;
}

.user-management-table hr {
    border: none;
    border-top: 1px solid #888;
    margin: 10px 0;
}

.role-dropdown {
    padding: 5px;
    border: 1px solid #b13939;
    border-radius: 5px;
    background: white;
    min-width: 75%;
    font-size: 12pt;
    margin: 0 -5px;
}


/* ===== System Info Table Styles ===== */
.system-info-table {
    width: 100%;
    border: solid 2px #b13939;
    border-radius: 10px;
    border-collapse: separate;
    border-spacing: 0;
}
.system-info-table th, .system-info-table td {
    padding: 8px;
    text-align: left;
}


.system-info-table th:first-child {
    border-radius: 5px 0 0 0 !important;
    -moz-border-radius: 5px 0 0 0 !important;
}
.system-info-table th:last-child {
    border-radius: 0 5px 0 0 !important;
    -moz-border-radius: 0 5px 0 0 !important;
}
.system-info-table tr:last-child td:first-child {
    border-radius: 0 0 0 50px !important;
    -moz-border-radius: 0 0 0 50px !important;
}
.system-info-table tr:last-child td:last-child {
    border-radius: 0 0 50px 0 !important;
    -moz-border-radius: 0 0 50px 0 !important;
}



.system-info-table th {
    background: #b13939;
    color: white;
}

.system-info-table tr:not(:last-child) {
    border-bottom: 1px solid #ccc;
}

.system-info-table tr:nth-child(even) {
    background: #ffffff66;
}
.system-info-table tr:nth-child(odd) {
    background: #dddddd66;
}

.spacer-column, .hidden-spacer-column {
    width: 2px;
    padding: 3px !important;
}
.spacer-row td {
    background: #b13939;
    padding: 3px !important;
}




/* ===== Campaign Page Styles ===== */
h2:has(.badge) {
    display: flex;
    align-items: center;
    gap: 10px;
}
.badge {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    background-color: var(--campaign-badge-colour);
    border-radius: 5px;
    margin-right: 5px;
}
.badge-rm {
    -webkit-box-shadow:0px 0px 15px 5px #ff00003a;
    -moz-box-shadow: 0px 0px 15px 5px #ff00003a;
    box-shadow: 0px 0px 15px 5px #ff00003a;
}


.active-cs-parent-container {
    position: relative;

}
.active-status-container,
.active-connection-container {
    position: absolute;
    /* height: 15px; */
    /* width: fit-content; */
    float: right;
    right: 0px;
}
.active-status-container {
    top: -15px;
}
.active-connection-container {
    top: -35px;
}

.active-status-container span,
.active-connection-container span {
    position: relative;
    top: -2px;
    color: var(--text-colour);
    font-size: 12px;
    font-weight: bold;
    float: right;
    padding: 0 20px 0 10px;
}

.active-status,
.active-connection {
    position: relative;
    float: right;
    border-radius: 7.5px;
    height: 15px;
    width: 15px;
    float: left;
}

.active-status-active,
.active-connection-active {
    background-color: #4caf50;
    -webkit-box-shadow:0px 0px 10px 5px #4caf503a;
    -moz-box-shadow: 0px 0px 10px 5px #4caf503a;
    box-shadow: 0px 0px 10px 5px #4caf503a;
}
.active-status-paused,
.active-connection-paused {
    background-color: #ffcc00;
    -webkit-box-shadow:0px 0px 10px 5px #ffcc003a;
    -moz-box-shadow: 0px 0px 10px 5px #ffcc003a;
    box-shadow: 0px 0px 10px 5px #ffcc003a;
}
.active-connection-inactive {
    background-color: #ff0044;
    -webkit-box-shadow:0px 0px 10px 5px #ff00443a;
    -moz-box-shadow: 0px 0px 10px 5px #ff00443a;
    box-shadow: 0px 0px 10px 5px #ff00443a;
}
















