@extends('layouts.admin')

@section('content')
  @php
    $personalDetails = [
        'Mobile Number' => $usersdetals->mobileno,
        'Address' => $usersdetals->address,
        'Aadhar Card' => $usersdetals->aadharcard,
        'Class Group' => $studentProfile?->classname,
        'Father Name' => $studentProfile?->fathername,
        'Mother Name' => $studentProfile?->mothername,
        'Date of Birth' => $studentProfile?->dateofbirth,
        'Student SR No.' => $studentProfile?->srnumber,
    ];

    $bankingDetails = [
        'UPI ID' => $studentProfile?->studentupiid,
        'PAN Card' => $studentProfile?->pancardnumber,
        'Bank Account Number' => $studentProfile?->bankaccountnumber,
        'Bank Branch' => $studentProfile?->bankbranch,
        'IFSC Code' => $studentProfile?->bankifsccode,
        'Religion' => $studentProfile?->religion,
    ];
  @endphp

  <div class="card-header">
    <h4>Student Profile</h4>
  </div>
  <div class="card-body">
    @include('admin.partials.flash-messages')

    <div class="student-profile-layout">
      <div class="student-profile-card">
        <div class="student-profile-hero">
          <img src="{{ $studentImageUrl }}" alt="{{ $usersdetals->name }}" class="student-profile-photo">
          <div class="student-profile-copy">
            <h5>{{ $usersdetals->name }}</h5>
            <p>{{ $studentProfile?->classname ?: 'Class group not available' }}</p>
            <div class="student-profile-chips">
              <span>{{ $studentProfile?->srnumber ?: 'SR not available' }}</span>
              <span>{{ $usersdetals->mobileno ?: 'Mobile not available' }}</span>
              <span>{{ $usersdetals->institutecode ?: 'Institute code not available' }}</span>
            </div>
          </div>
        </div>

        <div class="student-profile-actions">
          <a class="btn btn-info btn-sm" href="{{ route('admin.studentscontest', ['id' => $usersdetals->id]) }}">Applied Competitions</a>
          <a class="btn btn-success btn-sm" href="{{ route('admin.userpayments', ['id' => $usersdetals->id]) }}">Payment History</a>
          <a class="btn btn-dark btn-sm" href="{{ route('admin.changepassword', ['userid' => $usersdetals->id]) }}">Change Password</a>
        </div>
      </div>

      <div class="student-detail-card">
        <h5>Personal Details</h5>
        <div class="student-detail-grid">
          @foreach($personalDetails as $label => $value)
            <div class="student-detail-item">
              <span>{{ $label }}</span>
              <strong>{{ $value ?: '-' }}</strong>
            </div>
          @endforeach
        </div>
      </div>

      <div class="student-detail-card">
        <h5>Banking and Identity Details</h5>
        <div class="student-detail-grid">
          @foreach($bankingDetails as $label => $value)
            <div class="student-detail-item">
              <span>{{ $label }}</span>
              <strong>{{ $value ?: '-' }}</strong>
            </div>
          @endforeach
        </div>
      </div>
    </div>
  </div>

@endsection
