/* ========== GRUNDINSTÄLLNING ========== */
body {
    font-family: Arial, sans-serif;
    background-color: #f2f2f2;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* ======= OPERATÖRSSIDAN (tm/index.php) ======= */
.oper-body {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Operatörsformulär */
.oper-form {
    width: 100%;
    max-width: 780px;
    background-color: white;
    padding: 20px;
    margin: 0 auto 20px auto;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

/* Två kolumner layout */
.row-two {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* Form-grupper för kolumner */
.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Rubriker på operatörssidan */
.oper-form .form-group label {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
    padding-left: 30px;
}

/* Inputs/dropdown för operatörssidan */
.oper-form .form-group select,
.oper-form .form-group input {
    font-size: 28px;
    padding: 29px 12px;
    width: calc(100% - 40px);
    box-sizing: border-box;
    margin: 0 auto;
}

/* Ladda-knappen på operatörssidan */
.oper-form button {
    font-size: 28px;
    background-color: #4CAF50;
    color: white;
    padding: 25px 0;
    width: calc(100% - 40px);
    margin: 0 auto;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: block;
}

.oper-form button:hover,
.oper-form button:focus {
    background-color: #388e3c;
}

/* Statistikbox */
.statistics {
    width: 100%;
    max-width: 780px;
    background-color: white;
    padding: 20px;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    font-size: 17px;
    margin-top: 0;
    text-align: center;
    box-sizing: border-box;
    position: relative;
    z-index: 1; /* Visas över overlay */
}

.statistics h2 {
    font-size: 17px;
    margin-top: 0;
    margin-bottom: 6px;
    display: inline;
}

.statistics .summering {
    font-size: 17px;
    font-weight: bold;
    display: inline;
    margin-left: 12px;
}

.statistik-tabell {
    width: 94%;
    border-collapse: collapse;
    margin: 0 auto;
    margin-top: 8px;
    font-size: 17px;
}

.statistik-tabell th, .statistik-tabell td {
    border: 1px solid #ccc;
    text-align: center;
    padding: 6px;
}

/* Fullscreen-knapp i absolut övre högra hörnet */
.fullscreen-button {
    position: fixed;
    top: 0;
    right: 0;
    font-size: 14px;
    background-color: #333;
    color: white;
    padding: 8px 10px;
    border-radius: 0 0 0 6px;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease;
    z-index: 9999;
}

.exit-fullscreen-button {
    position: fixed;
    top: 0;
    right: 0;
    font-size: 12px;
    background-color: #ccc;
    color: black;
    padding: 6px 10px;
    border-radius: 0 0 0 6px;
    cursor: pointer;
    display: none;
    z-index: 9999;
}

/* Anpassning vid låg höjd */
@media screen and (max-height: 800px) {
    .oper-body {
        padding: 20px 0;
    }
    .oper-form {
        padding: 10px;
    }
    .oper-form .form-group label {
        font-size: 16px;
    }
    .oper-form .form-group select,
    .oper-form .form-group input {
        font-size: 24px;
        padding: 26px 10px;
        width: calc(100% - 40px);
    }
    .oper-form button {
        font-size: 24px;
        padding: 23px 0;
        width: calc(100% - 40px);
    }
    .statistics {
        font-size: 15px;
        padding: 10px;
    }
    .statistics h2 {
        font-size: 15px;
    }
    .statistics .summering {
        font-size: 15px;
    }
    .statistik-tabell {
        font-size: 15px;
    }
}

/* Fade-in-animation för statistikuppdatering */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Bekräftelse-overlay med nedräkning */
#confirmationOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 128, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease;
}

#confirmationOverlay.active {
    opacity: 1;
    visibility: visible;
}

#confirmationOverlay .checkmark {
    font-size: 120px;
    color: white;
    text-align: center;
    animation: popscale 0.6s ease;
}

#confirmationOverlay #countdownText {
    font-size: 48px;
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

@keyframes popscale {
    0%   { transform: scale(0.4); opacity: 0; }
    50%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1);   opacity: 1; }
}
