/* ============================================================
   SAGRES SURF SCHOOL — Photo System — style.css
   ============================================================ */

:root {
  --blue:    #0077b6;
  --dark:    #023e6e;
  --light:   #e8f4fd;
  --accent:  #00b4d8;
  --white:   #ffffff;
  --gray:    #6c757d;
  --danger:  #dc3545;
  --success: #198754;
  --radius:  10px;
  --shadow:  0 2px 12px rgba(0,0,0,0.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f7ff;
  color: #1a1a2e;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header ---- */
.site-header {
  background: var(--dark);
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.site-header img { height: 42px; }
.site-header h1  { font-size: 1.1rem; font-weight: 600; }

/* ---- Container ---- */
.container { max-width: 960px; margin: 0 auto; padding: 20px 16px; }

/* ---- Card ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn:hover  { opacity: .88; text-decoration: none; }

.btn-primary  { background: var(--blue);    color: white; }
.btn-dark     { background: var(--dark);    color: white; }
.btn-success  { background: var(--success); color: white; }
.btn-danger   { background: var(--danger);  color: white; }
.btn-gray     { background: #e0e0e0;        color: #333;  }
.btn-wa       { background: #25d366;        color: white; }
.btn-sm       { padding: 7px 13px; font-size: 0.82rem; }
.btn-block    { width: 100%; justify-content: center; }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .9rem;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ccc;
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color .2s;
}
.form-control:focus { outline: none; border-color: var(--blue); }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: var(--light); color: var(--dark); padding: 10px 12px; text-align: left; }
td { padding: 10px 12px; border-top: 1px solid #e8ecf0; vertical-align: middle; }
tr:hover td { background: #f9fcff; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
}
.badge-active   { background: #d1f0e0; color: #145a32; }
.badge-inactive { background: #fde8e8; color: #7b1a1a; }

/* ---- Gallery Grid ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.photo-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.photo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.photo-card-body { padding: 8px; }
.photo-card-body .btn { width: 100%; justify-content: center; font-size: .78rem; padding: 7px; }

/* ---- Public gallery hero ---- */
.gallery-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--blue) 100%);
  color: white;
  padding: 28px 20px 22px;
  text-align: center;
}
.gallery-hero h2 { font-size: 1.4rem; }
.gallery-hero p  { opacity: .85; margin-top: 4px; font-size: .95rem; }
.gallery-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 18px;
}

/* ---- Alert ---- */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: .93rem;
}
.alert-danger  { background: #fde8e8; color: #7b1a1a; border-left: 4px solid var(--danger); }
.alert-success { background: #d1f0e0; color: #145a32; border-left: 4px solid var(--success); }
.alert-info    { background: var(--light); color: var(--dark); border-left: 4px solid var(--accent); }

/* ---- Upload zone ---- */
.upload-zone {
  border: 2.5px dashed #b0c4de;
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: background .2s;
}
.upload-zone:hover, .upload-zone.dragover { background: var(--light); border-color: var(--blue); }
.upload-zone p { color: var(--gray); margin-top: 8px; font-size: .9rem; }

/* ---- Copy link input ---- */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; }

/* ---- Unavailable ---- */
.unavailable {
  text-align: center;
  padding: 60px 20px;
}
.unavailable .icon { font-size: 3rem; }
.unavailable h2 { margin: 16px 0 8px; color: var(--dark); }
.unavailable p  { color: var(--gray); }

/* ---- Admin nav ---- */
.admin-nav {
  background: var(--dark);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.admin-nav a {
  color: rgba(255,255,255,.75);
  padding: 12px 14px;
  font-size: .88rem;
  display: block;
  transition: color .15s;
}
.admin-nav a:hover, .admin-nav a.active { color: white; text-decoration: none; }
.admin-nav .spacer { flex: 1; }

/* ---- Login ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--dark), var(--blue));
}
.login-box {
  background: white;
  border-radius: 14px;
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}
.login-box h2 { text-align: center; color: var(--dark); margin-bottom: 24px; }

/* ---- Lightbox modal ---- */
.photo-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0,0,0,0.88);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.photo-modal.is-open {
  display: flex;
}
.photo-modal-img {
  max-width: 95%;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  display: block;
}
.photo-modal-close {
  position: fixed;
  top: 18px;
  right: 28px;
  color: #fff;
  font-size: 42px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  z-index: 10000;
  user-select: none;
}
.photo-modal-close:hover { color: #ccc; }

/* ---- Zoom cursor on gallery photos ---- */
.gallery-photo { cursor: zoom-in; }

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .card { padding: 16px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .gallery-hero h2 { font-size: 1.2rem; }
  table { font-size: .8rem; }
  td, th { padding: 8px 7px; }
}