@extends('layouts.yellow')
@section('content')
    <div class="container-fluid">
        <div class="row mb-4">
            <div class="col-12">
                <div class="card shadow-sm border-0 rounded-lg overflow-hidden">
                    <div class="card-header text-white py-4" style="background: linear-gradient(135deg, #4A90E2 0%, #2A4E6D 100%);">
                        <div class="d-flex justify-content-between align-items-center">
                            <h2 class="mb-0 font-weight-bold">
                                <i class="fa fa-file-medical-alt mr-2"></i> {{__("detail-patient.medicalReport")}}
                            </h2>
                            <a href="javascript:history.back()" class="btn btn-light rounded-pill shadow-sm" style="transition: all 0.3s ease;">
                                <i class="fa fa-arrow-left mr-2"></i> {{__("com-form-history.backReturn")}}
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="row mb-4">
            <div class="col-md-8 mx-auto">
                <div class="card border-0 shadow-sm rounded-lg">
                    <div class="card-body p-4">
                        <div class="d-flex align-items-center mb-4">
                            <div class="patient-info-icon mr-3 d-flex align-items-center justify-content-center rounded-circle" 
                                style="width: 50px; height: 50px; background: #E3F2FD; color: #2A4E6D;">
                                <i class="fa fa-user-md fa-lg"></i>
                            </div>
                            <div>
                                <h5 class="text-color-4245A4 mb-1">{{__("detail-patient.patient")}}</h5>
                                <h4 class="font-weight-bold mb-0">{{$patientName}}</h4>
                            </div>
                        </div>

                        @if($isUpdate == 0)         
                            <form name="MedicalReport" id="MedicalReport" action="{{URL::route('/admin/create-medical-report')}}" method="POST">
                        @else
                            <form name="MedicalReport" id="MedicalReport" action="{{URL::route('/admin/update-medical-report')}}" method="POST">
                            <input type="hidden" name="id" id="id" value="{{$id}}">
                        @endif
                        <input type="hidden" name="patientId" id="patientId" value="{{$model->id}}">
                        
                            <div class="form-group">
                                
                                <div>
                                  
                                    <select class="form-control" name = "specialities" id = "specialities">
                                        <option value="">{{__('detail-patient.selectSpeciality')}}</option>
                                        @foreach($specialities as $speciality)
                                            <option value="{{$speciality->id}}">{{$speciality->name}}</option>
                                        @endforeach
                                    </select>
                                    <small class="form-text text-muted">
                                        <i class="fa fa-info-circle mr-1"></i> {{__('detail-patient.selectSpeciality.info')}}
                                    </small>
                                </div>
                                <br>
                                <label for="description" class="font-weight-bold mb-2">
                                    <i class="fa fa-clipboard-list mr-2"></i>{{__('detail-patient.descriptionMedicalReport')}}
                                </label>
                                <div class="border rounded-lg p-2" style="background-color: #f8f9fa;">
                                    <textarea 
                                        class="form-control border-0 shadow-none" 
                                        placeholder="{{__('detail-patient.descriptionMedicalReport')}}" 
                                        id="description" 
                                        name="description" 
                                        rows="20"
                                        style="background-color: transparent; resize: none;"
                                    >{{$description}}</textarea>
                                </div>
                                <small class="form-text text-muted">
                                    <i class="fa fa-info-circle mr-1"></i> Ingrese los detalles del informe médico, incluyendo hallazgos, evaluación y recomendaciones para el paciente.
                                </small>
                            </div>
                            
                            @csrf
                            
                            <div class="text-right mt-4">
                                <a href="javascript:history.back()" class="btn btn-outline-00416A rounded-pill mr-2" style="transition: all 0.3s ease;">
                                    <i class="fa fa-times mr-1"></i> {{__("com-form-history.cancel")}}
                                </a>
                                <button type="submit" class="btn btn-00416A rounded-pill" style="transition: all 0.3s ease; background: linear-gradient(135deg, #4A90E2 0%, #2A4E6D 100%) !important; border: none;">
                                    @if($isUpdate == 0)   
                                        <i class="fa fa-save mr-1"></i> {{__("detail-patient.createMedicalReport")}}
                                    @else
                                        <i class="fa fa-edit mr-1"></i> {{__("detail-patient.updateMedicalReport")}}
                                    @endif
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <style>
        .btn {
            transition: all 0.3s ease;
        }
        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
        }
        .card {
            transition: all 0.3s ease;
        }
        .card:hover {
            box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
        }
        textarea:focus {
            box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important;
        }
    </style>
    
    <script src="{{ asset('js/create-medical-report.js') }}"></script>
@endsection

