@font-face {
    font-family: 'OpenSans';
    src: url(fonts/Open_Sans/OpenSans-VariableFont.ttf);
}

@font-face {
    font-family: 'Rethink';
    src: url(fonts/Rethink_Sans/RethinkSans-VariableFont_wght.ttf);
}

:root {
    /* CSS HEX */
    --oxford-blue: #030027ff;
    --delft-blue: #23396Cff;
    --alice-blue: #eaeffaff;
    --orange-web: #fca311ff;
    --old-lace: #fdf6eaff;
    --floral-white: #fcf8f1ff;
    --persian-red: #C72F2Fff;
    --text: #030027ff;
    --text-secondary: #23396Cff;
    --text-secondary-light: #eaeffaff;
    --accent: #fca311ff;
    --bg-color-secondary: #fdf6eaff;
    --bg-color: #fcf8f1ff;
    --negative: #C72F2Fff;
    --bugware-color: #148DEE;
    
    /* CSS HSL */
    --oxford-blue-2: hsla(222, 51%, 28%, 1);
    --text-secondary-opaque: #E8E8EEff;
    --text-secondary-border: hsla(222, 51%, 28%, 0.25);
    --accent-shadow: hsla(37, 98%, 53%, 0.2);
    --bg-secondary-opaque: hsla(38, 83%, 95%, 0.2);
    
    /* Extracted Colors - Light Theme */
    --warning-border: #f1c40f;
    --warning-bg: #fffbe6;
    --warning-text: #8a6d1e;
    --border-light: #ddd;
    --text-dark: #333;
    --gray-medium: #999;
    --blue-light: #3498db;
    --blue-darker: #2980b9;
    --gray-neutral: #95a5a6;
    --green-primary: #27ae60;
    --green-dark: #229954;
    --red-primary: #e74c3c;
    --red-dark: #c0392b;
    --bg-light: #f8f9fa;
    --whatsapp-green: #25d366;
    --text-gray: #555;
    --purple-primary: #9c27b0;
    --success-bg: #d4edda;
    --success-text: #155724;
    --info-bg: #fff3cd;
    --info-text: #856404;
    --info-bg-alt: #cfe2ff; 
    --info-text-alt: #084298;
    --warning-bg-alt: #fdebd0;
    --warning-text-alt: #7b5e2e;
    --sky-bg: #e8f4fd;
    --sky-text: #0b5394;
    --success-light-bg: #f0fff4;
    --success-light-text: #1b5e20;
    --cyan-bg: #d1ecf1;
    --cyan-text: #0c5460;
    --danger-text: #721c24;
    --danger-bg: #f8d7da;
    --danger-border: #dc3545;
    --orange-primary: #ffc107;
    --hospital-blue: #1d7dbf;
    --hospital-orange: #ff9800;
    --ngo-purple: #8e44ad;
    --shelter-green: #2e7d32;
    --login-blue: #2B9EEE;
    --login-orange: #ffba0b;
    --gray-light: #a9a9a9;
    --text-secondary-light-gray: #555;
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --modal-overlay-dark: rgba(0, 0, 0, 0.4);
    --modal-overlay-light: rgba(0, 0, 0, 0.7);
    --modal-bg: #fefefe;
    --modal-border: #888;
    --bg-table: #f5f5f5;
    --border-table: #e0e0e0;
    --timeline-border: #f9f9f9;
    --modal-close-gray: #999;
    --white: #fff;
    --shadow-subtle: 0 4px 6px rgba(0,0,0,0.1);
    
    /* Additional Colors from JS Files */
    --dark-text: #333;
    --light-gray: #666;
    --box-shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --modal-overlay-subtle: rgba(0,0,0,0.5);
    --modal-bg-light: #fff;
    --edit-form-bg: #f8f9fa;
    --edit-form-border: #dee2e6;
    --form-label-color: #495057;
    --form-input-border: #ced4da;
    --form-input-bg: transparent;
    --btn-secondary-bg: #6c757d;
    --btn-success-bg: #27ae60;
    --btn-warning-bg: #ffc107;
    --btn-warning-text: #000;
    --primary: #3498db;
    --status-green-dark: #2e7d32;
    --status-green-darker: #1b5e20;
    --status-amber-light: #fff3cd;
    --status-amber-border: #ffc107;
    --status-amber-text: #856404;
    --status-red-light: #f8d7da;
    --status-red-border: #dc3545;
    --status-red-text: #721c24;
    --case-item-bg: #fff;
    --case-item-border-left: #25d366;
    --wildlife-section-bg: #e8f5e9;
    --wildlife-section-border: #4caf50;
    --wildlife-alert-text: #1b5e20;
    
    /* Additional Timeline and Form Colors */
    --timeline-loading-color: #999;
    --timeline-error-color: #e74c3c;
    --timeline-bg-default: #f0f0f0;
    --timeline-border-default: #ccc;
    --timeline-type-default: #333;
    --timeline-bg-error: #ffebee;
    --timeline-border-error: #ef5350;
    --timeline-type-error: #c62828;
    --timeline-bg-success: #e8f5e9;
    --timeline-border-success: #66bb6a;
    --timeline-type-success: #2e7d32;
    --timeline-bg-info: #e3f2fd;
    --timeline-border-info: #42a5f5;
    --timeline-type-info: #1565c0;
    --timeline-bg-purple: #f3e5f5;
    --timeline-border-purple: #ab47bc;
    --timeline-type-purple: #6a1b9a;
    --timeline-bg-warning: #fff9c4;
    --timeline-border-warning: #fbc02d;
    --timeline-type-warning: #f57f17;
    --timeline-text: #555;
    --timeline-text-secondary: #777;
    --timeline-text-tertiary: #999;
    --timeline-text-username: #666;
    
    /* NGO and Facility Assignment */
    --ngo-loading-text: #666;
    --facility-bg: #fff;
    --facility-border: #e0e0e0;
    --facility-text: #333;
    --facility-text-secondary: #555;
    --facility-text-tertiary: #666;
    --facility-hover-bg: #f0f0f0;
    --facility-hover-border: #3498db;
    --facility-selected-bg: #e8f5e9;
    --facility-selected-border: #4caf50;
    --facility-error-text: #e74c3c;
    --facility-not-available-text: #999;
    
    /* Confirmation Modal */
    --confirm-section-bg: #e8f5e9;
    --confirm-section-border: #4caf50;
    --confirm-text: #2e7d32;
    --confirm-text-secondary: #555;
    --confirm-msg-text: #2e7d32;
    --confirm-pending-text: #856404;
    
    /* Reassignment Modal */
    --reassign-bg: #fff8e1;
    --reassign-border: #ffe58f;
    --reassign-label: #8a6d3b;
    --reassign-btn-bg: #f39c12;
    --reassign-error-text: #e74c3c;
    
    /* Banner */
    --banner-gradient-start: #667eea;
    --banner-gradient-end: #764ba2;
    --banner-text: #fff;
    
    /* Search Feedback */
    --search-success-bg: #d4edda;
    --search-success-text: #155724;
    --search-success-border: #c3e6cb;
    --search-warning-bg: #fff3cd;
    --search-warning-text: #856404;
    --search-warning-border: #ffeaa7;
    --search-error-bg: #f8d7da;
    --search-error-text: #721c24;
    --search-error-border: #f5c6cb;
    --search-info-text: #0066cc;
}

.dark-mode {
    /* --bg-color: #030027ff;
    --bg-color-secondary: #18274bff;
    --text-secondary-light: #7e90a6;
    --accent: #fca311ff;
    --text-secondary: #fdf6eaff;
    --text: #fcf8f1ff;
    --negative: #C72F2Fff;

    --text-secondary-opaque: hsla(222, 51%, 28%, 0.1);
    --bg-secondary-opaque: hsla(222, 51%, 28%, 0.25);
    --accent-shadow: hsla(37, 98%, 53%, 0.2);
    --text-secondary-border: hsla(37, 84%, 95%, 0.7); */
    --bg-color: #272829;
    --bg-color-secondary: var(--gunmetal);
    --text: var(--lavender-web);
    --text-secondary: var(--french-gray);
    --text-secondary-border: var(--french-gray);
    --text-secondary-opaque: #42414f;
    --accent: #C94300ff;
    /* CSS HEX */
    --lavender-web: #dcdbebff;
    --french-gray: #c4c2d6ff;
    --gunmetal: #1b2432ff;
    --rich-black: #222323;
    /* CSS HSL */
    --lavender-web: hsla(244, 29%, 89%, 1);
    --french-gray: hsla(246, 20%, 80%, 1);
    --gunmetal: hsla(217, 30%, 15%, 1);
    --rich-black: hsla(231, 28%, 10%, 1);
}

html,
body,
*,
*::after,
*::before {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    color: var(--text);
}

body {
    background-color: var(--bg-color);
    color: var(--text);
    font-family: 'Rethink', Arial, Helvetica, sans-serif;
}

.page-title {
    font-size: 1.2em;
    text-align: left;
    padding: 0.5em;
    padding-left: 2em;
    border-bottom: 1px solid var(--accent);
}

.container {
    position: relative;
    width: 100%;
    display: inline-block;
    height: 100vh;
}

.container section {
    width: 90%;
    margin-left: 5%;
    border-left: 5% solid var(--bg-color);
}

.content-wrapper {
    margin: 1em;
}

.content-wrapper.table-wrapper {
    overflow-x: auto;
}


/* icons CSS */

.material-symbols-outlined {
    font-size: inherit;
    color: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    background: transparent;
    border: none;
    cursor: pointer;
    margin: 0.5vw 0vh;
}

/* TABLE CSS */

table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
    border-spacing: 0;
    position: relative;
    font-size: 14px;
}

.slide-left {
    transform: translateX(-200%);
    transition: all 0.25s linear;
}

.slide-right {
    transform: translateX(200%);
    transition: all 0.25s linear;
    display: none;
}

table th {
    color: var(--text-secondary);
    padding: 1em;
    border-right: 1px solid var(--text-secondary-light);
    position: relative;
    background-color: var(--bg-light);
}

tbody tr:nth-child(odd) td {
    border-bottom: 1px solid var(--text-secondary-border);
    border-top: 1px solid var(--text-secondary-border);
}

tbody tr.clickable-row:hover {
    background-color: var(--hover-light);
    cursor: pointer;
}

thead {
    cursor: default;
    position: sticky;
    top: 0;
    background: var(--text-secondary-opaque);
}

table td {
    padding: 0.5em;
    /* border-radius: 5px; */
}


/* Search Bar CSS */

div.search-bar-wrapper {
    position: sticky;
    top: 0;
    background: var(--bg-color);
    font-size: 1em;
    padding: 0.5em;
    z-index: 1;
}

label.search-label {
    position: relative;
    display: block;
    width: 100%;
    font-size: 1em;
}

label.search-label span {
    color: var(--gray-light);
    position: absolute;
    left: 0;
}

label.search-label input {
    position: relative;
    font-size: 1em;
    border-bottom: 1px inset var(--text-secondary);
    /* display: inline-block; */
    width: 100%;
    margin-left: 0;
    padding-left: 1em;
}


/* Forms common CSS */

form {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: space-between;
    justify-content: flex-start;
    align-items: center;
}

form.vertical-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    align-content: center;
    flex-wrap: wrap;
}

form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
}

label {
    margin: 0 0.5em;
    padding: 0.5em;
    display: flex;
    flex-direction: row;
    align-items: center;
    align-content: space-between;
    flex-wrap: nowrap;
    border-radius: 5px;
}

label.file-select {
    cursor: pointer;
    padding: 0.25em;
    background: var(--accent);
    color: var(--bg-color);
    border: 1px solid var(--accent);
}

.form-row .form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-row .form-group label {
    margin: 0 0 8px 0;
    min-width: auto;
}

.form-row .form-group select,
.form-row .form-group input {
    width: 100%;
    min-width: auto;
}

.form-row label {
    min-width: 15em;
}

.form-row label span {
    display: flex;
    flex-wrap: wrap;
}

select {
    background: transparent;
    border: none;
    font-family: 'Rethink', Arial, Helvetica, sans-serif;
    border-bottom: 1px solid var(--text-secondary);
}

select:focus-visible {
    outline: none;
}

option {
    background: var(--bg-color-secondary);
}

input,
div.dt-container .dt-search input {
    border: none;
    border-bottom: 1px solid var(--text-secondary);
    margin-left: 1em;
    background: transparent;
}

input:focus-visible {
    border: none;
    outline: none;
    border-bottom: 1px solid var(--accent);
}

input:disabled {
    opacity: .8;
}

input[type="file"] {
    display: none;
}

.form-row input {
    min-width: 15em;
}

.wildlife-warning {
    display: block;
    padding: 12px 15px;
    margin-top: 12px;
    background-color: var(--info-bg);
    border: 1px solid var(--orange-primary);
    border-radius: 4px;
    color: var(--info-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    grid-column: 1 / -1;
}

.selected-filename {
    /* width: 10em; */
    margin: auto 1em;
    display: block;
    /* outline: 1px solid var(--orange); */
}

label.file-select:hover {
    transition: all 50ms linear;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
}

.btn-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.btn-container .crm-btn.crm-btn-small {
    width: max-content;
    min-width: 5em;
}

.crm-btn {
    border: none;
    padding: 0.5rem;
    margin: 0.5em;
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--text);
    border-radius: 5px;
    cursor: pointer;
    min-width: 10em;
    transition: all 0.3s ease;
}

.crm-btn span {
    color: var(--text);
    vertical-align: text-top;
}

.crm-btn:hover:not(:disabled) {
    transition: all 250ms linear;
    background: var(--bg-color);
    border: 1px solid var(--text-secondary-border);
    color: var(--text-secondary);
}

.crm-btn:disabled {
    background-color: var(--gray-neutral);
    cursor: not-allowed;
    opacity: 0.7;
}

.back-to-top-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    font-size: 25px;
    background-color: var(--bg-color);
    color: var(--text-secondary);
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    text-align: center;
    transition: all 0.1s linear;
}

.back-to-top-btn:hover {
    border: 5px solid var(--text-secondary);
}

.message-popup {
    position: fixed;
    z-index: 2000;
    top: 1em;
    right: -1000%;
    width: 20em;
    height: max-content;
    background: var(--accent);
    color: var(--bg-color);
    font-size: 1.2em;
    padding: 1em;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    transition: all 0.25s ease;
}

.message-popup span,
.message-popup h4 {
    color: inherit;
}

.message-popup.show-popup {
    right: 0.5em;
    transition: all 0.25s ease;
}


/* Modal CSS */

.crm-modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background-color: var(--bg-color);
    margin: 10vh auto;
    padding: 20px;
    border: 1px solid var(--text-secondary-border);
    width: 70%;
}

.modal-small {
    width: max-content;
    min-width: 30%;
}

.close-modal {
    cursor: pointer;
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.25em;
    margin: 0.25em;
    font-size: 1.5em;
    transition: all 0.25s ease-in-out;
}

div.dt-container div.dt-layout-row {
    display: flex;
    justify-content: space-between;
}

div.dt-container .dt-paging .dt-paging-button:hover {
    background: var(--text-secondary-border);
    border: 1px solid var(--text-secondary-border);
}

div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover {
    color: var(--bg-color) !important;
    background-color: var(--text-secondary);
    border-color: var(--text-secondary);
}

.dt-paging-button {
    font-size: 1em;
    padding: 0.5em;
    align-content: center;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

 .toggle-buttons {
        display: flex;
        gap: 10px;
    }

    .btn-toggle {
        padding: 10px 20px;
        border: 2px solid var(--border-light);
        background: var(--white);
        color: var(--text-dark);
        border-radius: 4px;
        cursor: pointer;
        font-weight: 600;
        font-size: 14px;
        transition: all 0.3s ease;
    }

    .btn-toggle:hover {
        border-color: var(--gray-medium);
    }

    .btn-toggle.active {
        background-color: var(--blue-light);
        color: var(--white);
        border-color: var(--blue-light);
    }

    .additional-animal-row .form-row {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .additional-animal-row .form-row .form-group {
        flex: none;
        width: 100%;
        min-width: unset;
    }

    .form-group label {
        font-weight: 600;
        color: var(--text-dark);
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 40vw;
        padding: 10px;
        border: 1px solid var(--border-light);
        border-radius: 4px;
        font-size: 14px;
        box-sizing: border-box;
    }

    .form-group select.searchable-converted {
        display: none !important;
    }

    .searchable-select-wrapper {
        position: relative;
        width: 40vw;
        z-index: 1;
    }

    .searchable-select-wrapper:has(.searchable-select-dropdown.active) {
        z-index: 1000;
    }

    .searchable-select-input {
        width: 100%;
        padding: 10px;
        border: 1px solid var(--border-light);
        border-radius: 4px;
        font-size: 14px;
        box-sizing: border-box;
        background-color: var(--white);
        cursor: pointer;
        transition: border-color 0.3s ease;
        position: relative;
    }

    .searchable-select-input:focus {
        outline: none;
        border-color: var(--blue-light);
        background-color: var(--white);
        box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    }

    .searchable-select-input::placeholder {
        color: var(--gray-medium);
    }

    .searchable-select-dropdown {
        position: absolute;
        top: calc(100% + 5px);
        left: 0;
        right: 0;
        background-color: var(--white);
        border: 1px solid var(--border-light);
        border-radius: 4px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        max-height: 300px;
        overflow-y: auto;
        z-index: 10;
        display: none;
    }

    .searchable-select-dropdown.active {
        display: block;
        animation: slideDown 0.2s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .searchable-select-options {
        padding: 5px 0;
    }

    .searchable-select-option {
        padding: 10px 15px;
        cursor: pointer;
        font-size: 14px;
        color: var(--text-dark);
        transition: background-color 0.2s ease;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .searchable-select-option:hover {
        background-color: var(--gray-light);
    }

    .searchable-select-option.selected {
        background-color: var(--blue-light);
        color: var(--white);
        font-weight: 600;
    }

    .searchable-select-option.hidden {
        display: none;
    }

    .searchable-select-dropdown::-webkit-scrollbar {
        width: 8px;
    }

    .searchable-select-dropdown::-webkit-scrollbar-track {
        background: var(--bg-light);
        border-radius: 4px;
    }

    .searchable-select-dropdown::-webkit-scrollbar-thumb {
        background: var(--gray-medium);
        border-radius: 4px;
    }

    .searchable-select-dropdown::-webkit-scrollbar-thumb:hover {
        background: var(--gray-dark);
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: none;
        border-color: var(--blue-light);
    }

    .form-actions {
        display: flex;
        gap: 10px;
    }

    .crm-btn {
        padding: 12px 24px;
        background-color: var(--blue-light);
        color: var(--white);
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 600;
        font-size: 14px;
        transition: all 0.3s ease;
    }

    .crm-btn:hover:not(:disabled) {
        background-color: var(--blue-darker);
    }

    .crm-btn:disabled {
        background-color: var(--gray-neutral);
        cursor: not-allowed;
        opacity: 0.7;
    }

    .crm-btn-secondary {
        padding: 10px 16px;
        background-color: var(--green-primary);
        color: var(--white);
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 600;
        font-size: 13px;
        transition: all 0.3s ease;
    }

    .crm-btn-secondary:hover {
        background-color: var(--green-dark);
    }

    .crm-btn-danger {
        padding: 8px 12px;
        background-color: var(--red-primary);
        color: var(--white);
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 600;
        font-size: 12px;
        transition: all 0.3s ease;
    }

    .crm-btn-danger:hover {
        background-color: var(--red-dark);
    }

    .additional-animal-row {
        background-color: var(--bg-light);
        padding: 20px;
        border: 1px solid var(--border-light);
        border-radius: 4px;
        margin-bottom: 15px;
        position: relative;
    }

    .additional-animal-row .animal-index {
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: var(--gray-neutral);
        color: var(--white);
        padding: 4px 8px;
        border-radius: 3px;
        font-size: 12px;
        font-weight: bold;
    }

    .additional-animal-row .remove-animal-btn {
        display: flex;
        justify-content: flex-end;
        margin-top: 15px;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 600;
        font-size: 14px;
        transition: background-color 0.3s ease;
    }

    .crm-btn:hover {
        background-color: #2980b9;
    }
