/* Punch List Mobile UX Improvements */
/* Ensures all buttons meet WCAG touch target guidelines (minimum 48x48px) */

/* Mobile-first button sizing for all punch list buttons */
.punch-list-btn,
.btn-punch-action,
button[type="submit"],
input[type="submit"],
.btn {
    min-height: 48px;
    min-width: 48px;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    line-height: 1.5;
}

/* Extra spacing between adjacent buttons for gloved hands */
.btn + .btn,
.punch-list-btn + .punch-list-btn {
    margin-left: 8px;
}

/* Stack buttons vertically on very small screens */
@media (max-width: 576px) {
    .btn-group-mobile .btn {
        display: block;
        width: 100%;
        margin-left: 0 !important;
        margin-bottom: 8px;
    }
    
    .btn-group-mobile .btn:last-child {
        margin-bottom: 0;
    }
}

/* Ensure form buttons are properly sized on mobile */
@media (max-width: 768px) {
    /* All buttons in punch list forms */
    .punch-list-form .btn,
    .punch-list-form button,
    .punch-list-form input[type="submit"] {
        min-height: 60px; /* Larger for gloved hands */
        font-size: 1.1rem;
        font-weight: 500;
    }
    
    /* Action buttons (Approve, Reject, Complete) */
    .punch-list-actions .btn {
        min-height: 60px;
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    /* Upload/attachment buttons */
    .attachment-upload-btn,
    .image-upload-btn {
        min-height: 60px;
        width: 100%;
    }
    
    /* Ensure proper spacing between button groups */
    .btn-toolbar .btn-group {
        margin-bottom: 1rem;
    }
}

/* Specific button group layouts */
.punch-list-approve-reject {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
}

.punch-list-approve-reject .btn {
    flex: 1;
    min-height: 48px;
}

@media (max-width: 768px) {
    .punch-list-approve-reject .btn {
        min-height: 60px;
    }
}

/* Navigation buttons with proper touch targets */
.punch-list-nav .btn,
.punch-list-nav a.btn {
    min-height: 48px;
    padding: 0.75rem 1.25rem;
}

/* Ensure dropdown menus have proper touch targets */
.punch-list-dropdown .dropdown-item {
    min-height: 48px;
    padding: 0.75rem 1rem;
    line-height: 1.5;
}

/* Card action buttons */
.card-footer .btn,
.list-group-item .btn {
    min-height: 48px;
}

@media (max-width: 768px) {
    .card-footer .btn,
    .list-group-item .btn {
        min-height: 60px;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .card-footer .btn:last-child,
    .list-group-item .btn:last-child {
        margin-bottom: 0;
    }
}

/* Status change buttons */
.status-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-btn-group .btn {
    min-height: 48px;
    flex: 1 1 auto;
}

@media (max-width: 768px) {
    .status-btn-group .btn {
        min-height: 60px;
        flex: 1 1 100%;
    }
}

/* Pagination buttons */
.pagination .page-link {
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

/* Filter/search submit buttons */
.filter-form .btn,
.search-form .btn {
    min-height: 48px;
}

@media (max-width: 768px) {
    .filter-form .btn,
    .search-form .btn {
        min-height: 60px;
        width: 100%;
    }
}

/* Icons in buttons - ensure proper alignment */
.btn i.fas,
.btn i.fa {
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Make sure link buttons have the same sizing */
a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Special case: small icon-only buttons (keep 48x48 minimum) */
.btn-icon-only {
    min-height: 48px;
    min-width: 48px;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .btn-icon-only {
        min-height: 60px;
        min-width: 60px;
    }
}
