/* Apple-inspired Minimalist & Premium Presentation Gallery Styling */
:root {
  --bg-primary: #000000;
  --bg-secondary: #0d0d11;
  --bg-sidebar: rgba(13, 13, 17, 0.7);
  --bg-surface: rgba(255, 255, 255, 0.03);
  --bg-surface-hover: rgba(255, 255, 255, 0.06);
  --bg-surface-active: rgba(255, 255, 255, 0.08);
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  
  --color-accent: #ffffff;
  --color-accent-dim: rgba(255, 255, 255, 0.6);
  --color-cyan: #64d2ff; /* Apple iOS Cyan */
  --color-danger: #ff453a; /* Apple iOS Red */
  
  --text-primary: #f5f5f7; /* Apple Off-white */
  --text-secondary: #86868b; /* Apple Gray */
  --text-muted: #6e6e73;
  
  --font-apple: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", "SF Pro Text", "Outfit", "Noto Sans Thai", sans-serif;
  --shadow-premium: 0 10px 40px rgba(0, 0, 0, 0.5);
  --blur-amount: 20px;
}

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

body.gallery-app {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-apple);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
}

.app-layout {
  display: flex;
  height: 100%;
  width: 100%;
}

/* Sidebar Styling - Frosted Acrylic Glass */
.sidebar {
  width: 300px;
  background-color: var(--bg-sidebar);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 35px 24px;
  flex-shrink: 0;
}

.sidebar-header {
  margin-bottom: 35px;
}

.sidebar-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.subtitle-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 5px;
  font-weight: 400;
}

.album-list-section {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
}

/* Custom Scrollbar for Sidebar */
.album-list-section::-webkit-scrollbar {
  width: 4px;
}
.album-list-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 15px;
}

.album-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.album-item {
  padding: 10px 14px;
  background-color: transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid transparent;
}

.album-item:hover {
  background-color: var(--bg-surface-hover);
}

.album-item.active {
  background-color: var(--bg-surface-active);
  border-color: rgba(255, 255, 255, 0.08);
}

.album-name {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.album-item.active .album-name {
  font-weight: 600;
}

.album-count-badge {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}

.album-item.active .album-count-badge {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg-primary);
}

.main-header {
  padding: 35px 50px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-info h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Photos Grid Section */
.photos-section {
  flex: 1;
  padding: 50px;
  overflow-y: auto;
}

/* Grid Layout */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
}

.photo-card {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.01);
  cursor: zoom-in;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-card:hover {
  transform: scale(1.02);
  border-color: var(--border-color-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-card:hover .photo-img {
  transform: scale(1.03);
}

/* Delete Photo Circle Button (Mac/Apple style) */
.photo-delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.photo-card:hover .photo-delete-btn {
  opacity: 1;
  transform: scale(1);
}

.photo-delete-btn:hover {
  background-color: var(--color-danger);
  border-color: transparent;
}

/* Premium Apple Capsule/Pill Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 980px; /* Apple Capsule shape */
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-apple);
}

.btn-primary {
  background-color: #ffffff;
  color: #000000;
}

.btn-primary:hover {
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

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

.btn-accent {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-accent:hover {
  background-color: rgba(255, 255, 255, 0.9);
  color: #000000;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(255, 69, 58, 0.3);
  color: var(--color-danger);
}

.btn-outline-danger:hover {
  background-color: rgba(255, 69, 58, 0.1);
  border-color: var(--color-danger);
}

/* Empty States */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.empty-state p {
  max-width: 420px;
  margin: 0 auto;
  color: var(--text-secondary);
}

/* Lightbox Fullscreen Viewer (Mac Quick Look Style) */
.lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.open {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 85%;
  max-height: 85%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  transform: scale(0.96);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.open .lightbox-content img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
  z-index: 1010;
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Translucent Pill Nav buttons */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1010;
}

.lightbox-nav:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.lightbox-prev { left: 40px; }
.lightbox-next { right: 40px; }
