/* 3BRO Memoir Premium Glassmorphism Design System */
:root {
  --bg-primary: #0a0a0c; /* Obsidian Black */
  --bg-secondary: #151518; /* Dark Grey */
  --text-primary: #f5f5f7; /* Off-White */
  --text-secondary: #8e8e93; /* Muted Grey */
  --text-muted: #48484a; /* Dark Muted Gray */
  
  --accent-blue: #0071e3; /* Theme Accent Blue */
  --accent-glow: rgba(0, 113, 227, 0.35);
  
  /* Ultra-frosted Glass Tokens */
  --card-bg: rgba(20, 20, 25, 0.5);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-inner-shadow: inset 0 1.5px 1px rgba(255, 255, 255, 0.15);
  --glass-blur: blur(50px) saturate(230%);
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro SC", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --transition-smooth: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.25s ease;
}

/* Global resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* iOS 27 Premium Glassmorphism Cards */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), var(--card-inner-shadow);
  border-radius: 28px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), var(--card-inner-shadow);
}

/* Ambient Dynamic Background Grid & Blobs */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -10;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg-primary);
}

.bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.8;
}

.bg-spotlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 113, 227, 0.08) 0%, transparent 50%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.25;
  mix-blend-mode: screen;
}

.blob-1 {
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.35) 0%, rgba(127, 0, 255, 0.1) 70%, transparent 100%);
  top: -10%;
  left: -10%;
  animation: driftBlob1 28s infinite alternate ease-in-out;
}

.blob-2 {
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(255, 75, 130, 0.28) 0%, rgba(255, 123, 172, 0.05) 70%, transparent 100%);
  bottom: -15%;
  right: -10%;
  animation: driftBlob2 35s infinite alternate ease-in-out;
}

.blob-3 {
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.2) 0%, rgba(0, 113, 227, 0.02) 70%, transparent 100%);
  top: 40%;
  left: 50%;
  animation: driftBlob3 22s infinite alternate ease-in-out;
}

@keyframes driftBlob1 {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(8vw, 6vh) scale(1.15) rotate(180deg); }
  100% { transform: translate(-4vw, -4vh) scale(0.9) rotate(360deg); }
}

@keyframes driftBlob2 {
  0% { transform: translate(0, 0) scale(1.1); }
  50% { transform: translate(-10vw, -8vh) scale(0.9); }
  100% { transform: translate(6vw, 4vh) scale(1.05); }
}

@keyframes driftBlob3 {
  0% { transform: translate(0, 0) scale(0.95) rotate(0deg); }
  50% { transform: translate(4vw, -6vh) scale(1.1) rotate(-90deg); }
  100% { transform: translate(-6vw, 10vh) scale(0.85) rotate(-180deg); }
}

/* Global Navigation Bar */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 48px;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--card-border);
  z-index: 100;
  transition: var(--transition-smooth);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.nav-brand {
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.nav-brand span {
  color: var(--accent-blue);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.nav-item {
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-primary);
  opacity: 0.8;
  transition: var(--transition-fast);
}

.nav-item:hover {
  opacity: 1;
  color: var(--accent-blue);
}

.user-status-nav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-blue);
  opacity: 0.9;
  outline: none;
  transition: var(--transition-fast);
}

.user-status-nav-btn:hover {
  opacity: 1;
}

/* Theme Buttons */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  border-radius: 999px;
  border: 1px solid transparent;
}

.action-btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.75rem 2rem;
  font-weight: 600;
}

.action-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.action-btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--card-border);
  padding: 0.75rem 2rem;
}

.action-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.action-btn-link {
  background: transparent;
  color: var(--accent-blue);
  padding: 0.65rem 0;
  font-weight: 500;
}

.action-btn-link:hover {
  text-decoration: underline;
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding-top: 48px;
}

.hero-tagline {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 9vw, 6.8rem);
  font-weight: 100;
  letter-spacing: -3.5px;
  line-height: 1.05;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.hero-title span {
  color: var(--accent-blue);
}

.hero-desc {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 820px;
  margin: 0 auto 3.5rem;
}

.hero-ctas {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

/* Sections Base */
section {
  padding: 10rem 0;
  border-bottom: 1px solid var(--card-border);
}

.section-heading-center {
  text-align: center;
  margin-bottom: 6rem;
}

.section-tag {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-blue);
  letter-spacing: 3px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 100;
  letter-spacing: -2px;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.section-desc {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* Members Spec Panels layout */
.apple-product-panel {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 4.5rem;
  border-radius: 36px;
  margin-bottom: 3.5rem;
}

.apple-product-panel.reverse-layout {
  grid-template-columns: 1fr 1.1fr;
}

.panel-media {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 280px;
}

.glowing-avatar-ring {
  width: 220px;
  height: 220px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Abstract sleek vector elements */
.svg-apple-spec {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 15px rgba(0, 113, 227, 0.25));
  animation: floatRing 6s infinite ease-in-out;
}

@keyframes floatRing {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.panel-content {
  display: flex;
  flex-direction: column;
}

.content-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.panel-content h3 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 300;
  letter-spacing: -1px;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.panel-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.spec-footer-stats {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.spec-footer-stats .stat-number {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 100;
  letter-spacing: -2px;
  line-height: 1;
  color: var(--text-primary);
}

.spec-footer-stats .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

/* Photo Gallery Wall */
.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 5rem;
}

.upload-trigger-wrap {
  position: relative;
}

.upload-label {
  padding: 0.7rem 1.8rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.2rem;
}

.gallery-item {
  overflow: hidden;
  height: 360px;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 28px;
}

.gallery-item:hover {
  transform: scale(1.02);
}

.img-box {
  width: 100%;
  height: 270px;
  background-size: cover;
  background-position: center;
}

.gallery-info {
  padding: 1.25rem 1.75rem;
}

.gallery-info h4 {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.gallery-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.delete-photo-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition-smooth);
  z-index: 5;
}

.gallery-item:hover .delete-photo-btn {
  opacity: 1;
}

@media (max-width: 768px) {
  .delete-photo-btn {
    opacity: 0.85;
  }
}

.delete-photo-btn:hover {
  background-color: #ff3b30;
  border-color: transparent;
  transform: scale(1.1);
}

/* Guestbook Section */
.guestbook-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: flex-start;
}

.message-form-container {
  padding: 3rem;
  border-radius: 28px;
}

.message-form-container h3 {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 1.75rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input, .form-group textarea, .custom-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

.custom-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2386868b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

.form-group input:focus, .form-group textarea:focus, .custom-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.submit-btn {
  width: 100%;
  padding: 0.9rem;
  border-radius: 999px;
}

/* Guestbook comments list */
.comments-display {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.comment-card {
  padding: 1.75rem;
  border-radius: 20px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.comment-author {
  font-weight: 600;
  font-size: 1rem;
}

.comment-relation {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent-blue);
}

.comment-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  text-align: right;
  margin-top: 0.75rem;
}

/* User Login Modal Styling */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9998;
  transition: var(--transition-smooth);
}

.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-card {
  width: 90%;
  max-width: 500px;
  padding: 3rem;
  border-radius: 28px;
}

.login-card h2 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.login-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.role-selector {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.role-option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1.25rem;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-smooth);
  outline: none;
}

.role-option:hover {
  transform: scale(1.02);
  background-color: rgba(0, 113, 227, 0.05);
  border-color: var(--accent-blue);
}

.role-icon {
  font-size: 1.85rem;
  margin-right: 1.25rem;
  min-width: 32px;
  text-align: center;
}

.role-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: block;
}

.role-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

.login-password-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-password-form input {
  width: 100%;
  padding: 0.85rem 1.2rem;
  border-radius: 10px;
  background-color: var(--bg-primary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  outline: none;
  font-size: 0.95rem;
  text-align: center;
}

.login-password-form input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-actions {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

.login-actions button {
  flex: 1;
}

/* Upload Progress Overlay */
.upload-progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: var(--transition-smooth);
}

.upload-progress-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.progress-card {
  width: 90%;
  max-width: 400px;
  padding: 2.5rem;
  border-radius: 28px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.progress-card h3 {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.progress-track {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.progress-thumb {
  height: 100%;
  background-color: var(--accent-blue);
  border-radius: 3px;
  transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

#progress-percent {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* API Data Placeholders */
.loading-placeholder, .empty-placeholder, .error-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-secondary);
}

.error-placeholder {
  color: #ff3b30;
}

/* Premium Footer */
.main-footer {
  padding: 5rem 0;
  background-color: var(--bg-primary);
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--card-border);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-design-tag {
  text-align: left;
}

.footer-subtext {
  font-size: 0.7rem;
  opacity: 0.5;
  margin-top: 6px;
}

.footer-links {
  display: flex;
  gap: 0.8rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Animations Trigger */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Styles */
@media (max-width: 992px) {
  .apple-product-panel, .apple-product-panel.reverse-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 3rem 2rem;
  }
  
  .panel-media {
    order: -1;
  }
  
  .guestbook-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  
  .hero-title {
    font-size: 3.2rem;
    letter-spacing: -2.5px;
  }
  
  .mobile-hide {
    display: none;
  }
  
  .section-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  
  .footer-design-tag {
    text-align: center;
  }
}