/* Custom Styles for Facility Maintenance System */

body {
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
}

.content {
    margin-bottom: 2rem;
}

/* Status colors */
.status-new {
    background-color: white !important;
}

.status-assigned {
    background-color: #fff9c4 !important; /* Light yellow */
}

.status-in-progress {
    background-color: #c8e6c9 !important; /* Light green */
}

.status-completed {
    background-color: #bbdefb !important; /* Light blue */
}

.status-cancelled {
    background-color: #ffcdd2 !important; /* Light red */
}

/* Sortable column headers */
th.sortable {
    cursor: pointer;
    position: relative;
}

th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

th.sortable::after {
    content: "↕"; /* Default indicator */
    margin-left: 5px;
    font-size: 0.8em;
    opacity: 0.5;
}

th.sortable.asc::after {
    content: "↑"; /* Ascending indicator */
    opacity: 1;
}

th.sortable.desc::after {
    content: "↓"; /* Descending indicator */
    opacity: 1;
}

/* Scrollable issue description */
.issue-cell {
    max-height: 80px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 5px;
    border-radius: 4px;
    background-color: #f9f9f9;
}

/* Priority badges */
.badge-low {
    background-color: #a5d6a7;
    color: #1b5e20;
}

.badge-medium {
    background-color: #fff59d;
    color: #f57f17;
}

.badge-high {
    background-color: #ffab91;
    color: #bf360c;
}

.badge-critical {
    background-color: #ef9a9a;
    color: #b71c1c;
}
th.sortable.active {
  background-color: rgba(0, 123, 255, 0.1);
}

th.sortable.active::after {
  content: " ↓";
  color: #0d6efd;
}
/* Attachment styling */
/* Add these styles to your styles.css file */

/* Attachment items styling */
.attachment-item {
    transition: background-color 0.2s;
    border-radius: 4px;
}

.attachment-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.attachment-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

.attachment-link {
    color: #0d6efd;
    text-decoration: none;
    word-break: break-word;
}

.attachment-link:hover {
    text-decoration: underline;
}

.attachment-date {
    color: #6c757d;
    font-size: 0.85rem;
}
/* Add these styles to your styles.css file */

/* Notes history styling */
.note-item {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 8px;
}

.note-item:last-child {
    border-bottom: none;
}

.note-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
}

.note-timestamp {
    font-style: italic;
}

.note-author {
    font-weight: 500;
}

/* Status badges in notes */
.note-status {
    font-weight: 500;
}

.status-change {
    font-style: italic;
    color: #0d6efd;
}
/* Add a max height with scrolling for many attachments */
#viewAttachments {
    max-height: 250px;
    overflow-y: auto;
}

/* Add a file icon to the update attachment input */
.custom-file-upload {
    display: inline-block;
    padding: 6px 12px;
    cursor: pointer;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.custom-file-upload i {
    margin-right: 5px;
}
/* Mobile optimizations */
@media (max-width: 768px) {
    /* Make table rows more readable on mobile */
    #requestsTable td, 
    #equipmentTable td, 
    #locationsTable td {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    /* Add some space between filter controls on mobile */
    .filter-controls .form-select,
    .filter-controls .btn {
        margin-bottom: 0.5rem;
    }
    
    /* Make the main content area use the full width */
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Style the Request ID to be more prominent in mobile view */
    #requestsTable td:first-child {
        font-weight: bold;
    }
    
    /* Make action buttons more tappable on mobile */
    .update-btn {
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
    }
}

/* Animation for status transitions */
@keyframes highlight {
    0% { background-color: rgba(255, 241, 118, 0.5); }
    100% { background-color: inherit; }
}

.status-updated {
    animation: highlight 2s;
}

/* Floating action button for mobile */
.floating-action-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
}
/* Locations styling */

/* Location table styles */
#locationsTable .location-name {
    font-weight: 500;
}

/* Add animation for loading states */
.spinner-border {
    animation-duration: 0.8s;
}

/* Style for location cards in details view */
.location-card {
    transition: all 0.2s ease-in-out;
    border-left: 4px solid #6c757d;
}

.location-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Style for equipment cards in location view */
#viewLocationEquipment .card-header {
    padding: 0.5rem 1rem;
}

/* Style for notes in location history */
.note-item {
    border-left: 3px solid #007bff;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Tab styling */
.nav-tabs .nav-link {
    color: #495057;
}

.nav-tabs .nav-link.active {
    font-weight: 500;
    color: #007bff;
}

/* Status badges in location requests */
.badge.bg-info {
    background-color: #0dcaf0 !important;
}

.badge.bg-primary {
    background-color: #0d6efd !important;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000;
}

/* Button styles */
.btn-outline-primary {
    border-color: #0d6efd;
    color: #0d6efd;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: #fff;
}

.btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    color: #fff;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #locationsTable th:nth-child(1), 
    #locationsTable td:nth-child(1) {
        display: none; /* Hide ID column on mobile */
    }
    
    .action-buttons-cell {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-buttons-cell .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }
}
@media (max-width: 768px) {
    .floating-action-btn {
        display: flex;
    }
}
