/* Custom CSS for Vision Work Order Viewer */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar-brand-icon {
    height: 1.9rem;
    width: auto;
    margin-right: 0.4rem;
    vertical-align: middle;
    filter: brightness(0) invert(1);
}


main {
    flex: 1;
}

/* Card hover effects */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Table row hover */
.table-hover tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

/* Status badges */
.badge {
    font-size: 0.85rem;
    padding: 0.35em 0.65em;
}

/* Dashboard stat cards */
.card-title {
    font-weight: bold;
}

/* Search form */
.form-label {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

/* Sticky footer */
.footer {
    margin-top: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .table {
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
}

/* Loading indicator */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Alert animations */
.alert {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Work order detail improvements */
.card-header h5 {
    margin: 0;
}

.pre-wrap {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Pagination improvements */
.pagination {
    margin-top: 1rem;
}

.page-link {
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* htmx indicator styles */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* htmx swapping animation */
.htmx-swapping {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.htmx-settling {
    opacity: 1;
    transition: opacity 0.2s ease-in;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

/* Priority 1: #2 - Stack Preset Filter Buttons Vertically */
@media (max-width: 576px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        border-radius: 0.375rem !important;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .spinner-border {
        align-self: flex-start !important;
        margin-left: 0.5rem !important;
    }
}

/* Priority 1: #3 - Increase Touch Target Sizes */
@media (max-width: 768px) {
    /* Larger buttons on mobile */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* Larger form controls */
    .form-control, .form-select {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    /* Larger clickable stat cards */
    .hover-stat {
        padding: 1rem !important;
    }
    
    /* Larger card clickable areas */
    .card[onclick] {
        min-height: 80px;
    }
}

/* Priority 2: #5 - Reduce Card Padding */
@media (max-width: 768px) {
    .card-body {
        padding: 0.75rem !important; /* Override existing 1rem */
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    /* Keep reasonable padding for notes content */
    .card-body.p-3 {
        padding: 0.75rem !important;
    }
}

/* Priority 2: #6 - Sticky Preset Filters (DISABLED per user request) */
/* @media (max-width: 768px) {
    .preset-filters-sticky {
        position: sticky;
        top: 56px;
        z-index: 1020;
        background: white;
        padding: 0.75rem;
        margin: -0.75rem -0.75rem 0.75rem -0.75rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
} */

/* Priority 3: #8 - Disable Hover Effects on Mobile */
@media (max-width: 768px) {
    .card {
        transition: none;
    }
    
    .card:hover {
        transform: none;
        box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important; /* Keep default shadow */
    }
    
    .hover-card:hover {
        transform: none;
        box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important;
    }
}

/* Apply hover effects only on desktop */
@media (min-width: 769px) {
    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    }
    
    .hover-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    }
}

/* Priority 3: #9 - Optimize Dashboard Stats */
@media (max-width: 767px) {
    /* Smaller stat numbers on mobile */
    .dashboard-stats h3 {
        font-size: 2rem;
    }
    
    /* Reduce spacing between stat cards */
    .dashboard-stats .col-md-6 {
        margin-bottom: 0.75rem;
    }
}

/* Priority 3: #11 - Stack Timeline Datetimes */
@media (max-width: 576px) {
    .timeline-content .d-flex {
        flex-direction: column !important;
    }
    
    .timeline-content .text-nowrap {
        white-space: normal !important;
        margin-left: 0 !important;
        margin-top: 0.25rem;
        font-size: 0.875rem;
    }
}

/* Priority 3: #12 - Simplify Footer */
@media (max-width: 576px) {
    .footer small {
        font-size: 0.7rem;
    }
    
    .footer br {
        display: none;
    }
    
    /* Inline both lines with separator */
    .footer .container {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Hide browser time on very small screens */
    .footer-browser-time {
        display: none;
    }
}

/* Priority 2: #7 - Collapsible Search Form Styling */
@media (max-width: 768px) {
    #searchFormCollapse.collapse:not(.show) {
        display: none;
    }
    
    .search-toggle-btn {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Mobile-specific: Improve notes button spacing */
@media (max-width: 768px) {
    .card-header .btn-group-sm .btn {
        padding: 0.5rem 0.75rem;
    }
}

.notes-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.notes-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
