/* Hover-effekt for regelruter */
.rule-box.glass-box:hover {
    box-shadow: 0 8px 32px #000a;
    transform: translateY(-4px) scale(1.04);
    border-color: #4da6ff;
    background: rgba(24, 70, 163, 0.28);
    transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s, background 0.18s;
    cursor: pointer;
}
/* Grid for regler: 1 kolonne på mobil, 4 på desktop */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0.2em;
}
@media (min-width: 900px) {
    .rules-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Glass-effekt for små ruter (regler) */
.rule-box.glass-box {
    max-width: 220px;
    background: rgba(24, 70, 163, 0.18);
    border-radius: 18px;
    box-shadow: 0 4px 32px #0003;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.18);
    padding: 1.2em 1em;
    margin: 0;
    min-width: 0;
    max-width: 100%;
}
/* Glass-effekt for små ruter (regler) */
.rule-box.glass-box {
    min-width: 0;
    margin: 0;
    padding: 1.2em 1em;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}
/* Glassmorphism for forsideinnhold */
.glass-box {
    background: rgba(24, 70, 163, 0.18);
    border-radius: 18px;
    box-shadow: 0 4px 32px #0003;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.18);
    padding: 2.2em 2em 1.7em 2em;
    margin-bottom: 2em;
    margin-top: 1.5em;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    /* pointer-events fjernet for å sikre at knapper og innhold kan klikkes */
}
.glass-box p {
    font-size: 1.35em;
    color: #fff;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.6;
}
/* Felles stil for alle knapper i adminpanel */
button, input[type="submit"], input[type="button"] {
    background: #1846a3;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 0.7em 1.5em;
    font-size: 1.08em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px #0003;
    transition: background 0.18s, color 0.18s;
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    background: #0f2e6e;
    color: #fff;
}
/* Tving mørk bakgrunn på alle tekstbokser, textarea og select på alle sider */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="file"],
input[type="color"],
select,
textarea {
    background: #181a1b !important;
    color: #e0e0e0 !important;
    border-radius: 5px !important;
    border: 1.5px solid #23272a !important;
    padding: 0.7em !important;
    font-size: 1em !important;
    margin-bottom: 0.7em !important;
    box-sizing: border-box !important;
    transition: border 0.2s, box-shadow 0.2s !important;
}
/* Input and textarea styles */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="file"],
input[type="color"],
select,
textarea {
/* Staff-bilder firkantet med runde hjørner */
.staff-img-square {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: 0 2px 8px #0006;
    background: #181a1b !important;
    color: #e0e0e0 !important;
    border-radius: 5px !important;
    border: 1.5px solid #23272a !important;
    padding: 0.7em !important;
    font-size: 1em !important;
    margin-bottom: 0.7em !important;
    box-sizing: border-box !important;
    transition: border 0.2s, box-shadow 0.2s !important;
}
    justify-content: center;
    margin-bottom: 2em;
}
/* Staff-boks uten border, med bakgrunnsbilde som dekker hele boksen */
.staff-box-public {
    background: #23272a;
    color: #fff;
    border-radius: 18px;
    min-width: 150px;
    max-width: 170px;
    box-shadow: 0 2px 8px #0005;
    display: flex;
    flex-direction: column;
    gap: 0.7em;
    border: none !important;
    background-size: cover !important;
    background-position: center !important;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    margin-bottom: 0.5em;
    align-items: center;
}

/* Modal med avrundede hjørner og sentrert innhold */
.staff-modal-content {
    background: #23272a;
    color: #fff;
    border-radius: 18px;
    padding: 2em 2em 1.5em 2em;
    max-width: 400px;
    margin: 5% auto;
    box-shadow: 0 4px 24px #000a;
    text-align: center;
    position: relative;
}
.staff-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}
.staff-modal-close {
    position: absolute;
    top: 0.7em;
    right: 1em;
    font-size: 2em;
    color: #fff;
    cursor: pointer;
    background: none;
    border: none;
}
.staff-box-public:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 8px 32px #000a;
}
.staff-box-public .staff-img-square {
    transition: transform 0.22s cubic-bezier(.4,1.6,.6,1);
}
.staff-box-public:hover .staff-img-square {
    transform: scale(1.13);
    z-index: 2;
}
/* Midtstill tekst i adminpanelet */
.admin-main,
.admin-main h1,
.admin-main h2,
.admin-main h3,
.admin-main p,
.admin-main label,
.admin-main .section-title,
.admin-main .desc,
.admin-main .info,
.admin-main .error {
    text-align: center !important;
}
body.dark-mode header h1,
body.dark-mode header nav,
body.dark-mode main h1,
body.dark-mode main h2,
body.dark-mode main h3,
body.dark-mode main p,
body.dark-mode main label {
    text-align: center;
}
/* Midtstill alle admin-skjemaer, knapper og tekstbokser */
.admin-main form,
.admin-main .rule-box,
.admin-main .content-box,
.admin-main .tile-box,
.admin-main .staff-box,
.admin-main .rules-grid,
.admin-main .footer-box {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.admin-main input,
.admin-main textarea,
.admin-main button {
    margin-left: auto;
    margin-right: auto;
    display: block;
}
/* For forms uten .admin-main wrapper */
form[method="post"] {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
form[method="post"] input,
form[method="post"] textarea,
form[method="post"] button {
    margin-left: auto;
    margin-right: auto;
    display: block;
}
/* Dark mode og generell stil for nettsiden og adminpanel */

body.dark-mode {
    background: #333333;
    color: #e0e0e0;
    font-family: 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}
body.index-bg {
    background: var(--index-bg, #181a1b) !important;
}

footer {
    background: #181a1b;
    color: #aaa;
    text-align: center;
    padding: 1.5em 0 0.5em 0;
    margin-top: 2em;
    box-shadow: 0 -2px 8px #0005;
    width: 100%;
    position: relative;
    bottom: 0;
    left: 0;
    z-index: 10;
    border-radius: 18px 18px 0 0;
}
nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5em;
}
nav a {
    position: relative;
    padding: 0.2em 0.7em;
}
nav a:not(:last-child)::after {
    content: '|';
    color: #888;
    position: absolute;
    right: -0.5em;
    top: 0;
    font-size: 1.1em;
    font-weight: normal;
}
nav a {
    color: #0062f7;
    text-decoration: none;
    padding: 0.2em 0.7em;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    font-weight: bold;
}
nav a:hover, nav a.active {
    background: #e6eaff;
    color: #3a53c5;
}

footer {
    background: #000;
    color: #aaa;
    padding: 1.5em 1em;
    text-align: center;
    box-shadow: 0 -2px 8px #0004;
    border-radius: 18px 18px 0 0;
}
footer a {
    color: #1846a3;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s;
}
footer a:hover {
    color: #4da6ff;
    text-decoration: underline;
}

main {
    padding: 0;
    max-width: 100vw;
    margin: 0;
}

/* Forside hero-stil */
.hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: none;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: transparent;
    z-index: 1;
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    margin-top: 4em;
}
.hero-title {
    font-size: 2.8em;
    font-weight: bold;
    margin-bottom: 0.5em;
    text-shadow: 0 2px 16px #000a;
}
.hero-desc {
    font-size: 1.3em;
    margin-bottom: 2em;
    color: #e0e0e0;
}
.hero-btns {
    display: flex;
    gap: 1.2em;
    justify-content: center;
    position: relative;
    z-index: 3;
    pointer-events: auto;
}
.hero-btn {
    background: #0062f7;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    padding: 0.9em 2.2em;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px #0005;
    position: relative;
    z-index: 4;
    /* pointer-events fjernet for å sikre at knapper er klikkbare */
}
.hero-btn.secondary {
    background: #23272a;
    color: #fff;
}
.hero-btn:hover {
    background: #0050c7;
    color: #fff;
}

/* Grid og bokser */
/* 1 kolonne på mobil, 5 på desktop */
/* 1 kolonne på mobil, 5 på desktop, ingen gap */
/* 1 kolonne på mobil, 5 på desktop, smale og tett sammen, midtstilt */
/* 1 kolonne på mobil, 5 på desktop, liten gap mellom boksene */

.rules-grid.staff-public-grid {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 32px;
        justify-content: center;
}
@media (min-width: 900px) {
    .rules-grid.staff-public-grid {
        grid-template-columns: repeat(5, minmax(150px, 170px));
        gap: 32px;
        justify-content: center;
    }
}

.rule-box {
    background: #333333;
    color: #fff;
    padding: 1.2em 1em;
    border-radius: 10px;
    min-width: 120px; /* Reduced to make boxes even shorter */
    padding: 0.4em 0.3em; /* Further reduced padding */
    flex: 1 1 220px;
    box-shadow: 0 2px 8px #0005;
    display: flex;
    flex-direction: column;
    gap: 0.7em;
    align-items: center;
}
.rule-box input, .rule-box textarea, .rule-box button {
    background: #23272a;
    color: #e0e0e0;
    border: none;
    border-radius: 5px;
    padding: 0.6em;
    font-size: 1em;
}
.rule-box button {
    background: #0062f7;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.rule-box button:hover {
    background: #0050c7;
    color: #fff;
}

textarea {
    background: #23272a;
    color: #e0e0e0;
    border-radius: 5px;
    border: none;
    padding: 0.7em;
    font-size: 1em;
    resize: vertical;
}

.img {
    border-radius: 8px;
    box-shadow: 0 2px 8px #0006;
}

.admin-login-container {
    max-width: 420px;
    margin: 5em auto;
    background: #333333;
    padding: 2.5em 2em 2em 2em;
    border-radius: 16px;
    box-shadow: 0 6px 32px #000a;
    border: 1.5px solid #23272a;
    text-align: center;
}

/* Midtstill alle skjemaer og bokser i adminpanel */
.admin-main form {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.admin-main .content-box, .admin-main .tile-box, .admin-main .staff-box, .admin-main .rule-box {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}
.admin-login-container input, .admin-login-container button {
    width: 100%;
    margin-bottom: 1em;
    padding: 0.9em;
    border: 1.5px solid #23272a;
    border-radius: 7px;
    background: #23272a;
    color: #e0e0e0;
    font-size: 1.08em;
    font-weight: 500;
}
.admin-login-container input:focus {
    outline: 2px solid #0720b8;
    background: #181a1b;
}
.admin-login-container button {
    background: #0062f7;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
}
.admin-login-container button:hover {
    background: #0050c7;
}

.error {
    color: #ff4d4d;
    margin-bottom: 1em;
    font-weight: bold;
}

.rules-grid {
    /* grid-variant beholdes, flex-variant fjernes */
}
.rule-box {
    /* behold glass-effekt og grid-variant, fjern flex-variant for regler */
}
.rule-box input, .rule-box textarea, .rule-box button {
    background: #181a1b;
    color: #e0e0e0;
    border: none;
    border-radius: 5px;
    padding: 0.6em;
    font-size: 1em;
}
.rule-box button {
    background: #00b4d8;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.rule-box button:hover {
    background: #5865f2;
}

textarea {
    background: #181a1b;
    color: #e0e0e0;
    border-radius: 5px;
    border: none;
    padding: 0.7em;
    font-size: 1em;
    resize: vertical;
}

img {
    border-radius: 0;
    box-shadow: none;
}

/* Ensure rule-box dimensions are applied correctly */
.rule-box {
    min-width: 100px !important; /* Forcefully reduce width */
    padding: 0.3em 0.2em !important; /* Forcefully reduce padding */
}

/* Correcting rule-box width adjustment */
.rule-box {
    max-width: 500px !important; /* Adjusted width to make boxes narrower */
}

/* Make the entire website responsive for mobile devices */
@media (max-width: 600px) {
    body {
        font-size: 14px; /* Adjust font size for smaller screens */
        padding: 0 1em; /* Add padding to prevent content from touching edges */
    }
    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    nav {
        display: flex;
        flex-direction: column;
        gap: 0.5em; /* Add spacing between navigation links */
    }
    nav a {
        padding: 0.5em; /* Increase clickable area for links */
    }
    .glass-box, .content-box, .tile-box, .staff-box, .rule-box {
        max-width: 100% !important; /* Ensure boxes fit within screen width */
        margin: 1em auto; /* Center align boxes */
    }
    .rules-grid {
        grid-template-columns: repeat(1, 1fr); /* Single column layout for grids */
        gap: 1em; /* Add spacing between grid items */
    }
    footer {
        text-align: center;
        padding: 1em 0; /* Adjust footer padding */
    }
    /* Ensure team members are centered on mobile */
    .staff-box {
        display: flex;
        flex-direction: column;
        align-items: center; /* Center align team members */
        margin: 0 auto; /* Center the box itself */
    }
    .staff-img-square {
        margin: 0 auto; /* Center the image inside the box */
    }
}

/* Adjusted input and textarea sizes for the contact form */
form input[type="text"],
form input[type="email"] {
    width: 100%;
    max-width: 600px;
    padding: 1em;
    font-size: 1.1em;
}

form textarea {
    width: 100%;
    max-width: 600px;
    padding: 1em;
    font-size: 1.1em;
    height: 200px; /* Increased vertical size */
    resize: vertical; /* Allow vertical resizing */
}

/* Added glass effect and white text for contact form fields */
form input[type="text"],
form input[type="email"],
form textarea {
    background: rgba(24, 70, 163, 0.18) !important; /* Force glass effect background */
    border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    color: #fff !important; /* Ensure white text */
}

form input[type="text"]::placeholder,
form input[type="email"]::placeholder,
form textarea::placeholder {
    color: rgba(255, 255, 255, 0.6); /* Semi-transparent white for placeholder text */
}
