/* 
    #F05039      red
    #E57A77      pink
    #EEBAB4      light pink
    #1F449C      blue
    #3D65A5      dark blue
    #7CA1CC      light blue
    #A8B6CC      gray
   */

:root {
    --primary-color: #3D65A5;
    --secondary-color: #f4f4f4;
    --background-color: rgba(255, 255, 255, 1.0);
    --danger-color: #f443367e;
    --danger-text: #460612;
    --warning-color: #FFA500;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #ccc;
    --border-light: #ddd;
    --success-color: #4caf50;
    --hover-bg: #f5f5f5;
    --selected-bg: #e3f2fd;
    --action-bg: #f8f9fa;
    --disabled-text: #999;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --font-family: 'Poppins', sans-serif;
    --border-radius: 10px;
    --logo: url('/images/shiftwell-emblem.png')
}

/* Watermark styling */
.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    font-size: 8rem;
    font-weight: bold;
    color: rgba(128, 128, 128, 0.15);
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 0.5rem;
    pointer-events: none;
    user-select: none;
    z-index: 1000;
    font-family: var(--font-family);
    white-space: nowrap;
}

/* MARK: Global Styles */

html,
body {
    height: 100%;
}



body {
    font-family: var(--font-family);
    margin: 0px;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.tab-panels {
    flex: 1;
    width: 100%;
    margin-top: 0px;
    border-top: 4px solid var(--primary-color);
    max-height: calc(100vh - 90px);
}

.footer {
    text-align: center;
    background-color: var(--primary-color);
    position: fixed;
    bottom: 0;
    width: 100%;
}

.footer p {
    padding: 3px;
    font-size: 12px;
    color: var(--background-color);
    margin-top: auto;
    margin-bottom: 0;
}

.footer a {
    color: var(--background-color);
    text-decoration: none;
    font-weight: 600;
}

.language-panel {
    margin: 20px auto 30px auto;
    width: 100%;
    text-align: center;
    padding-bottom: 20px;
}

h1 {
    color: var(--text-color);
    font-weight: 600;
    font-size: 24px;
    font-variant: small-caps;
}

h2 {
    color: #555;
    font-weight: 600;
    font-size: 20px;

}

h3 {
    color: #777;
    font-weight: 600;
    font-size: 18px;
}

h4 {
    color: #999;
    font-weight: 600;
    font-size: 16px;
}

h5 {
    color: #BBB;
    font-weight: 600;
    font-size: 15px;
}

p {
    font-size: 14px;
    color: #666;

}

p.indent {
    margin-left: 20px;
}

/* MARK: Question Styles */

.prompt-text {
    font-size: 14px;
    color: #444;
    font-style: italic;
    margin-top: 0;
}


.first-prompt {
    text-align: right;
    width: 150px;
}


.second-prompt {
    text-align: left;
    max-width: 150px;
}

/* MARK: Buttons and Forms */

button {
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
}

button:enabled {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    cursor: pointer;
}

button:enabled.danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: var(--danger-text);
}

button[disabled] {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    cursor: not-allowed;
    font-style: italic;
    border-style: dotted;
}

/* Tooltip for disabled submit in open.html */
.btn-with-tooltip {
    position: relative;
    display: inline-block;
}

.disabled-tooltip {
    position: absolute;
    right: 0;
    /* align to the right edge of the button container */
    bottom: 110%;
    /* place above the button */
    transform: translateY(-4px);
    background: rgba(51, 51, 51, 0.95);
    color: #fff;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 0.875rem;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out, visibility 0.15s;
    z-index: 1000;
}

.disabled-tooltip::after {
    content: "";
    position: absolute;
    bottom: -6px;
    /* small arrow pointing down to the button */
    right: 12px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(51, 51, 51, 0.95) transparent transparent transparent;
}

/* Show tooltip only when the button is disabled and hovered */
.btn-with-tooltip button[disabled]:hover+.disabled-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Optional: also show when container is hovered and the button is disabled */
.btn-with-tooltip:hover button[disabled]+.disabled-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

select {
    padding: 10px;
    margin: 8px 0;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    color: var(--text-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
    padding: 10px;
    margin: 8px 0;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

input.force-uppercase {
    text-transform: uppercase;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* Firefox */
input[type=number] {
    appearance: textfield;
    -moz-appearance: textfield;
}

/* MARK: Registraton */


fieldset label {
    margin-left: 100px;
    margin-right: 25px;
}


#explanation-toggle {
    cursor: pointer;
    color: #007acc;
    font-weight: bold;
}

#explanation-div {
    display: none;
}

/* MARK: DIVs */

div {
    box-sizing: border-box;
    font-size: 14px;
    background-color: var(--background-color);
}

div.shadowed {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 5px 5px 10px var(--shadow-color);
}

div.icon-background {
    background: radial-gradient(circle at bottom left, white, var(--primary-color));
    /* url("/images/shiftwell-emblem.png") bottom left no-repeat; */
    /* background-image: var(--logo);
    background-repeat: no-repeat;
    background-position: bottom left; 
    background-size: 140px 140px; */
    /* position: relative; */
}

div.rounded {
    border-radius: var(--border-radius);
}

div.right-section {
    margin-left: 150px;
    height: 100%;
    border: 0px;
    padding: 30px;
}

.width-full {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.width-85 {
    width: 85%;
}

.width-70 {
    width: 70%;
}

.width-25 {
    width: 25%;
}

/* MARK: Comparison */

div.radio-group {
    box-shadow: none;
    padding: 10px;
    margin: 0;
    background-color: var(--primary-color);
}

.flex-box {
    display: flex;
    gap: 10px;
}

.center-align {
    align-items: flex-start;
}

.radio-group {
    display: flex;
    gap: 16px;
    margin: 10px 0;
    padding: 10px;
    align-items: flex-end;
    /* align all radios on the same baseline */
    justify-content: center;
    border-radius: var(--border-radius);

}

/* Each radio is a vertical column; label (if any) on top, input on bottom */
.radio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    width: 60px;
}

.radio-item .label-text {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
}

.radio-item input[type="radio"] {
    margin: 0;
    height: 20px;
    width: 20px;
    /* ensure consistent baseline */
}

/* Row below the 5-option radio group; centers the single N/A option directly under the middle (3rd) button */
.radio-group-below {
    border: none;
    display: flex;
    justify-content: center;
    /* center within the same parent width so it lines up with the middle column */
    margin-top: 6px;
    box-shadow: none;
}

.radio-group-below .radio-item {
    width: 60px;
    /* same fixed column width as top radios to align perfectly */
    flex-direction: column;
    align-items: center;
}

.radio-group-below .radio-item label {
    display: flex;
    margin-top: 8px;
    margin-bottom: 4px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    color: var(--primary-color)
}

/* MARK: Tab Interface */

.tab-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0px;
    padding: 10px 10px 0px 10px;
    width: 100%;
    max-width: none;
}

#tab-actions {
    display: flex;
    gap: 6px;
    margin: 8px 0;
    padding: 6px 8px;
    background: var(--action-bg);
    border-radius: 4px;
    position: sticky;
    top: 0;
    z-index: 2;
    /* keep above scrolling content */
}

.action-group {
    padding: 0px 8px 0px 8px;
    display: flex;
    gap: 6px;
    background: var(--action-bg);
}

#delete-goal-btn {
    display: none;
}

#tab-actions #delete-goal-btn:enabled {
    /* Improve legibility of the ♻️ emoji on dark blue buttons */
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.85), 0 0 3px rgba(255, 255, 255, 0.6);
    filter: saturate(1.2) contrast(1.1);
}

/* Further boost contrast for users requesting more contrast */
@media (prefers-contrast: more) {
    #tab-actions #delete-goal-btn:enabled {
        text-shadow: 0 0 2px #fff, 0 0 4px rgba(255, 255, 255, 0.9);
        filter: saturate(1.3) contrast(1.15);
    }
}

#settings-tab {
    margin-left: auto;
}

#admin-tab {
    margin-left: 0;
}

.tab-button {
    background: #eef2fb;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-button:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.tab-button.active {
    background: var(--primary-color);
    color: var(--secondary-color);
    box-shadow: 0 4px 10px rgba(61, 101, 165, 0.2);
}

.tab-button.active img,
.tab-button:hover img {
    filter: brightness(0) invert(1);
}

.tab-button[disabled] {
    background: var(--border-light);
    color: var(--disabled-text);
    border-color: var(--border-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.tab-button[disabled]:hover {
    background: var(--border-light);
    color: var(--disabled-text);
    border-color: var(--border-light);
}

.tab-panels .tab-panel {
    margin: 5px 5px;
    display: none;
    padding: 10px;
}

.vertically-spaced {
    padding: 30px 0 0px 0;
}

.tab-panels .tab-panel.active {
    display: block;
    min-height: 500px;
}

/* Make the Goals tab a flex column so actions stay visible and the list scrolls */
.tab-panels #goals.tab-panel.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* allow child to shrink */
}

.tab-panels #open-ended.tab-panel.active {
    display: flex;
}

div.progress-bar {
    width: 300px;
    height: 12px;
    margin: 10px auto 0 auto;
    padding: 60px 0 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

div.progress-bar progress {
    width: 100%;
    height: 20px;
    font-size: 24px;
}

/* MARK: Open Ended Questions */

.open-ended-panel {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.open-ended-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

.open-ended-item {
    display: flex;
    justify-content: center;
}

.open-ended-item label {
    text-align: left;
    max-width: 100%;
}

.open-ended-item textarea {
    width: 100%;
}

.open-ended-actions {
    display: flex;
    justify-content: center;
}



/* MARK: Chat Window */

#chat-initial-message,
#chat-confirm-delete,
#chat-history-empty {
    display: none;
}

div.chat-window {
    border: 2px solid #ccc;
    border-radius: var(--border-radius);
    box-shadow: 5px 5px 10px var(--shadow-color);
    /* Black shadow with 50% opacity */
    background-color: white;
    max-width: 800px;
    padding: 0;
    margin: 0px;
    height: 98%
}

div.chat-window .title-bar {
    background-color: var(--primary-color);
    color: white;
    padding: 10px;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    font-weight: 600;
    margin: 0;
    border-left: 1px solid var(--primary-color);
    border-right: 1px solid var(--primary-color);
    height: fit-content;
}

div.btn-with-tooltip {
    margin-top: 25px;
    margin-left: 90%;
}

/* Chat window title bar */
.chat-window .title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-color);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
}

.chat-window .window-title {
    font-weight: 600;
}

.chat-window .window-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: auto;
}

.chat-window .window-controls .control-group {
    display: flex;
    gap: 6px;
    margin-right: 12px;
}

.chat-window .control-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.1rem;
}

.chat-window .control-close {
    padding-left: 8px;
}

.chat-window .control-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -38px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--primary-color);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.chat-window .control-icon::before {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.chat-window .control-icon:hover::after,
.chat-window .control-icon:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.chat-window .control-icon:hover::before,
.chat-window .control-icon:focus-visible::before {
    opacity: 1;
}

.chat-window .chat-messages {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    background: rgba(255, 255, 255, 0.85);
    padding: 16px;
    flex: 1;
    min-height: 0;
    margin: 0 !important;
    overflow-y: auto;
    scroll-behavior: smooth;
    border-left: 1px solid var(--primary-color);
    border-right: 1px solid var(--primary-color);
    height: calc(100% - 135px);
}

.chat-window .message {
    display: flex;
    width: 100%;
    border-width: 0px;
    margin: 0 !important;
    padding: 0 !important;
}

.chat-window .message.received {
    justify-content: flex-start;
}

.chat-window .message.sent {
    justify-content: flex-end;
}

.chat-window .message-content {
    max-width: 70%;
    padding: 30px;
    /* border-radius: 16px; */
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.35;
    margin: 0px 2px 0px;
}

.chat-window .message.received .message-content {
    background: var(--secondary-color);
    color: var(--text-color);
    border-radius: 20% 20% 20% 0%;
}

.chat-window .message.sent .message-content {
    background: var(--primary-color);
    color: #fff;
    border-radius: 20% 20% 0% 20%;
}

.chat-window .chat-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    border-left: 1px solid var(--primary-color);
    border-right: 1px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    margin-top: 0px;
}

.chat-window #chat-input-field,
.chat-window .chat-input-field {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.chat-window #chat-input-field:focus,
.chat-window .chat-input-field:focus {
    box-shadow: 0 0 0 3px rgba(61, 101, 165, 0.2);
}

.chat-window #chat-send-button,
.chat-window .chat-send-button {
    flex: 0 0 auto;
    padding: 10px 18px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-window #chat-send-button:disabled,
.chat-window .chat-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-window #chat-send-button:hover:not(:disabled),
.chat-window .chat-send-button:hover:not(:disabled) {
    background: #2f4f85;
}

#chat-history-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
}

/* MARK: Goals */

.goal-status-overdue {
    color: var(--danger-color);
    font-weight: 800;
}

.goal-status-soon {
    color: var(--warning-color, #FFA500);
    font-weight: 400;
}

.goal-status-today {
    color: var(--warning-color, #FFA500);
    font-weight: 600;
}

.goal-status-future {
    color: var(--text-color);
    font-weight: 200;
}

/* TODO: Check overlap between scrollable-div and goal list */
.scrollable-div {
    height: 0px;
    border: 0px solid #ccc;
    /* For visualization */
    padding: 10px;
    overflow-y: scroll;
    /* Always show vertical scrollbar when content overflows */
    transition: height 0.3s;
}

.scrollable-div.has-goals {
    height: 100%;
}

/* ---------- Goal list ---------- */

div.scrollable-div {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    height: calc(100% - 100px);
    /* Adjust based on other content */
    overflow-y: auto;
    background: var(--background-color);
}

#goals-div {
    margin: 10px;
    padding: 0px;
    border: 0px;
    /* Override generic scrollable-div sizing to make this the flexible scroll area */
    height: auto;
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    /* critical for flex children to allow scrolling */
}

#chat-history-scroll {
    margin-bottom: 20px;
}

ul#goalList,
#chat-history-list {
    list-style: none;
    padding: 5px;
}

ul#goalList li.goal-item,
#chat-history-list li {
    border-bottom: 1px solid var(--border-color);
    padding: 5px 8px;
    list-style: none;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

li.goal-item:hover .inner-item,
li.goal-item:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
    border-color: var(--hover-bg);
}

ul#goalList li.goal-item.selected,
ul#completedGoalList li.goal-item.selected {
    background-color: var(--selected-bg);
    border-left: 4px solid var(--primary-color);
}

ul#goalList li.goal-item.selected .goal-name,
ul#completedGoalList li.goal-item.selected .goal-name {
    color: var(--primary-color);
    font-weight: 600;
    background-color: var(--selected-bg);
}

ul#goalList li.goal-item.selected .goal-deadline,
ul#goalList li.goal-item.selected .goal-row-1,
ul#goalList li.goal-item.selected .goal-row-2,
ul#goalList li.goal-item.selected .goal-icon,
ul#goalList li.goal-item.selected .goal-completed,
ul#completedGoalList li.goal-item.selected .goal-deadline,
ul#completedGoalList li.goal-item.selected .goal-row-1,
ul#completedGoalList li.goal-item.selected .goal-row-2,
ul#completedGoalList li.goal-item.selected .goal-icon,
ul#completedGoalList li.goal-item.selected .goal-completed {
    color: var(--primary-color);
    background-color: var(--selected-bg);
    border-color: var(--selected-color);
    margin-bottom: 0px;
    margin-top: 0px;
}

ul#goalList li.goal-item.selected .goal-description,
ul#completedGoalList li.goal-item.selected .goal-description {
    color: var(--text-color);
    background-color: var(--selected-bg);
}

.goal-content {
    flex: 1;
    margin: 0px 10px 0px 0px;
    padding: 0px;
}

.goal-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goal-name {
    font-size: 15px;
}

.goal-deadline {
    min-width: 50px;
    font-size: 13px;
}

.goal-row-2 {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.3;
}

.goal-description {
    margin-right: 10px;
}

.goal-completed {
    color: var(--success-color);
    font-style: italic;
    font-size: 12px;
}

.completed-step .step-text {
    text-decoration: line-through;
    opacity: 0.75;
}

.goal-icon {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    align-self: flex-start;
}

.goal-icon img {
    border-radius: 4px;
}

.goal-step {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: 12px;
    display: flex;
    gap: 12px;
    padding-top: 8px;
    border-width: 0 0 0 4px;
    border-style: solid;
    border-color: var(--primary-color);
}

/* ---------- Completed Goals ---------- */
#completed-goals-section {
    margin-top: 20px;
    padding-top: 15px;
    display: none;
    /* border-top: 2px solid var(--border-light); */
}


ul#completedGoalList {
    list-style: none;
    padding: 5px;
}

ul#completedGoalList li.goal-item {
    border-bottom: 1px solid var(--border-light);
    padding: 5px 8px;
    list-style: none;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    opacity: 0.8;
}

ul#completedGoalList li.goal-item:hover {
    background-color: var(--hover-bg);
    opacity: 1;
}

ul#completedGoalList li.goal-item:hover .goal-name,
ul#completedGoalList li.goal-item:hover .goal-deadline,
ul#completedGoalList li.goal-item:hover .goal-description {
    color: var(--success-color);
}

ul#completedGoalList li.goal-item.selected {
    background-color: var(--selected-bg);
    border-left: 4px solid var(--success-color);
    opacity: 1;
}

ul#completedGoalList li.goal-item.selected .goal-name {
    color: var(--success-color);
    font-weight: 600;
}

ul#completedGoalList li.goal-item.selected .goal-deadline {
    color: var(--success-color);
}

ul#completedGoalList li.goal-item.selected .goal-description {
    color: var(--text-color);
}


.align-right {
    margin-left: auto;
}

.label {
    font-weight: 600;
    margin-right: 6px;
}

/* MARK: Modal */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: black
}

.modal label {
    display: block;
    margin-top: 10px;
}

.modal input[type="text"],
.modal textarea,
.modal input[type="date"] {
    width: 100%;
    padding: 6px;
    margin-top: 4px;
    box-sizing: border-box;
    box-shadow: 2px 2px 2px 1px rgb(0 0 0 / 20%);
    border-radius: 5px;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.modal .actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

/* MARK: Admin Panel */

.admin-section {
    margin-bottom: 30px;
}

.admin-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-card h3 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.admin-list {
    display: grid;
    gap: 10px;
}

.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--hover-bg);
    border-radius: 4px;
}



.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--hover-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}


/* MARK: Settings Panel */
.settings-section {
    margin-bottom: 30px;
}

.settings-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-card.danger-card {
    border-color: #dc3545;
    background: #fff5f5;
}

.settings-card h3 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.danger-card h3 {
    color: #dc3545;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 15px 0;
}

.form-row input {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    max-width: 300px;
}


.language-selection {
    margin: 15px 0;
}

.language-selection select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

/* MARK: Ticker tape */
.ticker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #4caf50;
    color: white;
    text-align: center;
    font-size: 1.8rem;
    padding: 8px 0;
    transform: translateY(-100%);
    animation: tickerFall 3s ease-in-out forwards;
    z-index: 2000;
}

@keyframes tickerFall {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(100%);
    }
}

/* MARK: Progress Loader */
.loader {
    border-top: 16px solid #3D65A5;
    border-right: 16px solid #7CA1CC;
    border-bottom: 16px solid #1F449C;
    border-left: 16px solid #7CA1CC;
    border-radius: 50%;
    margin: auto;
    width: 100px;
    height: 100px;
    -webkit-animation-name: spin;
    -webkit-animation-duration: 4000ms;
    -webkit-animation-iteration-count: infinite;
    -webkit-animation-timing-function: linear;
    -moz-animation-name: spin;
    -moz-animation-duration: 4000ms;
    -moz-animation-iteration-count: infinite;
    -moz-animation-timing-function: linear;
    -ms-animation-name: spin;
    -ms-animation-duration: 4000ms;
    -ms-animation-iteration-count: infinite;
    -ms-animation-timing-function: linear;

    animation-name: spin;
    animation-duration: 4000ms;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

@-ms-keyframes spin {
    from {
        -ms-transform: rotate(0deg);
    }

    to {
        -ms-transform: rotate(360deg);
    }
}

@-moz-keyframes spin {
    from {
        -moz-transform: rotate(0deg);
    }

    to {
        -moz-transform: rotate(360deg);
    }
}

@-webkit-keyframes spin {
    from {
        -webkit-transform: rotate(0deg);
    }

    to {
        -webkit-transform: rotate(360deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Admin interface responsive adjustments */
.admin-card {
    padding: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.setting-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.setting-row label {
    min-width: auto;
}


/* Settings interface responsive adjustments */
.settings-card {
    padding: 15px;
}


.language-selection select {
    max-width: 100%;
}

/* MARK: Report Styles */

div.report-content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.report-section {
    display: none;
}

div.report-content div.report-section.active {
    display: block;
}

.report-content p {
    float: none;
}

.report-content img.centered {
    display: block;
    margin: 10px auto;
    max-width: 100%;
    height: auto;
}

.report-content .float-right {
    float: right;
    margin: 0 0 10px 10px;
    max-width: 100%;
    height: auto;
}

.report-content .float-left {
    float: left;
    margin: 0 10px 10px 0;
    max-width: 100%;
    height: auto;
}

/* Element header: image + heading as two columns */
.element-header {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    /* vertically center H2 next to the image */
    column-gap: 10px;
}

.element-header .element-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
}

.element-header h2 {
    margin: 0;
    /* remove default margins so it centers cleanly */
}

.element-icon {
    width: 50px;
    height: 50px;
    vertical-align: middle;
    margin-right: 6px;
}

div.gauge {
    vertical-align: bottom;
    display: flex;
    align-items: center;
}

div.gauge canvas {
    width: 400px;
    height: 60px;
}

/* MARK: Print Styles */
.print-only {
    display: none;
}


@media print {

    body {
        font-family: var(--font-family);
        background: white;
        color: black;
        font-size: 10pt;
        margin: .75in;
        padding: 0;
    }

    div.new-page {
        break-before: always !important;
        page-break-before: always !important;
    }

    div.shadowed,
    div.report-content,
    div.tab-panels {
        box-shadow: none;
        border: none;
        width: auto;
    }

    div.tab-container,
    #tab-actions {
        display: none;
    }

    .no-print {
        display: none;
    }

    .print-only {
        display: block;
    }
}

/* MARK: Responsive Design */
@media (max-width: 430px) {

    form#open-ended-form label {
        margin-left: 0px
    }

    div.right-section {
        margin-left: 2px;
    }

    .tab-panels {
        max-height: none;
    }

    .tab-panels .tab-panel {
        padding: 5px;
    }

    button {
        width: 100%;
        padding: 10px;
        font-size: 14px;
        margin: 10px 0;
        box-sizing: border-box;
    }

    .close-btn {
        width: auto;
    }

    div.footer {
        position: relative;
        box-sizing: border-box;
        padding: 10px;
    }

    .chat-window #chat-send-button,
    .chat-window .chat-send-button {
        flex: none;
        width: auto;
    }

    /* Stack flex containers vertically on small screens */
    .flex-box {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    /* Make constrained width sections full width on mobile */
    div.width-70,
    div.width-85 {
        width: 98%;
    }

    div.gauge canvas {
        width: 250px;
        height: auto;
    }

    p.first-prompt {
        text-align: left;
        margin-right: 20px;
        margin-bottom: 0px;
        width: auto;
        max-width: 400px;
    }


    p.second-prompt {
        text-align: right;
        margin-left: 20px;
        margin-top: 0px;
        width: auto;
        max-width: 400px;
    }

    div.radio-group-below {
        margin-bottom: 20px;
    }


    .stats-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        margin: 20px 0;
    }

    div.stat-item {
        border: 0;
        padding: 0;
    }

    textarea {
        font-size: 14px;
        width: 95%;
    }
}