/* General resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #104630;
    color: #ffffff;
    line-height: 1.6;
}

/* Flash Message Overlay Styles */
.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    animation: fadeIn 0.3s ease-in-out;
}

.flash-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a5a3a 0%, #104630 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    z-index: 9999;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flash-modal.flash-error {
    border: 2px solid rgba(220, 38, 38, 0.5);
}

.flash-modal.flash-success {
    border: 2px solid rgba(34, 197, 94, 0.5);
}

.flash-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.flash-error .flash-icon {
    color: #dc2626;
}

.flash-success .flash-icon {
    color: #22c55e;
}

.flash-content {
    text-align: center;
    margin-bottom: 24px;
}

.flash-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ffffff;
}

.flash-message {
    font-size: 16px;
    color: #d3d3d3;
    line-height: 1.5;
}

.flash-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #d3d3d3;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.flash-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.flash-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.flash-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.flash-error .flash-btn {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.flash-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.flash-error .flash-btn:hover {
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.flash-btn:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Responsive flash modal */
@media (max-width: 768px) {
    .flash-modal {
        max-width: 90%;
        padding: 24px;
    }
    
    .flash-title {
        font-size: 20px;
    }
    
    .flash-message {
        font-size: 14px;
    }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.header img {
    display: block;
    margin: 0 auto;
    width: 200px;
    padding-bottom: 20px;
}

h2 {
    font-size: 1.4rem;
    color: #ffffff;
    padding-bottom: 10px;
}

/* Status Section */
.status-section, .connection-section, .bands-section {
    background-image: radial-gradient(100% 100% at 100% 0, #329045 0, #177039 100%);
    box-shadow: rgba(35, 66, 43, 0.4) 0 4px 8px,rgba(35, 66, 43, 0.4) 0 14px 26px -6px,rgba(35, 66, 43, 0.4) 0 -6px 0 inset;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.status-grid, .connection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 3 kolonner på større skærme */
    gap: 20px;
}

.status-item, .connection-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 1px solid #c7c7c781;
    border-radius: 8px;
    box-shadow: 2px 2px 1px black inset;
    background-color: #24683281;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-item span, .connection-item span {
    font-size: 14px;
    font-weight: 600;
    color: #d3d3d3;
    margin-bottom: 5px;
}

.status-item p, .connection-item p {
    color: white;
    font-size: 20px;
    word-wrap: break-word; /* Tillader lang tekst at bryde linjen */
}

.status-item h1, .connection-item h1 {
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
}

.connected {
    color: #208b5f;
    font-weight: bold;
}

/* Bands Section */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
}

th {
    background-color: #0a2a1d;
    color: white;
}

td {
    background-color: #f9f9f900;
}

footer {
    text-align: center;
    margin-top: 20px;
}

.restart-btn {
    padding: 10px 20px;
    background-color: #208b5f;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.restart-btn:hover {
    background-color: #1a6f4c;
}

/* Styling for navigation bar */
.navbar {
    display: flex;
    align-items: center;
    background-color: #0a2a1d;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
}

.nav-links{
    flex: 1;
    text-align: right;
}

.nav-links ul li{
    padding: 8px 12px;
    display: inline-block;
    position: relative;
    list-style: none;
}

.nav-links ul li a{
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
}

.nav-links ul li::after{
    content: '';
    width: 0;
    height: 2px;
    background: #208b5f;
    display: block;
    margin: auto;
    transition: 0.5s;
}

.nav-links ul li:hover::after{
    width: 100%;
}

.logo{
    margin-top: 6px;
}

.logo img {
    width: 100px;
}

/* Lodret streg efter logoet */
.separator {
    height: 30px;
    width: 2px;
    background-color: #ccc;
    margin: 0 15px;
}

/* Tekstfelt ved siden af logoet */
.app-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffffff;
}

/* Styling for burger-menu (mobile view) */
.burger-menu {
    display: flex;
    justify-content: flex-end;
    padding: 10px;
}

.burger-menu button {
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    color: #ffffff;
    position: absolute;
    top: 13%;
    right: 20px;
}

.offcanvas {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100%;
    background-color: #0a2a1d;
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
}

.offcanvas.open {
    right: 0;
}

.offcanvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.offcanvas-body {
    padding: 10px;
}

/* Dropdown menu styles */
.menu-dropdown {
    list-style-type: none;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px;
    color: #ffffff;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.dropdown-toggle:hover {
    background-color: rgba(32, 139, 95, 0.3);
    color: #ffffff;
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.dropdown-menu {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.dropdown-menu.show {
    max-height: 500px;
    transition: max-height 0.4s ease-in;
}

.dropdown-menu li {
    list-style-type: none;
}

.dropdown-menu .btn-link {
    padding-left: 25px;
    font-size: 0.95rem;
    color: #d0e8de;
}

.dropdown-menu .btn-link:hover {
    background-color: rgba(32, 139, 95, 0.2);
    color: #ffffff;
}

.btn-close {
    position: absolute;
    top: 12px;
    right: 23px;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    color: #ffffff;
}

.list-unstyled {
    list-style-type: none;
    padding: 0;
}

.btn-link {
    display: block;
    padding: 10px;
    color: #ffffff;
    text-decoration: none;
}

.btn-link:hover {
    color: #208b5f;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.overlay.show {
    display: block;
}

/* Responsive styles */
@media (max-width: 768px) {
    .burger-menu button {
        font-size: 30px;
        cursor: pointer;
        background: none;
        border: none;
        color: #ffffff;
        position: absolute;
        top: 13%;
        right: 20px;
        width: auto;
    }

    .btn-close {
        width: auto;
        font-size: 20px;
        position: absolute;
        top: 12px;
        right: 23px;
        font-size: 30px;
    }
    .offcanvas {
        width: 250px;
    }
    .offcanvas-header {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .burger-menu button {
        font-size: 30px;
        cursor: pointer;
        background: none;
        border: none;
        color: #ffffff;
        position: absolute;
        top: 13%;
        right: 20px;
        width: auto;
    }

    .btn-close {
        width: auto;
        position: absolute;
        top: 12px;
        right: 23px;
        font-size: 30px;
    }

    .offcanvas {
        width: 200px;
    }

    .offcanvas-header {
        padding: 20px;
    }

    .offcanvas-body {
        padding: 8px;
    }

    .btn-link {
        padding: 8px;
        font-size: 0.9rem;
    }
}


@media (max-width: 480px) {
    .header img {
        width: 150px;
    }

    .status-grid, .connection-grid {
        grid-template-columns: 1fr; /* Enkelt kolonne på små skærme */
    }

    .status-item p, .connection-item p {
        font-size: 1rem;
    }

    .restart-btn {
        width: 100%;
        padding: 12px;
    }
}

/* Bands Section - responsive table */
@media (max-width: 768px) {
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    thead {
        display: none;
    }

    tbody, tr {
        display: block;
        width: 100%;
    }

    tr {
        margin-bottom: 15px;
        border-bottom: 2px solid #ddd;
    }

    td {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        border: none;
    }

    td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #ffffff;
    }

    td:nth-child(odd) {
        background-color: #f7f7f728;
    }

    .personnel_scrollbox{

        height: 37dvh;
        line-height:2em;
        overflow:auto;
        border-radius: 8px;
        border-width: 30px;
        border-color: #ffffff;
        text-align: center;
        align-items: center;
        border: 1px groove;
        padding: 10px;
        box-shadow: 2px 2px 1px black inset;
        background-color: #3d3d3d63;
        
    }

}

/* Generel justering for mobil */
@media (max-width: 480px) {
    .status-item p, .connection-item p {
        font-size: 1rem;
    }

    .restart-btn {
        width: 100%;
        padding: 12px;
    }
}


.personnel_scrollbox{

    height: 45vh;
    line-height:2em;
    overflow:auto;
    border-radius: 8px;
    border-width: 30px;
    border-color: #ffffff;
    text-align: center;
    align-items: center;
    border: 1px groove;
    padding: 10px;
    box-shadow: 2px 2px 1px black inset;
    background-color: #3d3d3d63;
    
}

.log_scrollbox{

    height: 55vh;
    min-width: 270px;
    line-height:2em;
    overflow: auto;
    border-radius: 5px;
    border-width: 30px;
    border-color: #ffffff;
    background-color: #79797911;

}

.phonebook h2, .phonebook h3 {
    color: #aed9cc;
}

.person {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    text-align: center;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #c7c7c781;
    border-radius: 8px;
    box-shadow: 2px 2px 1px black;
    background-color: #30954581;
    align-items: center;
}

.name, .phonenumber, .email {
    flex: 1;
    margin-right: 10px;
    color: white;
    word-break: break-word;
}

.remove-btn {
    background-color: #ff6b6b;
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.add-btn {
    background-color: #5aab83;
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.remove-btn:hover {
    background-color: #ff4c4c;
}

.tab-buttons {
    text-align: center;
    margin-bottom: 20px;
}

.tab-buttons button {
    background-color: #5aab83;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.tab-buttons button.active {
    background-color: #48976a;
}

.search_button {

    float: left;
    width: 20%;
    padding: 10px;
    background: #2196F3;
    color: white;
    font-size: 17px;
    border-radius: 5px;
    border-left: none;
    cursor: pointer;

}

.phonebook h2 {
    color: #aed9cc;
}

.container h1 {
    text-align: center;
    color: #ffffff;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #aed9cc;
}

input[type="text"], input[type="email"], select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #aec9b8;
    background-color: #ebf5ee;
}

.add_button {
    background-color: #5aab83;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
}

.add_button:hover {
    background-color: #48976a;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #aed9cc;
    text-decoration: none;
}

.back-link:hover {
    color: #ebf5ee;
}

/* RESPONSIVE DESIGN */
/* Når skærmen er mindre end 768px (tablet/telefon), vil grid-layoutet ændres til en kolonne */
@media (max-width: 768px) {
    .person {
        grid-template-columns: 1fr;
        gap: 5px;
        text-align: center;
    }

    .person span {
        display: block;
    }

    .name, .phonenumber, .email {
        padding: 5px 0;
    }

    .remove-btn {
        margin-top: 10px;
        align-self: flex-start;
    }

    .container {
        width: 90%;
    }

    input[type="text"], input[type="email"], select, button {
        width: 100%;
    }
}

input[type="tel"], select, textarea {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #aec9b8;
    background-color: #ebf5ee;
    font-size: 16px;
}

textarea {
    resize: none;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.action-buttons .btn {
    background-color: #5aab83;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    width: 48%;
    text-align: center;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

.action-buttons .btn:hover {
    background-color: #48976a;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #aed9cc;
    text-decoration: none;
}

.back-link:hover {
    color: #ebf5ee;
}

select {
    max-height: 200px; /* Sætter en maks-højde for dropdown */
    overflow-y: auto;  /* Gør den scrollbar, hvis den overstiger maks-højde */
}

/* Responsivt design */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    select {
        width: 100%;   /* Sørger for, at dropdown fylder hele containerens bredde */
        padding: 10px;
        font-size: 16px;
        border-radius: 5px;
        background-color: #ebf5ee;
        border: 1px solid #aec9b8;
    }
    .edit_button {
        top: 7px; 
        right: 7px; 
        width: 35px; 
    }
}

/* Adjusting the edit button position */
.edit_button {
    top: 10px; 
    right: 10px; 
    width: 40px; 
    position: absolute;
    cursor: pointer;
    z-index: 1;  /* Ensure the button stays on top */
}

/* Styling for the edit icon */
.edit_icon {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 480px) {
    .edit_button {
        top: 7px; 
        right: 7px; 
        width: 30px; 
    }
}

.log_line {
    flex: 1;
    border-bottom: 2px solid rgb(255, 255, 255);
  }

.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.loader {
    border: 16px solid #f3f3f3;
    border-top: 16px solid #4CAF50;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.center-text {
    text-align: center;
}

/* Basic styling for the modal */
.modal {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 1; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgb(0,0,0); 
    background-color: rgba(0,0,0,0.4); 
    padding-top: 60px; 
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 80%; 
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#file-content {
    margin-bottom: 20px;
}

.error-message{

    width: 68vw;
    height: 40vh;
    background-image: radial-gradient(100% 100% at 100% 0, #104630 0, rgb(19, 85, 44) 100%);
    border-radius: 5px;
    box-shadow: rgba(35, 66, 43, 0.4) 0 2px 4px,rgba(35, 66, 43, 0.4) 0 7px 13px -3px,rgba(35, 66, 43, 0.4) 0 -3px 0 inset;
    text-align: center;
    left: 50vw;
    top: 50vh;
    position: absolute;
    padding: 10px 10px;
    font-size: large;
    z-index: 2;
    transform: translate(-50%, -50%);

}

.succes-message{

    width: 68vw;
    height: 40vh;
    background-image: radial-gradient(100% 100% at 100% 0, #104630 0, rgb(19, 85, 44) 100%);
    border-radius: 5px;
    box-shadow: rgba(35, 66, 43, 0.4) 0 2px 4px,rgba(35, 66, 43, 0.4) 0 7px 13px -3px,rgba(35, 66, 43, 0.4) 0 -3px 0 inset;
    text-align: center;
    left: 50vw;
    top: 50vh;
    position: absolute;
    padding: 10px 10px;
    font-size: large;
    z-index: 2;
    transform: translate(-50%, -50%);

}

.dashboard_button{

    padding: 10px 20px;
    background-color: #208b5f;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;

}

.offcanvas-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.offcanvas-body ul {
    flex-grow: 1;
    text-decoration: none;
}

.offcanvas-body .logout {
    margin-top: auto;
    padding-bottom: 70px;
    text-decoration: none;
    list-style-type: none;
}

/* PLC inputs responsive adjustments */
@media (max-width: 768px) {
    .field-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .field-row label { display:block; color: #aed9cc; margin-bottom:4px }
    .field-row input[type="text"], .field-row input[type="number"], .field-row input[type="tel"], .field-row select {
        width: 100%;
        padding: 8px;
    }
    .field-row .input-number { max-width: 140px; }
    .remove-btn { align-self: flex-end; }
    .action-buttons { flex-direction: column; gap: 8px }
    .action-buttons .btn, .action-buttons button { width: 100%; }
}

@media (max-width: 480px) {
    .field-row { gap: 8px; padding: 6px 0 }
    .field-row input, .field-row select { font-size: 14px }
}

/* Basic button style used across PLC pages */
.btn {
    background-color: #5aab83;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-block;
}
