/* Modern Blazor UI Styles */
@font-face {
    font-family: 'Bariol';
    src: url('../fonts/Bariol_Regular.otf');
}

@font-face { 
	font-family: 'Bariol'; 
	font-weight: bold; 
	src: url('../fonts/Bariol_Bold.otf');
}

@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700");
@import url("https://fonts.googleapis.com/css?family=Roboto:400,300,500,700");

:root {
    --primary-color: #3c3c3c;
    --primary-hover: #676a6c;
    --secondary-color: #6c757d;
    --success-color: #95c11f;
    --danger-color: #ed5565;
    --warning-color: #f39200;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Global Styles */
body {
    font-family: "Bariol","open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    font-size: 14px;
}

.global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-success {
    background-color: var(--success-color) !important;
    border: 1px solid var(--success-color) !important;
}

.btn-success:hover{
    background-color: var(--primary-color) !important;
    border: 1px solid var(--primary-color) !important;
}

/* Custom Components */
.card-modern {
    background: white;
    /* border-radius: var(--border-radius); */
    box-shadow: var(--box-shadow);
    border: none;
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

/* .card-modern:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
} */

.card-header-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    /* border-radius: var(--border-radius) var(--border-radius) 0 0; */
    padding: 1rem 1.5rem;
    font-weight: 600;
}

/* Enhanced Buttons */
.btn-modern {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.btn-primary-modern:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    color: white;
}

/* Enhanced Forms */
.form-control-modern {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 0.95rem;
}

.form-control-modern:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 112, 15, 0.25);
    outline: none;
}

.form-label-modern {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Tables */
.table-modern {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    margin-bottom: 1.5rem;
}

.table-hover tbody tr:hover {
    background-color: #f5f5f5;
}

.table-modern thead th {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-modern tbody tr {
    transition: var(--transition);
}

.table-modern tbody tr:hover {
    background: #f1f3f5;
    transition: background 0.2s;
}

.table-modern tbody td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

/* Enhanced Modals */
.modal-modern .modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-modern .modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: none;
}

.modal-modern .modal-title {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading Spinner */
.spinner-modern {
    width: 3rem;
    height: 3rem;
    border: 3px solid #e9ecef;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Indicators */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-inactive {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* Search Bar */
.search-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input {
    padding-left: 2.5rem;
    border-radius: 25px;
    border: 2px solid #e9ecef;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 112, 15, 0.25);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Pagination */
.pagination-modern .page-link {
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
    border: none;
    color: var(--primary-color);
    font-weight: 500;
    transition: var(--transition);
}

.pagination-modern .page-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.pagination-modern .page-item.active .page-link {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .table-modern {
        font-size: 0.8rem;
    }
    
    .table-modern thead th,
    .table-modern tbody td {
        padding: 0.5rem;
    }
    
    .btn-modern {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

html, body {
    font-family: "Bariol","open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    /* font-family: 'Arial', 'Helvetica', 'sans-serif', Helvetica, Arial, sans-serif; */
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.custom-heading {
    color: #235712;
    /* Optional: add font size, weight, etc. */
}

.custom-green {
    background-color: #4e700f !important;
    color: white !important;
    border: 1px solid #235712 !important;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    display: inline-block;
    text-align: center;
    cursor: pointer;
}

.custom-orange {
    background-color: #fd7e14 !important; /* Bootstrap warning orange */
    color: white !important;
    border: 1px solid #e66a00 !important;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    display: inline-block;
    text-align: center;
    cursor: pointer;
}


.custom-green:hover {
    background-color: #1e4d0f;
    border-color: #1e4d0f;
}

.ibox-item {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border: 1px solid #e5e5e5;
}

.btn-change-contractor {
    background-color: #a3d133;
    color: #222;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    padding: 10px 24px;
    transition: background 0.2s, color 0.2s;
}

    .btn-change-contractor:hover {
        background-color: #8bc926;
        color: #fff;
    }


.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}


td, th {
    padding: 8px;   
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    vertical-align: top;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: red;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45OTMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZWQiLz48L2c+PC9zdmc+) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}


/* Styles for fixed table layout */
.fixed-table-layout {
    table-layout: fixed; /* Forces columns to respect specified widths */
    width: 100%; /* Ensures the table spans the full width of its container */
}

.fixed-table-layout th,
.fixed-table-layout td {
    overflow: hidden; /* Hides content that overflows the cell */
    text-overflow: ellipsis; /* Adds "..." to text that overflows */
    white-space: nowrap; /* Prevents text from wrapping to the next line */
    word-break: break-word; /* Allows long words to break if they don't fit */
}


.table-responsive.table-container {
    overflow-x: auto !important; /* Use !important ONLY for debugging, then remove */
    max-width: 100% !important; /* Use !important ONLY for debugging, then remove */
}


    /* Optional: If you want to visually indicate the scrollbar */
    .table-container::-webkit-scrollbar {
        height: 8px;
    }

    .table-container::-webkit-scrollbar-thumb {
        background-color: #ccc;
        border-radius: 4px;
    }

/* Styles for wrap table layout */

.wrap-table {
    /* display: block; */
    overflow-x: auto;
    /* width: 100%; */
}

    .wrap-table th,
    .wrap-table td {
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        min-width: 150px;
        /*min-width: 100px;*/ /* Ensures columns don't get too narrow */
        text-overflow: clip;
        overflow: visible;
    }

.break-all-content {
    word-break: break-all;
}

/* Green checkbox when checked */
input.form-check-input:checked {
    background-color: #28a745; /* Bootstrap green */
    border-color: #28a745;
}

/* Optional: white tick inside checkbox */
input.form-check-input:checked::before {
    background-color: white;
}

input.form-check-input:checked {
    background-color: #28a745; /* Green */
    border-color: #28a745;
}

.search-bar .input-group-text {
    background: #fff;
    border-right: 0;
}

.search-bar .form-control {
    border-left: 0;
}

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* Required Star */
.required-star,
span.required-star {
    color: red;
    margin-left: 3px;
}

/* Table Styles */
.reading-column {
    min-width: 100px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table th {
    position: relative;
    cursor: pointer;
}

.table th.not-sortable {
    cursor: default !important;

    &:hover {
        cursor: default !important;
    }
}

.table th:hover {
    background-color: rgba(0,0,0,0.05);
}

.form-control-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

thead th {
    vertical-align: top;
    white-space: nowrap;
}

.table > thead > tr > th {
    padding-bottom: 0.75rem;
}

.search-field {
    width: 50% !important;
}

.container-align {
    margin-left: initial !important;
    margin-right: initial !important;
}

nav.breadcrumb {
    border-bottom: 1px solid var(--primary-hover);
}

/* Modal Close Button Styles */
.custom-close span {
    color: #fff !important;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.custom-close:hover span {
    color: #e0e0e0 !important;
}