/* Controls Box */
#controlsBox {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
}

.button-wrapper {
    display: flex; /* or inline-flex */
    flex: 1 1 auto;
}

    .button-wrapper button {
        width: auto;
        flex: 1 1 auto;
        min-width: 120px;
        margin: 0;
    }

@media (max-width: 500px) {
    .button-wrapper {
        flex: 1 1 100%;
    }

        .button-wrapper button {
            width: 100%;
        }
}

/* Preview Box */
#previewBox {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 10px;
}

#video, #photo {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #ccc;
}

@media (min-width: 600px) {
    #video, #photo {
        width: 300px;
    }
}
/* style.css */

/* General Reset and Font */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #e6f7e6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
}

    header img {
        height: 40px;
    }

/* Container and Box */
.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-box,
.auth-box,
.content-box {
    background-color: white;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

    .login-box h1,
    .auth-box h1,
    .content-box h1 {
        text-align: center;
        margin-bottom: 20px;
        color: #2f4f2f;
    }

/* Input Fields */
input[type="email"],
input[type="password"],
input[type="text"],
input[type="submit"],
button {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

button,
input[type="submit"] {
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

    button:hover,
    input[type="submit"]:hover {
        background-color: #45a049;
    }

.help-button {
    float: right;
    width: auto !important;
    padding: 4px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    margin-top: 10px;
}

    .help-button:hover {
        background-color: #45a049
    }

.asset-button {
    max-width: 200px; /* or whatever limit you want */
    width: 100%; /* makes the button fill up to max-width */
    display: block; /* ensures it respects width if inside flex/grid */
    margin: 10px auto; /* optional: center the button */
}

.imageBox.selected {
    outline: 4px solid red;
    opacity: 0.8;
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
}

    .password-wrapper input {
        padding-right: 40px;
    }

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    color: #555;
    user-select: none;
}

/* NavBar */
#navbar {
    background-color: #d6eadf;
    padding: 8px 12px;
    text-align: left;
    position: relative;
    z-index: 500;
}

.main-nav {
    position: relative;
    display: flex;
}

.nav-toggle {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #2f4f2f;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin: 0;
}

    .nav-toggle:hover {
        background-color: #24401f;
    }

.nav-toggle-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 230px;
    max-width: calc(100vw - 24px);
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    z-index: 600;
}

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 14px 18px;
        text-decoration: none;
        color: #2f4f2f;
        font-weight: bold;
        border-bottom: 1px solid #eee;
        white-space: nowrap;
    }

        .nav-links a:last-child {
            border-bottom: none;
        }

        .nav-links a:hover,
        .nav-links a:focus {
            background-color: #d6eadf;
        }

        .nav-links a.active {
            background-color: #e6f7e6;
            border-left: 4px solid #4CAF50;
            padding-left: 14px;
        }

        .nav-links a.logout {
            color: #c0392b;
        }

/* Responsive */
@media (max-width: 500px) {
    .login-box,
    .auth-box,
    .content-box {
        padding: 20px;
    }

    .nav-toggle {
        width: 100%;
        justify-content: center;
    }

    .nav-links {
        left: 0;
        right: 0;
        min-width: unset;
        max-width: unset;
        width: 100%;
    }

        .nav-links a {
            white-space: normal;
        }
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2em;
}

    .dashboard-header h1 {
        font-size: 2.5em;
    }

    .dashboard-header p {
        font-size: 1.2em;
        max-width: 400px;
    }

.header-brand {
    display: flex;
    flex-wrap: wrap;
    align-items: center; /* vertical centering */
    justify-content: space-between; /* title left, logo right */
    padding: 1em 2em;
    gap: 1em;
}

    .header-brand .help-button {
        float: none;
    }

.site-title {
    font-size: 2.5em;
    margin: 0;
    text-align: left;
    white-space: nowrap; /* prevent wrapping */
}

.logo {
    width: 100px;
    height: auto;
    object-fit: contain;
}

/* Mobile breakpoint */
@media (max-width: 400px) {
    .site-title {
        white-space: normal;
        text-align: left;
    }
}

.asset-headerbox {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    background-color: #d6eadf;
}

    .asset-headerbox h2 {
        margin: 0;
    }

    .asset-headerbox select,
    .asset-headerbox .group-picker {
        margin-bottom: 0;
        max-width: 100%;
    }

video,
canvas,
img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 1rem;
}

#map {
    width: 100%;
    height: calc(100vh - 60px);
    min-height: 420px;
    position: relative; /* Needed for absolute positioning of children */
}

h2 {
    font-size: 24px;
}

.map-title {
    color: yellow;
}

/* Container for the icon, heading, and button */
#header-container {
    position: absolute;
    right: 10px; /* Place on the right */
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px; /* Adds space between the icon, heading, and button */
    z-index: 1000;
}

    #header-container .map-title {
        margin-right: auto;
    }

    #header-container select,
    #header-container button,
    #header-container .group-picker {
        width: auto;
        margin: 0;
    }

    /* Adjust the size of the icon */
    #header-container img {
        width: 40px;
        height: 40px;
    }

@media (max-width: 500px) {
    #header-container {
        justify-content: center;
    }

        #header-container .map-title {
            width: 100%;
            margin-right: 0;
            text-align: center;
        }
}

/* Used for Gyro Data */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    border: 1px solid #999;
    padding: 6px;
    text-align: center;
}

#popup {
    display: none;
    position: absolute;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    padding: 10px;
    text-align: left;
    max-width: 300px;
    word-wrap: break-word;
    color: #004280;
}

.help-container {
    max-width: 100%;
    padding: 1em;
}

@media (min-width: 600px) {
    .help-container {
        max-width: 700px;
        margin: auto;
        padding: 2em;
    }
}

@media (min-width: 1000px) {
    .help-container {
        max-width: 900px;
    }
}

.help-headerbox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1em;
    background-color: #d6eadf;
}

.help-content img {
    max-width: 100%;
    height: auto;
}

/* Group Picker (buttons replacing the old <select> dropdown) */
.group-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    max-width: 100%;
}

.group-btn {
    width: auto;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 8px 16px;
    border: 2px solid #4CAF50;
    border-radius: 20px;
    background-color: white;
    color: #2f4f2f;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

    .group-btn:hover {
        background-color: #e6f7e6;
    }

    .group-btn.active {
        background-color: #4CAF50;
        color: white;
    }

.group-picker-empty {
    color: #555;
    font-style: italic;
}

.group-picker-label {
    font-weight: bold;
    margin-bottom: 8px;
}

@media (max-width: 500px) {
    .group-picker {
        width: 100%;
    }

        .group-picker .group-btn {
            flex: 1 1 auto;
            text-align: center;
        }
}

.upload-box {
    max-width: 600px;
}

#imageGrid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.imageBox {
    width: clamp(96px, 30vw, 150px);
    height: clamp(96px, 30vw, 150px);
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #ccc;
    background: white;
}

#previewModal {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow-y: auto;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    margin: auto;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.button-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

    .button-row button {
        width: auto;
        flex: 1 1 auto;
        min-width: 120px;
        margin: 0;
    }

#previewImage {
    max-width: 90vw;
    max-height: 65vh;
    object-fit: contain;
    border: 4px solid white;
    border-radius: 10px;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.6);
}

#downloadBtn {
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}

.download-btn {
    background-color: #4CAF50;
    color: white;
}

.delete-btn {
    background-color: #f44336;
    color: white;
}

.fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-in {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.logo-header img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

@media (min-width: 768px) {
    .logo-header img {
        width: 100px;
        height: 100px;
    }
}

select, input[type="file"], button {
    padding: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    display: block;
}

#status {
    margin-top: 1rem;
    font-weight: bold;
}

.section {
    border: 1px solid #ccc;
    padding: 1rem;
    margin-bottom: 2rem;
    background: white;
}

.upload-status {
    margin: 0.25rem 0;
}