@extends('layouts.admin')

@section('content')

<style>

.form-card{
    background:rgba(255,255,255,.90);
    backdrop-filter:blur(8px);
    padding:30px;
    border-radius:20px;
    box-shadow:0 8px 25px rgba(0,0,0,.08);
    max-width:900px;
}

.form-card h2{
    margin-bottom:25px;
    color:#14532d;
    font-size:32px;
}

.form-group{
    margin-bottom:18px;
}

.form-group label{
    display:block;
    margin-bottom:8px;
    font-weight:600;
    color:#334155;
}

.form-control{
    width:100%;
    padding:14px;
    border:1px solid #dbe2ea;
    border-radius:12px;
    background:white;
    font-size:15px;
}

.form-control:focus{
    outline:none;
    border-color:#16a34a;
    box-shadow:0 0 0 4px rgba(22,163,74,.15);
}

.btn-save{
    background:#2563eb;
    color:white;
    border:none;
    padding:14px 28px;
    border-radius:12px;
    font-weight:700;
    cursor:pointer;
}

</style>

<div class="form-card">

<h2>Edit Akun</h2>

<form method="POST"
    action="/admin/users/{{ $user->id }}">

@csrf
@method('PUT')

<div class="form-group">
<label>Nama</label>
<input type="text"
    name="name"
    value="{{ $user->name }}"
    class="form-control">
</div>

<div class="form-group">
<label>Email</label>
<input type="email"
    name="email"
    value="{{ $user->email }}"
    class="form-control">
</div>

<div class="form-group">
<label>Role</label>

<select name="role"
        class="form-control">

<option value="employee"
{{ $user->role == 'employee' ? 'selected' : '' }}>
Employee
</option>

<option value="security"
{{ $user->role == 'security' ? 'selected' : '' }}>
Security
</option>

<option value="admin"
{{ $user->role == 'admin' ? 'selected' : '' }}>
Admin
</option>

</select>

</div>

<button type="submit"
        class="btn-save">
    Simpan Perubahan
</button>

</form>

</div>

@endsection