/* CSS Variables for Consistent Theming */
:root {
    --button-hover-bg: rgb(102, 153, 170);
    --button-active-bg: rgb(60, 123, 161);
    --card-hover-bg: rgb(195, 202, 204);
    --warning-bg: red;
    --warning-text: #F8F8F8;
    --transition-speed: 0.1s;
    --animation-speed: 2s;
    --overlay-bg: rgba(255, 255, 255, 0.8);
}

/* Global Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.full-height {
    height: 100%;
}

body {
    background-size: cover;
    display: flex;
    flex-direction: row;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: rgb(6, 12, 68);

    font-family: "IBM Plex Sans", sans-serif !important;
    font-weight: 400;
    font-style: normal;

    ::-webkit-scrollbar {
        width: 9px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background-color: rgba(155, 155, 155, 0.5);
        border-radius: 20px;
        border: transparent;
    }
}

h1 {
    font-family: "IBM Plex Serif", serif !important;
    font-weight: 600;
    font-style: normal;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    overflow-y: auto;
    background-color: rgb(212, 212, 212);
    color: black;
    border-width: 12px;
    border-style: solid;
    border-color: #181818;
}

th,
td {
    text-align: center;
    /* Unified text alignment */
}

textarea {
    width: 100%;
    height: 100%;
    padding: 10px;
    resize: vertical;
    background-color: #181818;
    color: white;
}

input,
select,
chat-input {
    border-radius: 8px;
    padding: 8px;
    margin: 4px;
    border: 1px solid #ccc;
    background-color: black;
    color: white;
}

input {
    margin: 4px;
}

select {
    display: block;
    width: 100%;
    height: auto;
}

div {
    transition: all var(--transition-speed) ease-in-out;
}

img {
    transition: transform var(--transition-speed) ease-in-out;
    max-width: 100%;
    height: auto;
}

.warning {
    background-color: var(--warning-bg);
    color: var(--warning-text);
    padding: 8px;
    border-radius: 8px;
}

.icon {
    width: 64px;
    height: 64px;
    object-fit: cover;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

.holder {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 12px;
    padding: 16px;
}

/* Tooltip Styles */
.tiptool {
    position: relative;
    display: table-cell;
    border-bottom: 1px dotted black;
}

.tiptool .tiptooltext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 6px;
    margin: 6px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.tiptool .tiptooltext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tiptool:hover .tiptooltext {
    visibility: visible;
    opacity: 1;
}

/* Popup Styles */
.cover,
.popup {
    top: 0;
    left: 0;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.popup {
    background-color: var(--overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Flex Utility Classes */
.flex-row {
    display: flex;
    flex-direction: row;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.stretch {
    flex: 1;
}

/* Additional Utility Classes */
.black {
    background: #181818 !important;
    color: white;
}

.black-button-selected {
    background: #b6b6b6;
}

/* Ensure Select Elements are Accessible */
select:focus,
input:focus,
textarea:focus,
button:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

.btn {
    margin: 4px;

    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 600;
    font-style: normal;
}

section {
    padding: 12px;
}

svg {
    color: "white";
}

.card-body {
    background-color: #444 !important;
}

.svg-icon {
    filter: invert(100%) sepia(29%) saturate(2016%) hue-rotate(194deg) brightness(109%) contrast(117%);
}

.sidebar {
    background-color: black;
    border-radius: 4px;
    filter: drop-shadow(0px 0px 8px #000000);
    padding: 8px;
}

.blink_text {
    animation-name: blink;
    width: 280px;
    animation-duration: 2s;
    animation-timing-function: ease-in;
    animation-iteration-count: Infinite;
}

@keyframes blink {
    0% {
        color: red;
    }

    50% {
        color: white;
    }

    100% {
        color: red;
    }
}

td {
    text-align: center;
    vertical-align: middle;
}

tr:hover {
    background-color: #4f5257 !important;
    color: white !important;
}

tr:active {
    background-color: #6b7179 !important;
    color: white !important;
}




/* Admin dash styles */

:root {
    --dark-gray: #222222;
    --darker-gray: #1a1a1a;
    --medium-gray: #333333;
    --light-gray: #444444;
    --text-color: #e6e6e6;
    --text-secondary: #b3b3b3;
    --category-1: #4a8cca;
    --category-2: #6ab04c;
    --category-3: #e58e26;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
}

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

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--darker-gray);
    color: var(--text-color);
    padding: 25px;
    line-height: 1.6;
}

.dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
}

.date-display {
    font-size: 14px;
    color: var(--text-secondary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.category {
    background-color: var(--dark-gray);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.category-header {
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 500;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.category-1 .category-header {
    background-color: var(--category-1);
}

.category-2 .category-header {
    background-color: var(--category-2);
}

.category-3 .category-header {
    background-color: var(--category-3);
}

.category-blocks {
    padding: 15px;
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
}

.block {
    background-color: var(--medium-gray);
    border-radius: 6px;
    padding: 15px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

.block-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.block-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.block-description {
    font-size: 12px;
    color: var(--text-secondary);
}

.category-1 .block-value {
    color: var(--category-1);
}

.category-2 .block-value {
    color: var(--category-2);
}

.category-3 .block-value {
    color: var(--category-3);
}

.adm-table-container {
    background-color: var(--dark-gray);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.adm-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.adm-table-title {
    font-size: 18px;
    font-weight: 500;
}

.last-updated {
    font-size: 12px;
    color: var(--text-secondary);
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
}

.adm-table th,
.adm-table td {
    padding: 12px 15px;
    text-align: left;
}

.adm-table th {
    background-color: var(--medium-gray);
    color: white;
    font-weight: 500;
    font-size: 14px;
}

.adm-table tr:not(:last-child) td {
    border-bottom: 1px solid var(--light-gray);
}

.adm-table td:first-child {
    width: 30%;
    color: var(--text-secondary);
}

.adm-table td:nth-child(2) {
    font-weight: 500;
    color: white;
}

.adm-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.05);
}

.adm-table tbody tr {
    background-color: var(--dark-gray);
}



/* Hidden detail rows */
.adm-table .detail-row {
    display: none;
    background-color: var(--medium-gray);
}

.adm-table .detail-row.visible {
    display: table-row;
}

.adm-table .detail-row td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--light-gray);
}

.detail-content {
    background-color: var(--dark-gray);
    padding: 15px;
    border-radius: 6px;
}


/* Indicator for expandable rows */
.expandable-indicator {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 5px;
    text-align: center;
    line-height: 15px;
    font-size: 12px;
    transition: transform 0.3s;
}

tr.active .expandable-indicator {
    transform: rotate(90deg);
}

@media (max-width: 900px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .category-blocks {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .category-blocks {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 1fr);
    }
}

::-webkit-scrollbar-corner {
    background-color: transparent;
}

@media print {
    * {
        visibility: hidden;
    }

    .printable * {
        visibility: visible !important;
        width: 100%;
        overflow: visible;
    }
}

/* Print-specific styles */
@media print {

    /* Hide everything by default */
    * {
        visibility: hidden !important;
    }

    /* Show only the analysis content */
    .analysis-printable,
    .analysis-printable * {
        visibility: visible !important;
    }

    /* Position the printable content */
    .analysis-printable {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        break-inside: auto !important;
    }

    /* Hide the download button in print */
    .download-btn {
        display: none !important;
    }

    /* Ensure proper page breaks */
    .analysis-section {
        break-inside: auto !important;
        margin-bottom: 20px !important;
    }

    /* Style the header for print */
    .analysis-print-header {
        text-align: center !important;
        font-size: 24px !important;
        font-weight: bold !important;
        margin-bottom: 30px !important;
        color: black !important;
        background: white !important;
    }

    /* Ensure content is readable in print */
    .analysis-printable * {
        color: black !important;
        background: white !important;
        border-color: black !important;
    }

    /* Style tables for print */
    .analysis-printable table {
        border-collapse: collapse !important;
        width: 100% !important;
        margin-bottom: 20px !important;
    }

    .analysis-printable th,
    .analysis-printable td {
        border: 1px solid black !important;
        padding: 8px !important;
        text-align: left !important;
    }

    .analysis-printable th {
        background-color: #f0f0f0 !important;
        font-weight: bold !important;
    }
}

/* Screen styles for the download button */
.analysis-header-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 15px !important;
}

.download-btn {
    margin: 4px !important;
    font-family: "IBM Plex Sans", sans-serif !important;
    font-weight: 600 !important;
    font-style: normal !important;
    border-radius: 8px !important;
    padding: 8px !important;
    border: none !important;
    background-color: none !important;
    color: white !important;
    cursor: pointer !important;
    transition: all var(--transition-speed, 0.1s) ease-in-out !important;
}

.download-btn:hover {
    background-color: var(--button-hover-bg, rgb(102, 153, 170)) !important;
}

.download-btn:active {
    background-color: var(--button-active-bg, rgb(60, 123, 161)) !important;
}

/* Hide the printable content wrapper from screen view */
.analysis-printable {
    display: none;
}