@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');

:root {
  --background: #151A20;
  --text1: #ffffff;
  --border: #ffffff3a;
  --shadow: #0A0C0F;
  --fill-percent: 50%;
}

html {
    font-family: "Varela Round", sans-serif;
    height: 100%;
    margin: 0;
    font-weight: 300;
    font-size: 20px;
    color: var(--text1);
    text-align: center;
}

body {
    background-color: var(--background);
    max-width: 1200px;
    height: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 0;
    padding-left: 20px;
    padding-right: 20px;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: "Varela Round", sans-serif;
    font-weight: 300;
    color: var(--text1);
    margin-top: 20px;
}

h4 {
    overflow-wrap: break-word;
    word-break: break-word;
}

a {
    color: var(--text1);
    text-decoration-line: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
    text-decoration-color: var(--border);
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    padding: 20px;
}

form #openModal {
    text-decoration: none;
    color: #007aff;
}

#title {
    font-family: "Varela Round", sans-serif;
    font-weight: 300;
    margin-top: 40px;
    text-align: left;

}

#title-follow {
    font-family: "Varela Round", sans-serif;
    font-weight: 300;
    color: var(--text1);
    text-align: left;
    margin-top: -15px;
}

.app-intro {
    max-width: 720px;
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 1.05rem;
    text-align: start;
}

/* ------------------------application page--------------------------------- */

#app-body form {
    padding: 0;
}

.title-mb-2 {
    margin-bottom: 2px;

}

.max-width-full {
    max-width: 100%;
}

.nav-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    width: fit-content;
    align-items: center;
    justify-content: space-evenly;
    margin-left: auto;
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.dashboard-link, .account-link, .logout-link, .app-link, .help-link {
    display: inline-flex;
    align-items: center;
    gap: 0px;
    text-decoration: none;
    height: 50px;
    font-size: smaller;
    margin-right: 10px;
    align-items: center;
    justify-content: center;
}

.dashboard-link svg, .account-link svg, .logout-link svg, .app-link svg, .help-link svg {
    flex-shrink: 0;
    width: 50px;
    height: 70%;
    fill: var(--text1);
}

.dashboard-link svg path, .help-link svg path {
  stroke: var(--text1); /* for outlines */
  fill: var(--border);   /* for fills */
}

.dashboard-link svg path[opacity] {
  fill: var(--text1);
  opacity: 0.1; /* keep original transparency */
}

#app-body header h1 {
    display: inline-block;
    margin-right: 20px;
}

#app-body header a {
    display: inline-block;
}

#app {
    display: flex;
    border-radius: 10px;
    border: 2px solid var(--border);
    box-shadow:  0.1em 0.1em 2em var(--shadow);
}

#app h2 {
    text-align: start;
}

#daily-limit {
    /* display: inline-flex; */
    padding: 8px;
    font-size: smaller;
    color: var(--text1);
    border-radius: 6px;
    text-decoration: none;
    background-color: #dc3545;
    margin-left:5px;
    min-width: 100px;
    max-width: 150px;
}

#app-left, #app-right {
    padding: 20px;
}

#app-right {
    max-width: 50%;
    flex-grow: 1;
    position: relative;
}

#app-right::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5%;
    height: 90%;          /* Divider covers 90% height */
    width: 1px;
    background-color: var(--border);
}

#video {
    display: none; /* Hide the video element */
}

#video-feed {
    width: 100%;
    max-width: 640px;
    margin: auto;
    margin-bottom: 10px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

#video,
#canvas {
    width: 100%;
    height: auto;
    display: block;
}

#canvas{
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    color: white;
}

#countdown {
    width: 600px;
    height: 440px;
    text-align: start;
    position: absolute;
    padding: 20px;
    top: 0;
    left: 0;
    z-index: 10;
    font-size: 100px;
    text-shadow: 2px 2px 4px black;
}

#cam-btn {
    margin: auto;
    border-radius: 10px;
    background-color: var(--border);
    width: 25%;
    height: 10px;
    align-items: center;
    border: none;
    box-shadow: 0.1em 0.1em 2em var(--shadow);
    cursor: pointer;
}

#record-btn {
    width: 120px;
    height: 120px;
    padding: 15px;
    margin: 40px;
    color: var(--text1);
    font-size: large;
    background-color: transparent;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    box-shadow: 0.1em 0.1em 2em var(--shadow);
    cursor: pointer;
}

#record-btn svg {
    fill: #EA4146; /* Default SVG color */
    width: 100%;
    height: 80%;
}

#record-btn:hover svg {
    fill: #a4272b; /* Change SVG color on hover */
}

#results-panel h2 {
    margin-top: 0px;
}

#result-list {
    overflow: hidden;
    background-color: var(--border);
    border-radius: 10px;
    box-shadow: inset 20px 20px var(--text1), 
                inset -20px -20px var(--text1);
}

#result-list p {
    padding: 10px;
    margin: 1px;
    color: var(--background);
    background-color: var(--text1);
}

#settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 0px;
    text-decoration: none;
    width: 100%;
    height: 70px;
    background-color: transparent;
    border: none;
    margin: 50px;
    justify-content: center;
    color: var(--text1);
    font-size: large;
    border-radius: 10px;
    box-shadow: 0.1em 0.1em 2em var(--shadow);
    cursor: pointer;
}

#settings-btn svg {
    flex-shrink: 0;
    fill: #007a1a; /* Default SVG color */
    width: 50px;
    height: 50%;
}

#settings-btn:hover svg {
    fill: #004c11; /* Change SVG color on hover */
}

#settings-panel p {
    display: inline-block;
    text-align: start;
}

#top_k_value, #record_duration_value {
    text-align: start !important;
}

#top_k-panel, #record_duration-panel {
    border-radius: 10px;
    width: 100%;
    background-color: var(--border);
    box-shadow: inset 20px 20px var(--text1),
}

#processing-window {
    padding: 20px;
    display: none;
}

/* ------------------------|application page|--------------------------------- */

/* ------------------------login page--------------------------------- */

#main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#login-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: auto;
    padding: 50px;
    border-radius: 10px;
    border: 2px solid var(--border);
    box-shadow:  0.1em 0.1em 2em var(--shadow);
}

#login-panel p {
    margin-top: 0;
}

#login-form {
    max-width: 300px;
}

#forgot-pass {
    margin-top: 5px !important;
    text-align: end;
    text-decoration: none;
    margin-left: auto;
    font-size: smaller;
}

/* ------------------------|login page|--------------------------------- */

/* ------------------------dashboard page--------------------------------- */

#dashboard-panel {
    display: grid;
    text-align: start;
    gap: 28px;
}

#user-requests-panel,
#user-list-panel {
    min-width: 0;
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--background);
    box-shadow: var(--shadow);
}

#dashboard-panel h2 {
    margin: 0 0 12px;
}

#search-form {
    display: flex;
    flex-direction: row;
    max-width: 600px;
    margin: 0;
    margin-top: 0px;
    margin-bottom: 10px;
    margin-left: auto;
    padding: 0;
    gap: 10px;
}

#search-form input[type="submit"] {
    width: auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--background);
    color: #fff;
    cursor: pointer;
    font-weight: 650;
}

.card-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
}

.user-row {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--background);
    box-shadow: 0 4px 14px rgba(27, 55, 59, 0.04);
}

.user-row[open] {
    border-color: rgba(50, 183, 10, 0.797);
}

.user-row-summary {
    display: flex;
    min-height: 76px;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
}

.user-row-summary::-webkit-details-marker {
    display: none;
}

.user-row-summary::after {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-right: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
    content: "";
    transform: rotate(45deg);
    transition: transform 160ms ease;
}

.user-row[open] > .user-row-summary::after {
    transform: rotate(225deg);
}

.user-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 50%;
    background: var(--border);
    color: var(--text1);
    font-weight: 750;
}

.user-summary-main {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.user-name {
    overflow: hidden;
    color: var(--text1);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-email {
    overflow: hidden;
    color: var(--border);
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-summary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.user-badge {
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--border);
    color: var(--text1);
    font-size: 0.78rem;
    font-weight: 650;
}

.user-badge.is-active {
    border-color: rgba(58, 128, 97, 0.25);
    background: #edf6f0;
    color: #2d674d;
}

.user-expand-label {
    color: var(--text1);
    font-size: 0.86rem;
    font-weight: 650;
    white-space: nowrap;
}

.user-row-content {
    padding: 0 18px 18px;
    border-top: 1px solid var(--border);
}

.user-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 0;
    margin: 0;
    padding: 8px 0 16px;
}

.user-detail {
    min-width: 0;
    padding: 10px 12px 10px 0;
}

.user-detail dt {
    color: var(--border);
    font-size: 0.78rem;
    font-weight: 650;
    text-transform: capitalize;
}

.user-detail dd {
    overflow-wrap: anywhere;
    margin: 2px 0 0;
    color: var(--text1);
}

.user-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
}

.user-actions button {
    width: auto;
    padding: 9px 16px;
    font-size: 0.88rem;
}

/* ------------------------|dashboard page|--------------------------------- */

/* ------------------------registration page--------------------------------- */

.text-forms {
    width: 80%;
}

#main-panel-register {
    align-items: center;
    justify-content: center;
    margin-top: 40px;
    padding: 50px;
    border-radius: 10px;
    border: 2px solid var(--border);
    box-shadow:  0.1em 0.1em 2em var(--shadow);
}

#tnc {
    flex-grow: 1;
    font-family: "Varela Round", sans-serif;
    font-weight: 300;
    font-size: 18px;
    border-radius: 10px;
    width: 100%;
    height: inherit;
    background-color: var(--text1);
    color: var(--background);
}

/* ------------------------|registration page|--------------------------------- */

/* ------------------------account page--------------------------------- */

#acc-logout {
    margin-top: 20px;
    background-color: #EA4146;
}

/* ------------------------|account page|--------------------------------- */

#footer-panel {
    display: flex;
    font-size: smaller;
}

#footer-right {
    flex: 1;
    margin-left: auto;
    text-align: end;
}

#footer-left {
    flex: 1;
    margin-right: auto;
    text-align: start;
}

/* On screens that are 1111px or less, set the background color to blue */
@media screen and (max-width: 1111px) {
    /* ------------------------application page--------------------------------- */
    #app {
        display: block;
        align-items: center;
        text-align: center;
    }

    #app-left, #app-right {
        display: block;
        max-width: 100%;
    }

    #app-right::before {
        display: none; /* Hide the divider on smaller screens */
    }
    /* ------------------------|application page|--------------------------------- */
}

/* On screens that are 950px or less, set the background color to blue */
@media screen and (max-width: 950px) {
    /* ------------------------login page--------------------------------- */
    #login-panel {
        padding: 20px;
    }
    /* ------------------------|login page|--------------------------------- */

    /* ------------------------registration page--------------------------------- */
    #main-panel-register {
        padding: 20px;
        align-items: center;
        text-align: center;
    }
    /* ------------------------|registration page|--------------------------------- */

    #footer-panel {
        flex-direction: column;
        text-align: center;
    }
}

/* Mobile view */
@media (max-width: 768px) {
    /* ------------------------dashboard page--------------------------------- */
    #search-form {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 100%;
    }

    #search-form input[type="submit"] {
        width: 100%;
    }

    .user-row-summary {
        flex-wrap: wrap;
        gap: 8px 12px;
        padding: 12px;
    }

    .user-summary-main {
        flex-basis: calc(100% - 72px);
    }

    .user-summary-badges {
        padding-left: 54px;
    }

    .user-expand-label {
        display: none;
    }

    .user-row-content {
        padding: 0 12px 14px;
    }

    .user-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-actions button {
        width: 100%;
        padding: 9px;
    }
    /* ------------------------|dashboard page|--------------------------------- */

    #footer-right {
        text-align: left;
    }

    .title-mb-2 {
        margin-bottom: 20px;
    }

}
















/* Custom input */
form input, form select {
    /* Reset default styles */
    appearance: none;
    -webkit-appearance: none;
    
    /* Box model and typography */
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    box-sizing: border-box;
    
    /* Border and background */
    background-color: var(--text1);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: "Varela Round", sans-serif;
    font-weight: 300;
    
    /* Smooth transition for focus effect */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

form input::placeholder, form select::placeholder {
    color: #a9a9a9;
}

form input:focus, form select:focus {
    /* Remove default outline and apply custom focus style */
    outline: none;
    border-color: #007aff; /* A modern blue for focus */
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

/***** Modern Button CSS *****/
form #submit, .btn-blue, .btn-green, .btn-red, .btn-violet {
    /* Reset default styles */
    appearance: none;
    -webkit-appearance: none;
    border: none;

    /* Box model and typography */
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    box-sizing: border-box;
    font-family: "Varela Round", sans-serif;
    color: white;
    border-radius: 8px;
    cursor: pointer;

    /* Smooth transition for hover/focus effects */
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

form #submit:hover, .btn-blue:hover {
    background-color: #005ecb; /* A slightly darker blue for hover */
}

form #submit:focus {
    /* Consistent focus style with the input */
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

form #submit, .btn-blue {
    background-color: #007aff; /* Blue for primary actions */
}

.btn-green {
    background-color: #28a745; /* Green for success actions */
}

.btn-green:hover {
    background-color: #218838; /* Darker green on hover */
}

.btn-red {
    background-color: #dc3545; /* Red for danger actions */
}

.btn-red:hover {
    background-color: #c82333; /* Darker red on hover */
}

.btn-violet {
    background-color: #6D24FF; /* violet for modarate danger actions */
}

.btn-violet:hover {
    background-color: #3600A3; /* Darker violet on hover */
}



/* Custom input type range */
#settings-panel input {
    padding: 6px 16px;
}

#settings-panel input[type="range"] {
    /* Reset default styles */
    -webkit-appearance: none;
    appearance: none;
    background: transparent; /* Make background transparent */
    cursor: pointer;
    width: 50%;
}

/* Remove focus outline */
#settings-panel input[type="range"]:focus {
    outline: none;
}

/***** Track Styles *****/
#settings-panel input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(to right, var(--text1) var(--fill-percent), #f1f1f1 var(--fill-percent));
    height: 3px;
    border-radius: 2px;
}

#settings-panel input[type="range"]::-moz-range-track {
    background: #f1f1f1; /* Unfilled color */
    height: 3px;
    border-radius: 2px;
}

/***** Filled Track (Progress) Styles *****/
/* This is only for Firefox */
#settings-panel input[type="range"]::-moz-range-progress {
    background-color: var(--text1); /* Filled color */
    height: 3px;
    border-radius: 2px;
}

/***** Thumb Styles *****/
#settings-panel input[type="range"]::-webkit-slider-thumb {
    /* Reset default styles */
    -webkit-appearance: none;
    appearance: none;
    
    /* Position thumb centrally on the track */
    margin-top: -7px; 

    /* Style the thumb */
    background-color: var(--text1);
    height: 17px;
    width: 17px;
    border-radius: 50%;
    border: 1px solid #ddd;
}

#settings-panel input[type="range"]::-moz-range-thumb {
    /* Reset default styles */
    border: none; 

    /* Style the thumb */
    background-color: var(--text1);
    height: 17px;
    width: 17px;
    border-radius: 50%;
    border: 1px solid #ddd;
}


/* Custom checkbox */
.checkbox {
    display: flex;
    align-items: center;
    font-family: sans-serif;
    font-size: smaller;
    cursor: pointer;
    margin-bottom: 20px;
}

.checkbox input {
    display: none; /* Hide native checkbox */
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    margin-right: 8px;
    transition: all 0.2s ease;
    display: inline-block;
    position: relative;
}

.checkbox input:checked + .checkmark {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

.checkbox input:checked + .checkmark::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}


/* Custom progress bar */
#processing-bar {
    width: 100%;
    height: 5px; /* A bit thicker for better visibility */
    background-color: transparent; /* Transparent by default */
    border-radius: 3px;
    overflow: hidden; /* Ensures the inner bar doesn't spill out */
    position: relative;
    transition: background-color 0.3s ease; /* Smooth transition for the track color */
}

/* The animated inner bar, created using a pseudo-element */
#processing-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #007aff; /* A modern blue for the loading animation */
    border-radius: 3px;
    
    /* Start off-screen and with no animation */
    transform: translateX(-100%);
    animation: none;
}

/* The active 'is-loading' state */
#processing-bar.is-loading {
    /* When loading, the track becomes visible */
    background-color: var(--border); 
}

#processing-bar.is-loading::before {
    /* When loading, apply the looping animation */
    animation: indeterminate-progress 2s infinite ease-in-out;
}

/* Keyframe animation for the indeterminate progress bar */
@keyframes indeterminate-progress {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(100%);
    }
}


/* Modal (hidden by default) */
.modal {
    display: none; /* Hidden */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8); /* Dark overlay */
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

/* Modal Content */
.modal-content {
    background: white;
    color: var(--background);
    width: 90%;
    height: 90%;
    padding: 20px;
    border-radius: 10px;
    overflow-y: auto;
    position: relative;
}

.modal-content h2 {
    color: var(--background);
}

.modal-content img {
    overflow: hidden;
    border-radius: 10px;
    width: 100%;
}

/* Close button */
.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: var(--background);
    cursor: pointer;
}