/*
  File: submit_ot_self.css
  Location: Place this file in your /assets/css/ directory.
*/

/* Global styles using CSS Variables for consistency */
/* Import variables from dashboard_unified.css - these will override below */

.page-header {
    margin-bottom: 30px;
    text-align: left;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    background: var(--title-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.page-header .text-muted {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Section Titles */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-mid), var(--bg-gradient-end));
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* Card Styling */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
}



/* Header and Top Bar Styles */
header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.08);
    flex-wrap: wrap;
    gap: 15px;
}

.topbar {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.topbar img {
    height: 50px;
    margin-right: 15px;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
    object-fit: contain;
}

.topbar span {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary-accent);
    white-space: nowrap;
}

.header-center-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 15px;
    min-width: 80px;
}

.home-button {
    color: var(--primary-accent);
    font-size: 1.1em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 5px rgba(0, 255, 255, 0.2);
}

.home-button:hover {
    color: var(--primary-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.home-button .fas {
    font-size: 1.5em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.datetime {
    font-size: 0.9em;
    color: var(--text-muted);
    font-weight: 500;
    white-space: normal;
    line-height: 1.3;
    text-align: left;
}

a.logout {
    background-color: var(--danger-color);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 99, 71, 0.3);
}

a.logout:hover {
    background-color: var(--danger-color-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 99, 71, 0.5);
}

/* Form Specific Styles */
form {
    text-align: left;
    margin-top: 20px;
}

fieldset {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.03);
    margin-top: 20px;
}

legend {
    color: var(--primary-accent-hover);
    font-size: 1.2em;
    font-weight: 700;
    padding: 0 10px;
    margin-left: 10px;
    background: var(--bg-gradient-mid);
    border-radius: var(--border-radius);
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Specific Overrides for Balanced Layout in this Form */
#otForm .filter-row {
    justify-content: space-between;
    /* Distribute evenly */
    gap: 15px;
    /* Consistent gap */
}

#otForm .filter-row .form-group,
#otForm .filter-row .w-date,
#otForm .filter-row .w-status,
#otForm .filter-row .w-section {
    flex: 1 0 0px !important;
    /* Grow to fill space evenly */
    width: auto !important;
    max-width: none !important;
    min-width: 140px !important;
    /* Prevent crushing */
}

.input-group {
    display: flex;
    flex-direction: column;

}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1em;
    pointer-events: none;
}

input[type="text"],
input[type="date"],
input[type="time"],
textarea,
button {
    font-family: inherit;
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Enhanced Date/Time Input Styling */
input[type="date"],
input[type="time"] {
    cursor: pointer;
    position: relative;
}

/* Date input placeholder for empty state */
input[type="date"]:not(:focus):invalid,
input[type="time"]:not(:focus):invalid {
    color: var(--text-muted);
}

/* Style the calendar and clock icons for pickers */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    filter: invert(0.6);
    transition: opacity 0.3s ease;
}

input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="time"]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
    filter: invert(0.8);
}

/* Ensure picker appears on click */
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
    padding: 0;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

/* Style individual date/time parts */
input[type="date"]::-webkit-datetime-edit-text,
input[type="time"]::-webkit-datetime-edit-text {
    color: var(--text-main);
    padding: 0 2px;
}

input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field {
    color: var(--text-main);
    padding: 0 2px;
}

input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus,
input[type="time"]::-webkit-datetime-edit-hour-field:focus,
input[type="time"]::-webkit-datetime-edit-minute-field:focus {
    background: rgba(163, 93, 56, 0.2);
    border-radius: 3px;
}

button {
    width: auto;
    padding: 12px 25px;
}


input:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(163, 93, 56, 0.1);
    outline: none;
}

input[readonly] {
    background: rgba(0, 0, 0, 0.2);
    cursor: not-allowed;
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.input-info-text {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 5px;
    text-align: left;
}

.form-submission-error {
    display: none;
    /* Hidden by default */
    text-align: center;
    color: var(--warning-color);
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--warning-color);
    padding: 10px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-weight: 500;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.buttons button {
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button[type="submit"] {
    background: linear-gradient(90deg, var(--primary-accent), #0072ff);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(0, 198, 255, 0.4);
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 198, 255, 0.6);
}

button[type="submit"]:disabled {
    background: var(--neutral-color);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

button#clearBtn,
.btn-secondary {
    background: var(--neutral-color);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
    transition: all 0.2s ease;
}

button#clearBtn:hover,
.btn-secondary:hover {
    background: var(--neutral-color-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.6);
}

/* Toast Notification for JS actions */
.message {
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    white-space: pre-line;
    /* Support line breaks in messages */
}

.message::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2em;
}

.message.success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.message.success::before {
    content: '\f058';
    /* check-circle */
}

.message.error {
    background: linear-gradient(135deg, #ff4d4d 0%, #e63946 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}

.message.error::before {
    content: '\f06a';
    /* exclamation-circle */
}

.toast-popup {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-popup.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* --- Custom Tree Dropdown --- */
.custom-tree-dropdown {
    position: relative;
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.custom-tree-dropdown:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(163, 93, 56, 0.1);
}

.custom-tree-dropdown .icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.dropdown-selected-text {
    padding: 12px 45px 12px 45px;
    cursor: pointer;
    user-select: none;
    position: relative;
    font-weight: 500;
    transition: background 0.2s ease;
}

.dropdown-selected-text:hover {
    background: rgba(163, 93, 56, 0.05);
}

.dropdown-selected-text::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.custom-tree-dropdown.open .dropdown-selected-text::after {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-options-container {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: rgba(30, 41, 59, 0.98);
    /* More opaque */
    border: 1px solid var(--card-border);
    border-radius: 8px;
    z-index: 1050;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.custom-tree-dropdown.open .dropdown-options-container {
    display: block;
}

.dropdown-options-list,
.dropdown-options-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-options-list li {
    padding: 12px 15px;
    transition: all 0.2s ease;
    text-align: left;
    border-left: 3px solid transparent;
}

.dropdown-options-list li.has-children {
    color: var(--text-main);
    cursor: pointer;
    font-weight: 600;
}

.dropdown-options-list li.has-children:hover {
    background: rgba(163, 93, 56, 0.1);
    border-left-color: var(--primary-color);
}

.dropdown-options-list li.is-selectable {
    cursor: pointer;
    padding-left: 30px;
    font-weight: 400;
}

.dropdown-options-list li.is-selectable:hover {
    background: rgba(163, 93, 56, 0.15);
    border-left-color: var(--primary-color);
    padding-left: 35px;
}

.dropdown-options-list ul {
    border-left: 1px solid var(--border-color);
    margin-left: 10px;
    padding-left: 10px;
}

.custom-tree-dropdown .dropdown-options-list li ul {
    display: none;
}

.dropdown-options-list li.expanded>ul {
    display: block;
}

.dropdown-options-list li.has-children>.item-text::before {
    content: '\f0da';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    transition: transform 0.2s ease;
    display: inline-block;
}

.dropdown-options-list li.has-children.expanded>.item-text::before {
    transform: rotate(90deg);
}