/* ========================================== */
/* MEMBRIDGE GALLERY - Storyboard Theme        */
/* ========================================== */

:root {
  --bg: #0a0a0f;
  --surface: #14141f;
  --border: #2a2a3a;
  --text: #e0e0e0;
  --text-secondary: #8888aa;
  --marker-a: #FF1744;
  --marker-b: #FFD600;
  --marker-c: #00E676;
  --marker-a-glow: rgba(255, 23, 68, 0.3);
  --marker-b-glow: rgba(255, 214, 0, 0.3);
  --marker-c-glow: rgba(0, 230, 118, 0.3);
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  max-width: 100%;
  min-height: 100vh;
  padding-bottom: calc(var(--safe-bottom) + 80px);
}

/* Status Bar */
#status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

#status-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

#status-info {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Wing Selector */
#wing-selector {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--bg);
  position: sticky;
  top: 44px;
  z-index: 99;
  border-bottom: 1px solid var(--border);
}

#wing-selector::-webkit-scrollbar {
  display: none;
}

.wing-chip {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.wing-chip:active {
  transform: scale(0.95);
}

.wing-chip.active {
  background: var(--marker-a);
  border-color: var(--marker-a);
  color: white;
  box-shadow: 0 0 16px var(--marker-a-glow);
}

/* Search */
#search-bar {
  padding: 12px 16px;
}

#search-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#search-input:focus {
  border-color: var(--marker-b);
  box-shadow: 0 0 12px var(--marker-b-glow);
}

/* Storyboard */
#storyboard {
  padding: 16px;
}

/* Scene Card */
.scene-card {
  margin-bottom: 24px;
  border-left: 2px solid var(--border);
  padding-left: 16px;
  position: relative;
}

.scene-card::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--marker-a);
  box-shadow: 0 0 8px var(--marker-a-glow);
}

.scene-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.scene-badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--marker-a);
  color: white;
}

.scene-label {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.scene-count {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Frame Strip */
.scene-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.scene-strip::-webkit-scrollbar {
  display: none;
}

.frame-card {
  flex: 0 0 130px;
  scroll-snap-align: start;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  transition: transform 0.15s ease;
}

.frame-card:active {
  transform: scale(0.96);
}

.frame-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: var(--surface);
}

.marker-square {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  color: white;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.marker-a { background: var(--marker-a); }
.marker-b { background: var(--marker-b); color: #1a1a1a; }
.marker-c { background: var(--marker-c); }

.frame-label {
  padding: 6px 8px;
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center;
}

/* Animations */
@keyframes bridgePulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--marker-b-glow); }
  50% { box-shadow: 0 0 0 6px rgba(255, 214, 0, 0); }
}

.frame-card.has-marker-b {
  animation: bridgePulse 2.5s ease-in-out infinite;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.scene-card {
  animation: fadeIn 0.4s ease-out;
}

/* Empty State */
#empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

#empty-state h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

#empty-state p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 14px;
}

/* Buttons */
.btn-primary {
  padding: 14px 32px;
  border-radius: 25px;
  border: none;
  background: var(--marker-a);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--marker-a-glow);
  transition: all 0.2s;
}

.btn-primary:active {
  transform: scale(0.95);
  box-shadow: 0 2px 10px var(--marker-a-glow);
}

/* Loading */
#loading {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--marker-b);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Photo Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  object-fit: contain;
}

.modal-info {
  margin-top: 16px;
  text-align: center;
}

.modal-info .wing-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 10px;
  font-size: 11px;
  background: var(--surface);
  color: var(--text-secondary);
  margin: 4px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  z-index: 201;
}
