/* Custom styles for SPOT Maintenance */

:root {
    /* Override Bootstrap primary purple with dark blue */
    --bs-primary: #1e3a8a;
    --bs-primary-rgb: 30, 58, 138;
    --bs-primary-bg-subtle: #1e40af;
    --bs-primary-border-subtle: #1d4ed8;
    --bs-primary-text-emphasis: #0f172a;
    
    --equipment-card-hover: var(--bs-secondary);
    --status-success: var(--bs-success);
    --status-warning: var(--bs-warning);
    --status-danger: var(--bs-danger);
}

/* Base responsive design */
html {
    font-size: 16px;
}

body {
    font-size: 1rem;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Touch-friendly interactive elements */
a, button, .btn, .form-control, .form-select {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm {
    min-height: 36px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    min-height: 48px;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
}

/* Form controls touch-friendly */
.form-control, .form-select {
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 0.5rem;
}

/* Focus states for accessibility */
.btn:focus, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
    outline: none;
}

/* Mobile typography scale */
@media (max-width: 576px) {
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
        line-height: 1.3;
    }
    
    h4, h5, h6 {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .breadcrumb {
        font-size: 0.875rem;
    }
}

/* Force dark blue for all primary elements */
.btn-primary {
    background-color: #1e3a8a !important;
    border-color: #1e3a8a !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

.btn-primary:active {
    background-color: #1e40af !important;
    border-color: #1e40af !important;
}

.btn-outline-primary {
    color: #60a5fa !important;
    border-color: #60a5fa !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: #1e3a8a !important;
    border-color: #1e3a8a !important;
    color: #ffffff !important;
}

.bg-primary {
    background-color: #1e3a8a !important;
}

.text-primary {
    color: #60a5fa !important;
}

.link-primary {
    color: #60a5fa !important;
}

.link-primary:hover,
.link-primary:focus {
    color: #93c5fd !important;
}

.border-primary {
    border-color: #1e3a8a !important;
}

.navbar-dark.bg-primary {
    background-color: #1e3a8a !important;
}

.badge.bg-primary {
    background-color: #1e3a8a !important;
}

.alert-primary {
    background-color: rgba(30, 58, 138, 0.1) !important;
    border-color: #1e3a8a !important;
    color: #1e3a8a !important;
}

/* Equipment cards */
.equipment-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid var(--bs-border-color);
}

.equipment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.equipment-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.equipment-details p {
    margin-bottom: 0.5rem;
}

.equipment-details p:last-child {
    margin-bottom: 0;
}

/* Equipment placeholder */
.equipment-placeholder {
    padding: 2rem;
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.375rem;
    text-align: center;
}

/* Equipment thumbnails */
.equipment-thumbnail {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

.equipment-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.equipment-thumbnail-placeholder {
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.equipment-thumbnail-placeholder:hover {
    background-color: var(--bs-tertiary-bg) !important;
    transform: scale(1.05);
}

/* Status indicators */
.status-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.status-item:last-child {
    border-bottom: none;
}

/* Form enhancements */
.form-control:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25);
}

.form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25);
}

/* Badge enhancements */
.badge {
    font-size: 0.75em;
    padding: 0.35em 0.65em;
}

/* Table responsiveness */
.table-responsive {
    border-radius: 0.375rem;
}

/* Pagination */
.pagination .page-link {
    color: #60a5fa;
    border-color: var(--bs-border-color);
}

.pagination .page-link:hover {
    color: #93c5fd;
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}

.pagination .page-item.active .page-link {
    background-color: #1e3a8a;
    border-color: #1e3a8a;
}

/* Navbar customization */
.navbar-brand {
    font-weight: 600;
}

/* Card header customization */
.card-header h4,
.card-header h5,
.card-header h6 {
    color: var(--bs-heading-color);
}

/* Footer */
footer {
    margin-top: auto;
}

/* Image handling */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Mobile navigation improvements */
.navbar-toggler {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

.navbar-nav .nav-link {
    padding: 0.35rem 0.55rem;
    font-weight: 500;
    font-size: .875rem;
}

/* Two-row navbar: brand row separator */
.navbar-brand-row {
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
}

/* Ensure every nav item — plain or dropdown — is vertically centred */
.navbar .navbar-nav > .nav-item {
    display: flex;
    align-items: center;
    align-self: center;
}
.navbar .navbar-nav > .nav-item > .nav-link {
    display: flex;
    align-items: center;
    height: 100%;
}

/* Card improvements for mobile */
.card {
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.125);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.125);
    padding: 1rem;
}

.card-body {
    padding: 1rem;
}

/* Table responsive improvements */
.table-responsive {
    border-radius: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    margin-bottom: 0;
}

.table th, .table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-color: rgba(255, 255, 255, 0.125);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .equipment-card {
        margin-bottom: 1rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .d-flex.gap-2 {
        gap: 0.5rem !important;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .d-flex.gap-2 .btn {
        white-space: nowrap;
        min-width: auto;
        flex: 0 0 auto;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th, .table td {
        padding: 0.5rem;
    }
    
    /* Card spacing for mobile */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Form improvements for mobile */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    /* Breadcrumb mobile adjustments */
    .breadcrumb {
        padding: 0.5rem 0;
        margin-bottom: 1rem;
        font-size: 0.875rem;
        flex-wrap: wrap;
    }
    
    .breadcrumb-item {
        word-break: break-word;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
}

/* Large screen adjustments */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Loading states */
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Alert customization */
.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* Modal customization */
.modal-content {
    border: none;
    border-radius: 0.5rem;
}

.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
}

.modal-footer {
    border-top: 1px solid var(--bs-border-color);
}

/* Breadcrumb customization */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--bs-secondary);
}

/* Icon spacing */
.fas,
.far,
.fab {
    line-height: 1;
}

/* Search form enhancement */
.input-group .form-control:focus {
    z-index: 3;
}

/* Service type badges */
.badge.bg-secondary {
    background-color: var(--bs-secondary) !important;
}

/* Photo display */
.equipment-photo {
    max-width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 0.375rem;
}

/* Empty state styling */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state i {
    opacity: 0.5;
}

/* Print styles */
@media print {
    .btn,
    .navbar,
    footer,
    .pagination {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
    
    .container {
        max-width: none !important;
    }
}
