<?php echo $__env->make('patients.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?> 
@Session::forget('otp');
<style>
       .timeline {
        border-left: 3px solid #007bff;
        padding-left: 20px;
        position: relative;
        margin-top: 85px;
        left: -155px;
    }

    .timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 21px;
    width: 2px;
    height: 111%;
    background-color: transparent;
    }
    .timeline-item {
        margin-bottom: 20px;
        background: #fff;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
        position: relative;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        width: 1300px;
    }
    .timeline-item:hover {
        transform: translateY(-5px);
        box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.15);
    }
    .timeline-item::before {
        content: "";
        width: 16px;
        height: 16px;
        background: #0847d9;
        border-radius: 50%;
        position: absolute;
        left: -29px;
        top: 18px;
        border: 3px solid #fff;
        box-shadow: 0px 0px 6px rgba(0, 35, 71, 0.5);
    }
    .timeline-item h6 {
        font-weight: bold;
        color: #0847d9;
        margin-bottom: 10px;
    }
    .timeline-item p {
        margin-bottom: 5px;
        color: #555;
    }
    .timeline-item a {
        color: #0847d9;
        font-weight: bold;
        text-decoration: none;
        cursor: pointer;
    }
    .timeline-item a:hover {
        text-decoration: underline;
    }
    .hidden-text {
        display: none;
        color: #333;
        word-spacing: 4px;
    }
    .read-more {
        color: #0847d9;
        font-weight: bold;
        text-decoration: none;
        cursor: pointer;
    }
    .read-more:hover {
        text-decoration: underline;
    }
    @media screen and (max-width: 1540px) {
        .timeline {
        border-left: 3px solid 0847d9;
        padding-left: 20px;
        position: relative;
        margin-top: 120px;
        left: -155px;
    }
        .timeline-item {
        margin-bottom: 12px;
        background: #fff;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
        position: relative;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        width: 940px;
    }
    }
    @media screen and (min-width: 768px) and (max-width: 1340px){
        .timeline {
        border-left: 3px solid 0847d9;
        padding-left: 20px;
        position: relative;
        margin-top: 110px;
        left: -120px;
    }
        .timeline-item {
        margin-bottom: 12px;
        background: #fff;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
        position: relative;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        width: 940px;
    }

    }

    .action-icons i {
        cursor: pointer;
        font-size: 1.2rem;
    }
    .action-icons i:hover {
        opacity: 0.8;
    }
</style>


<main class="flex-grow-1">
    <div class="container mt-5">
        <?php if(Auth::guard('hcp')->check()): ?>
            <?php
                header("Location: " . route('patients.vitals'));
                exit();
            ?>
        <?php else: ?>
            <div class="col-md-8">
                <div class="timeline">
                    <?php $__currentLoopData = $getNotes->healthHistories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $healthHistory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="timeline-item">
                            <h6>Date: <?php echo e(\Carbon\Carbon::parse($healthHistory->diagnosis_date)->format('F j, Y')); ?> | Doctor: 
                                <?php
                                    $hcpName = App\Models\PatientHcpName::where('health_history_id', $healthHistory->health_history_id)->first();
                                ?>
                                <?php if($hcpName): ?>
                                    <?php echo e($hcpName->provider_name); ?>

                                <?php else: ?>
                                    No provider found
                                <?php endif; ?>
                            </h6>
                            <p>
                                <?php
                                    $fullText = $healthHistory->hcp_notes;
                                    $shortText = substr($fullText, 0, 100);
                                ?>
                                <?php echo e(trim($shortText)); ?> <span class="hidden-text"><?php echo e(substr($fullText, 100)); ?></span>
                                <?php if(strlen($fullText) > 100): ?>
                                    <a href="#" class="read-more">Read more</a>
                                <?php endif; ?>
                            </p>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
        <?php endif; ?>
    </div>
</main>



<script>
    document.addEventListener("DOMContentLoaded", function() {
        document.querySelectorAll(".read-more").forEach(function(link) {
            link.addEventListener("click", function(event) {
                event.preventDefault();
                let hiddenText = this.previousElementSibling;
                if (hiddenText.style.display === "none" || hiddenText.style.display === "") {
                    hiddenText.style.display = "inline";
                    this.textContent = "Read less";
                } else {
                    hiddenText.style.display = "none";
                    this.textContent = "Read more";
                }
            });
        });
    });
</script>







<?php /**PATH /var/www/html/resources/views/patients/patient_notes.blade.php ENDPATH**/ ?>