/* Custom CSS for Equipment Maintenance System */

/* Timestamp Styles */
[data-timestamp] {
    cursor: help;
    transition: color 0.2s ease;
}

[data-timestamp]:hover {
    color: #0d6efd;
}

[data-timestamp]:before {
    content: "🕐 ";
    opacity: 0.7;
    font-size: 0.9em;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 10px 10px 0 0 !important;
}

/* Statistics Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    border: none;
}

.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-info:hover,
.card.bg-warning:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease-in-out;
}

/* Button Styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Table Styles */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Badge Styles */
.badge {
    font-size: 0.75em;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

/* Form Styles */
.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 8px;
    font-weight: 500;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Mobile-specific styles */
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        min-height: 44px; /* Touch-friendly button size */
        font-size: 1rem;
    }
    
    .form-control {
        min-height: 44px; /* Touch-friendly input size */
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Mobile navigation */
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
    }
    
    .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }
    
    .dropdown-item {
        padding: 0.5rem 1rem;
        color: rgba(255, 255, 255, 0.75);
    }
    
    .dropdown-item:hover {
        color: white;
        background-color: transparent;
    }
}

/* Tablet styles */
@media (max-width: 1024px) and (min-width: 769px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .btn {
        min-height: 40px;
    }
    
    .form-control {
        min-height: 40px;
    }
}

/* Mobile-specific inspection form */
@media (max-width: 768px) {
    .inspection-item {
        margin-bottom: 1.5rem;
        padding: 1.25rem;
    }
    
    .status-options {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .status-option {
        padding: 0.75rem;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        background-color: #f8f9fa;
    }
    
    .status-option input[type="radio"] {
        margin-right: 0.75rem;
        transform: scale(1.2);
    }
    
    .status-option label {
        font-size: 1rem;
        margin-bottom: 0;
    }
    
    .photo-upload-area {
        padding: 1.5rem;
        margin-top: 1rem;
    }
    
    .photo-upload-area i {
        font-size: 2rem;
    }
    
    .signature-pad {
        height: 150px;
    }
    
    /* Mobile dashboard cards */
    .card.bg-primary,
    .card.bg-success,
    .card.bg-info,
    .card.bg-warning {
        margin-bottom: 1rem;
    }
    
    .card.bg-primary .card-body,
    .card.bg-success .card-body,
    .card.bg-info .card-body,
    .card.bg-warning .card-body {
        padding: 1rem;
    }
    
    .card.bg-primary h4,
    .card.bg-success h4,
    .card.bg-info h4,
    .card.bg-warning h4 {
        font-size: 1.5rem;
    }
    
    .card.bg-primary i,
    .card.bg-success i,
    .card.bg-info i,
    .card.bg-warning i {
        font-size: 1.5rem;
    }
}

/* Touch-friendly elements */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    .btn:active {
        transform: scale(0.98);
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar {
        padding: 0.25rem 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .inspection-item {
        padding: 1rem;
    }
    
    .status-options {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .status-option {
        flex: 1;
        min-width: 120px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn,
    .form-control,
    .card {
        border-width: 0.5px;
    }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
    .btn:focus,
    .form-control:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
    
    .btn:focus:not(:focus-visible) {
        outline: none;
    }
    
    /* Ensure sufficient color contrast */
    .text-muted {
        color: #6c757d !important;
    }
    
    .alert {
        border-left: 4px solid;
        padding-left: 1rem;
    }
    
    .alert-success {
        border-left-color: #28a745;
    }
    
    .alert-warning {
        border-left-color: #ffc107;
    }
    
    .alert-danger {
        border-left-color: #dc3545;
    }
    
    .alert-info {
        border-left-color: #17a2b8;
    }
}

/* Inspection Form Styles */
.inspection-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #fff;
}

.inspection-item h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Photo Upload Styles */
.photo-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    transition: border-color 0.2s ease-in-out;
}

.photo-upload-area:hover {
    border-color: #007bff;
    background-color: #e3f2fd;
}

.photo-upload-area.dragover {
    border-color: #007bff;
    background-color: #e3f2fd;
}

/* Signature Pad Styles */
.signature-pad {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}
