/* Global Typography and Base Styles */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

/* Enhanced Link Styles */
a {
    color: #4da3ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2b8ae6;
}

.btn-link {
    color: #4da3ff;
}

/* Modern Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5568d3 0%, #64408a 100%);
}

.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Focus Styles for Accessibility */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

/* Content Spacing */
.content {
    padding-top: 1.5rem;
}

h1:focus {
    outline: none;
}

/* Form Validation Styles */
.valid.modified:not([type=checkbox]) {
    outline: 2px solid #198754;
    outline-offset: 2px;
}

.invalid {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

.validation-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Error Boundary */
.blazor-error-boundary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    padding: 1rem 1.5rem;
    color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.blazor-error-boundary::before {
    content: "⚠";
    font-size: 1.5rem;
}

.blazor-error-boundary::after {
    content: "Ocorreu um erro na aplicação.";
}

/* Form Control Improvements */
.form-control,
.form-select {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.darker-border-checkbox.form-check-input {
    border-color: #6c757d;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: #6c757d;
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Card Enhancements */
.card {
    border-radius: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

/* Badge Improvements */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

/* Table Improvements */
.table {
    font-size: 0.9375rem;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* Avatar Circle for List Items */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: #fff;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Spinner Customization */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Utility Classes */
.shadow-sm {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.075) !important;
}

.border-0 {
    border: 0 !important;
}

/* Responsive Font Sizes */
@media (min-width: 1200px) {
    .display-4 {
        font-size: 3rem;
    }
}

/* Bootstrap Icon Improvements */
.bi {
    vertical-align: -0.125em;
}

/* Background Gradient Class */
.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Autocomplete Dropdown Styles */
.cliente-autocomplete,
.municipio-autocomplete,
.equipamento-autocomplete {
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 300px;
    overflow-y: auto;
    background-color: white;
}

.autocomplete-dropdown .list-group-item {
    cursor: pointer;
    border-left: 0;
    border-right: 0;
    padding: 0.75rem 1rem;
}

.autocomplete-dropdown .list-group-item:first-child {
    border-top: 0;
}

.autocomplete-dropdown .list-group-item:last-child {
    border-bottom: 0;
}

.autocomplete-dropdown .list-group-item.active {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

.autocomplete-dropdown .list-group-item:not(.active):hover {
    background-color: rgba(102, 126, 234, 0.1);
}