html,
body {
    font-family: 'Helvetica Neue', 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;
}

.content {
    padding-top: 1.1rem;
}

@media (max-width: 1279.98px) {
    .content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

h1:focus {
    outline: none;
}

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

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

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg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    content: "An error has occurred."
}

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

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Toast Styling */
.toast-container {
    z-index: 1090;
}

.toast {
    min-width: 300px;
    max-width: 400px;
}

.toast-body {
    padding: 0.75rem;
}

/* Common Report Form Styles */
.card {
    box-shadow: none;
    border-radius: 0;
}

.section-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.form-control,
.form-select {
    background-color: #f2f2f2;
    border: 1px solid #ced4da;
    border-radius: 0;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    box-shadow: none;
    border-color: #80bdff;
}

.form-label {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-wrap: nowrap;
}


.form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
}

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

/* Toggle Switch Styling */
.form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(0,0,0,0.25)'/%3e%3c/svg%3e");
    background-position: left center;
    border-radius: 2em;
    transition: background-position 0.15s ease-in-out;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-color: #28a745;
    border-color: #28a745;
}

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(0,0,0,0.25)'/%3e%3c/svg%3e");
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

.form-switch .form-check-input:checked:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-label {
    font-size: 0.85rem;
    color: #333;
    cursor: pointer;
    padding-left: 0.5rem;
}


.form-actions {
    margin-top: 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

.btn-submit {
    background-color: #ff0000;
    color: white;
    padding: 0.75rem 4rem;
    font-weight: 600;
    text-transform: uppercase;
    border: none;
    border-radius: 0;
}

.btn-submit:hover {
    background-color: #cc0000;
    color: white;
}

.btn-submit:disabled {
    background-color: #ffcccc;
    cursor: not-allowed;
}

.alert {
    border-radius: 0;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .page-container {
        padding: 1rem 0.5rem;
    }

    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .btn-submit {
        width: 100%;
        padding: 0.75rem 2rem;
    }
}

.text-muted {
    font-size: 0.85rem;
}

/* Common Action Icons */
.action-icon {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 0;
    transition: all 0.2s ease;
    position: relative;
    vertical-align: middle;
}

.action-icon::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.icon-edit::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a90e2' stroke-width='2'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
}

.icon-edit:hover::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232874c7' stroke-width='2'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
}

.icon-delete::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e74c3c' stroke-width='2'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
}

.icon-delete:hover::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c0392b' stroke-width='2'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
}

@media (max-width: 768px) {
    .action-icon {
        width: 28px;
        height: 28px;
    }
}

.info-card {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.info-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Section Header Styling (for detail pages) */
.section-header {
    background-color: #2c3e50;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
}

/* Status Bar Styling */
.status-bar {
    background-color: #dc3545;
    transition: background-color 0.3s ease;
}

.status-bar.active {
    background-color: #28a745;
}

/* Mobile Responsive Improvements - Tablet First Approach (< 1280px) */
@media (max-width: 1279.98px) {
    /* General Layout */
    body {
        font-size: 16px; /* Better readability on mobile */
    }

    /* Tables - Make them scrollable horizontally on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.9rem;
    }

    table th,
    table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        touch-action: manipulation; /* Better touch response */
    }

    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Forms */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px; /* Better touch target */
    }

    .form-label {
        font-size: 1rem;
    }

    /* Cards and Sections */
    .card {
        margin-bottom: 1rem;
    }

    .section-card {
        border-radius: 4px;
        margin-bottom: 1rem;
    }

    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    /* Navigation improvements for small screens */
    .nav-tabs {
        flex-wrap: wrap;
    }

    .nav-tabs .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Toast notifications */
    .toast {
        min-width: auto;
        max-width: 90vw;
    }
}

/* Extra small mobile devices (< 768px) */
@media (max-width: 767.98px) {
    /* Even more compact on small phones */
    .page-title {
        font-size: 1.25rem;
    }

    table {
        font-size: 0.85rem;
    }

    table th,
    table td {
        padding: 0.5rem 0.25rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.625rem 1.25rem;
    }

    /* Stack form fields on very small screens */
    .row > [class*='col-'] {
        margin-bottom: 0.75rem;
    }
}

/* Landscape orientation adjustments for tablets */
@media (max-width: 1279.98px) and (orientation: landscape) {
    main {
        padding-top: 90px; /* Slightly less padding in landscape */
    }

    .top-row {
        min-height: 90px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets on touch devices */
    a, button, .btn, .nav-link {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Search Components Styling */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-bar-container {
    position: relative;
    width: 100%;
}

.search-bar-container .search-input,
.search-bar-container .form-control.search-input {
    width: 100%;
    padding: 1rem 2.5rem 1rem 1.25rem !important;
    font-size: 1.125rem !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    min-height: 56px !important;
}

.clear-search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.clear-search-button:hover {
    opacity: 1;
}

.clear-search-button::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.search-results-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.results-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.results-table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.results-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

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

.results-table tbody tr:last-child {
    border-bottom: none;
}

.results-table td {
    padding: 0.75rem 1rem;
    color: #495057;
    font-size: 0.9rem;
}

.no-results {
    padding: 2rem 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

@media (max-width: 1279.98px) {
    .search-results-overlay {
        max-height: 300px;
    }

    .results-table th,
    .results-table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Technician Views Shared Styles */
.tech-page-header {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tech-loading-message,
.tech-empty-message {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    font-size: 1.1rem;
}

.tech-count {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-left: 4px solid #2AB573;
    font-size: 1.1rem;
    color: #2c3e50;
}

.tech-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Technician Report Row Styling */
.tech-report-row {
    cursor: pointer;
    background-color: #f8f9fa;
}

.tech-report-row-green {
    background-color: #E8F5E9;
    border-left: 4px solid #2AB573;
}

.tech-report-row-blue {
    background-color: #E3F2FD;
    border-left: 4px solid #1E90FF;
}

.tech-report-row-purple {
    background-color: #F3EBFE;
    border-left: 4px solid #9370DB;
}

.tech-report-row-lime {
    background-color: #E7F5DC;
    border-left: 4px solid #8DC540;
}

/* Technician Report Text Styling */
.report-id-green {
    color: #2AB573;
    font-weight: bold;
}

.report-id-blue {
    color: #1E90FF;
    font-weight: bold;
}

.report-id-purple {
    color: #9370DB;
    font-weight: bold;
}

.report-id-lime {
    color: #8DC540;
    font-weight: bold;
}

.report-id-amber {
    color: #f39c12;
    font-weight: bold;
}

.report-id-red {
    color: #e74c3c;
    font-weight: bold;
}

.device-id-text {
    color: #333;
    font-weight: 600;
}

.client-name {
    color: #333;
}

.address-text {
    color: #666;
}

.status-text {
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 1280px) {
    .tech-page-header {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
}
