/* ============================================================
   Soganday Youth Volunteers — Blood Donation System
   Full style.css (with photo upload styles)
============================================================ */

* { margin:0; padding:0; box-sizing:border-box; font-family:'Segoe UI',Arial,sans-serif; }
body { background:#f4f6f8; color:#222; }

/* HEADER */
header {
  background:linear-gradient(135deg,#c0392b,#e74c3c);
  color:#fff; padding:22px 16px; text-align:center;
  box-shadow:0 3px 10px rgba(0,0,0,.15);
}
.header-content {
  display:flex; align-items:center; justify-content:center; gap:16px; flex-wrap:wrap;
}
.logo {
  width:70px; height:70px; border-radius:50%; object-fit:cover;
  background:#fff; padding:4px; box-shadow:0 2px 8px rgba(0,0,0,.2);
}
.header-text { text-align:left; }
.header-text h1 { font-size:26px; letter-spacing:.5px; }
.header-text p { margin-top:6px; font-size:14px; opacity:.9; }

/* stack logo on top for small screens */
@media (max-width:480px){
  .header-text { text-align:center; }
}
/* TOOLBAR */
.toolbar {
  max-width:1100px; margin:20px auto; padding:0 16px;
  display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:center;
}
.toolbar input, .toolbar select {
  padding:11px 14px; border:1px solid #ccc; border-radius:8px; font-size:14px; outline:none;
}
.toolbar input#search { flex:1; min-width:220px; }
.btn-add {
  background:#27ae60; color:#fff; border:none; padding:11px 18px;
  border-radius:8px; font-size:14px; cursor:pointer; font-weight:600; transition:.2s;
}
.btn-add:hover { background:#219150; }

/* GRID */
.grid {
  max-width:1100px; margin:0 auto 40px; padding:0 16px;
  display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:18px;
}
.card {
  background:#fff; border-radius:14px; padding:18px; box-shadow:0 2px 12px rgba(0,0,0,.08);
  transition:.2s; position:relative;
}
.card:hover { transform:translateY(-4px); box-shadow:0 6px 18px rgba(0,0,0,.12); }
.card-top { display:flex; gap:14px; align-items:center; }
.card-top img {
  width:70px; height:70px; border-radius:50%; object-fit:cover; border:3px solid #e74c3c;
}
.card-top h3 { font-size:18px; }
.blood-tag {
  display:inline-block; background:#e74c3c; color:#fff; padding:2px 10px;
  border-radius:20px; font-size:13px; font-weight:700; margin-top:4px;
}
.info { margin:12px 0; font-size:14px; line-height:1.7; color:#444; }
.info b { color:#222; }
.status {
  display:inline-block; padding:4px 12px; border-radius:20px; font-size:12px; font-weight:700; margin-top:6px;
}
.available { background:#d4edda; color:#1e7e34; }
.wait { background:#ffe5cc; color:#c0651b; }

.actions { display:flex; gap:8px; margin-top:14px; flex-wrap:wrap; }
.actions button, .actions a {
  flex:1; text-align:center; text-decoration:none; padding:8px; border:none;
  border-radius:7px; font-size:13px; cursor:pointer; font-weight:600; color:#fff; transition:.2s;
}
.wa { background:#25d366; } .wa:hover{ background:#1eb655; }
.edit { background:#3498db; } .edit:hover{ background:#2c82c9; }
.del { background:#e74c3c; } .del:hover{ background:#c0392b; }

.empty { text-align:center; color:#888; grid-column:1/-1; padding:40px; font-size:16px; }

/* MODAL */
.modal {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,.5);
  justify-content:center; align-items:flex-start; padding:30px 15px; overflow:auto; z-index:50;
}
.modal.open { display:flex; }
.modal-box {
  background:#fff; border-radius:14px; padding:24px; width:100%; max-width:460px;
  box-shadow:0 10px 40px rgba(0,0,0,.3);
}
.modal-box h2 { margin-bottom:16px; color:#c0392b; }
.modal-box label { display:block; font-size:13px; margin:10px 0 4px; font-weight:600; }
.modal-box input, .modal-box select, .modal-box textarea {
  width:100%; padding:10px; border:1px solid #ccc; border-radius:8px; font-size:14px; outline:none;
}
.modal-actions { display:flex; gap:10px; margin-top:18px; }
.modal-actions button { flex:1; padding:11px; border:none; border-radius:8px; font-size:14px; cursor:pointer; font-weight:600; }
.save { background:#27ae60; color:#fff; }
.cancel { background:#ddd; }

/* PHOTO UPLOAD */
.photo-upload {
  display:flex; align-items:center; gap:14px; margin-bottom:6px;
}
.photo-preview {
  width:70px; height:70px; border-radius:50%; object-fit:cover;
  border:3px solid #e74c3c;
}
.photo-preview.hidden { display:none; }
.photo-upload input[type="file"] {
  flex:1; font-size:13px; padding:8px; border:1px dashed #bbb; border-radius:8px; cursor:pointer;
}

footer { text-align:center; padding:18px; color:#777; font-size:13px; }


/* ADMIN BAR */
.admin-bar {
  max-width:1100px; margin:14px auto 0; padding:0 16px;
  display:flex; align-items:center; justify-content:flex-end; gap:12px;
}
.admin-bar #adminStatus { margin-right:auto; font-size:14px; color:#555; font-weight:600; }
.admin-btn {
  background:#34495e; color:#fff; border:none; padding:9px 16px;
  border-radius:8px; font-size:13px; cursor:pointer; font-weight:600; transition:.2s;
}
.admin-btn:hover { background:#2c3e50; }
.admin-btn.logout { background:#c0392b; }
.admin-btn.logout:hover { background:#a93226; }
.login-error { color:#c0392b; font-size:13px; margin-top:10px; font-weight:600; }
.hidden { display:none; }

/* hide edit controls for guests */
body:not(.is-admin) .btn-add,
body:not(.is-admin) .edit,
body:not(.is-admin) .del { display:none; }