/* ========== Fonts & Reset ========== */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary-gradient: linear-gradient(135deg, #ffaf7b 0%, #ff8c61 100%);
    --primary-color: #ff9f6f;
    --text-dark: #4a4a4a;
    --text-grey: #888;
    --bg-color: #f7f9fc;
    --card-shadow: 0 15px 40px rgba(0,0,0,0.05);
    --hover-shadow: 0 25px 60px rgba(255, 159, 111, 0.25);
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
}

/* ========== Layout ========== */
.page-wrapper {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
    min-height: 80vh;
}

.outstanding-container { width: 100%; max-width: 1200px; }

/* ========== Heading & Add Button ========== */
.outstanding-container h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.outstanding-container h2::after {
    content: '';
    width: 60px; height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
    margin-top: 10px;
}

.btn-add-staff {
    background: var(--primary-gradient);
    color: white; border: none; padding: 10px 25px; border-radius: 50px;
    font-size: 16px; cursor: pointer; box-shadow: 0 4px 10px rgba(255, 140, 97, 0.4);
    transition: 0.3s; display: inline-flex; align-items: center; gap: 8px;
    margin-top: 15px; text-decoration: none;
}
.btn-add-staff:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(255, 140, 97, 0.6); }

/* ========== Grid System ========== */
.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 40px;
    padding: 10px;
}

/* ========== Person Card ========== */
.person-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all 0.4s ease;
    border: 1px solid rgba(255,255,255,0.8);
    position: relative;
    overflow: hidden;
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer;
}

.person-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--hover-shadow);
    border-color: #fff0e6;
}

.person-card img {
    width: 100%; height: 420px;
    object-fit: cover; object-position: top center;
    border-radius: 12px; border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    transition: transform 0.5s ease;
}

.person-card:hover img { transform: scale(1.02); }

.person-card h3 {
    font-size: 22px; font-weight: 500; color: #333; margin-bottom: 5px;
}

/* ========== Badge & Delete Button ========== */
.badge {
    display: inline-block; background: #fff; color: var(--primary-color);
    padding: 8px 25px; border-radius: 50px; font-size: 14px; font-weight: 500;
    border: 1px solid var(--primary-color); margin-top: auto; margin-bottom: 10px;
    transition: 0.3s;
}

.person-card:hover .badge {
    background: var(--primary-gradient); color: white; border-color: transparent;
}

.btn-delete-staff {
    position: absolute; top: 15px; right: 15px;
    background-color: white; color: #dc3545; border: none;
    width: 35px; height: 35px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    z-index: 10; transition: all 0.2s; opacity: 0; transform: scale(0.8);
}

.person-card:hover .btn-delete-staff { opacity: 1; transform: scale(1); }
.btn-delete-staff:hover { background-color: #dc3545; color: white; }

/* ========== Modal Upload ========== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 10000; opacity: 0; visibility: hidden; transition: 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-box {
    background: white; width: 90%; max-width: 500px;
    border-radius: 20px; padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: scale(0.8); transition: 0.3s; position: relative;
}
.modal-overlay.active .modal-box { transform: scale(1); }

.modal-close {
    position: absolute; top: 15px; right: 15px; font-size: 24px;
    color: #aaa; cursor: pointer;
}
.modal-close:hover { color: #ff6b6b; }

.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: #555; }
.form-control {
    width: 100%; padding: 12px; border: 1px solid #ddd;
    border-radius: 10px; font-family: 'Kanit'; font-size: 16px;
}
.form-control:focus { border-color: #ff9f6f; outline: none; }

.img-preview-box {
    width: 100%; height: 200px; border: 2px dashed #ddd;
    border-radius: 12px; display: flex; justify-content: center; align-items: center;
    margin-bottom: 15px; overflow: hidden; position: relative;
    background: #fafafa; cursor: pointer;
}
.img-preview-box img { width: 100%; height: 100%; object-fit: cover; display: none; }
.img-preview-box i { font-size: 40px; color: #ccc; }

.btn-submit {
    width: 100%; padding: 12px; border: none; border-radius: 10px;
    background: var(--primary-color); color: white; font-size: 18px; cursor: pointer;
}
.btn-submit:hover { background: #ff8c61; }

/* ========== Lightbox ========== */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); display: flex; justify-content: center;
    align-items: center; z-index: 9999; opacity: 0; visibility: hidden;
    transition: 0.3s;
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox img { max-width: 90vh; max-height: 90vh; border-radius: 12px; transform: scale(0.9); transition: 0.3s; border: 5px solid #fff; }
.lightbox.active img { transform: scale(1); }
.lightbox-close {
    position: absolute; top: 30px; right: 40px; color: #fff; font-size: 40px; cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .page-wrapper { padding: 30px 15px; }
    .person-grid { grid-template-columns: 1fr; }
    .person-card img { height: 500px; }
    .btn-delete-staff { opacity: 1; transform: scale(1); top: 10px; right: 10px; } /* โชว์ปุ่มลบตลอดในมือถือ */
}