:root {
  --bg: #0d0d0d;
  --card: #141414;
  --border: #262626;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --accent: #0095f6;
  --danger: #ed4956;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  padding-bottom: 50px;
}

.toolbar {
  display: none;
  background: #fff3cd;
  color: #333;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  font-size: 0.85rem;
  align-items: center;
  justify-content: space-between;
}
.toolbar button {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

/* Centered Hero Block styling */
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 16px;
  gap: 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  max-width: 1400px;
  margin: 0 auto 16px auto;
  transition: background-color 0.3s ease;
}

.avatar-box { 
  width: 90px; 
  height: 90px; 
  flex-shrink: 0; 
  position: relative; 
}
@media(min-width:768px){ 
  .avatar-box { width: 110px; height: 110px; } 
}
.avatar-box img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.is-edit .avatar-box { cursor: pointer; }
.is-edit .avatar-box:hover #avatar-overlay { display: flex !important; }

/* Custom Logo Display for Option 3 (Responsive & Fluid) */
.logo-hero-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  cursor: default;
  padding: 10px;
}
.is-edit .logo-hero-container {
  cursor: pointer;
}
.is-edit .logo-hero-container:hover #logo-overlay {
  display: flex !important;
}
.custom-logo-display {
  width: 100%;
  height: auto;
  max-height: 90px; /* Sukat para sa Desktop */
  object-fit: contain;
  display: block;
}
@media(max-width: 768px) {
  .logo-hero-container {
    max-width: 85%;
  }
  .custom-logo-display {
    max-height: 60px; /* Angkop na taas para sa mobile screens */
  }
}

.profile-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
}

#p_name {
  font-weight: bold;
  margin-bottom: 4px;
}
#p_title {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 12px;
}
#p_bio {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: pre-line;
  line-height: 1.4;
}

.stats-row { 
  display: flex; 
  gap: 24px; 
  margin: 10px 0 14px 0; 
  font-size: 0.9rem; 
}
.stats-row b { display: block; text-align: center; }
.stats-row span { color: var(--muted); font-size: 0.8rem; }

.upload-box {
  display: none;
  background: var(--card);
  border: 2px dashed var(--accent);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto 20px auto;
}
.is-edit .upload-box { display: block; }
.upload-box input, .upload-box textarea, .upload-box select {
  width: 100%; padding: 8px; margin: 6px 0;
  border: 1px solid var(--border); border-radius: 6px;
  background: #222; color: #fff;
}

/* Grid Layout: 3 columns for mobile, 8 columns for desktop */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 10px;
}
@media(min-width: 768px){
  .gallery-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

.item-card {
  position: relative;
  cursor: pointer;
  background: #000;
  display: block;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
.item-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.item-card:hover img { transform: scale(1.02); opacity: 0.85; }

.video-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-badge svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
  filter: drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.8));
}

.del-btn {
  display: none;
  position: absolute;
  top: 6px; right: 6px;
  background: var(--danger);
  color: #fff; border: 0;
  width: 26px; height: 26px;
  border-radius: 50%; font-weight: bold;
  cursor: pointer; z-index: 10;
}
.is-edit .del-btn { display: flex; align-items: center; justify-content: center; }
.is-edit .editable-txt { outline: 1px dashed var(--accent); }

/* Lightbox Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.97);
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
.modal.open { display: flex; }

.modal-top {
  width: 100%;
  min-height: 54px;
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(20,20,20,0.8);
  flex-shrink: 0;
}

.modal-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.img-track {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  transform: translateY(0px);
}

.modal-caption-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  color: #fff;
  padding: 16px 20px;
  font-size: 0.95rem;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 20;
}

@media(min-width: 768px) {
  .modal-center:hover .modal-caption-overlay { transform: translateY(0); }
  .nav-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.5); color: #fff; border: 0;
    font-size: 2rem; width: 44px; height: 44px; border-radius: 50%;
    cursor: pointer; z-index: 10;
  }
  .nav-arrow.left { left: 16px; }
  .nav-arrow.right { right: 16px; }
}

@media(max-width: 767px) {
  .nav-arrow { display: none !important; }
}
.modal-center.show-caption .modal-caption-overlay { transform: translateY(0); }