:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #666666;
  --accent: #2563eb;
  --primary: var(--accent);
  --card: #f7f7f9;
  --border: #e5e5ea;
}
.theme-dark:root, .theme-dark body, .theme-dark {
  --bg: #1e1f24;
  --text: #e6e6e6;
  --muted: #a7a7a7;
  --primary: var(--accent);
  --card: #2a2c32;
  --border: #3a3d46;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'Raleway', -apple-system, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif; font-weight: 300; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.site-header { border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 10; }
.theme-dark .site-header { background: rgba(30, 31, 36, 0.85); }
.site-header .container { display: flex; align-items: center; gap: 16px; padding: 12px 16px; }
.brand a { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); transition: color 0.2s; }
.brand a:hover { color: var(--accent); text-decoration: none; }
.site-logo { width: 36px; height: 36px; object-fit: cover; }
.site-name.has-logo { font-weight: 600; }

/* Hamburger menu button */
.hamburger { display: none; background: transparent; border: none; color: var(--text); font-size: 20px; padding: 8px; cursor: pointer; opacity: 0.7; transition: opacity 0.2s; }
.hamburger:hover { opacity: 1; background: transparent; }

/* Main navigation */
.main-nav ul { display: flex; gap: 12px; list-style: none; margin: 0; padding: 0; align-items: center; }
.main-nav li { display: flex; align-items: center; }
.main-nav a { padding: 6px 8px; border-radius: 3px; display: inline-flex; align-items: center; color: var(--text); transition: color 0.2s; }
.main-nav a:hover { color: var(--accent); text-decoration: none; }

/* Header icons wrapper */
.header-icons { display: flex; align-items: center; margin-left: auto; }

.theme-form { margin-left: 8px; }
.header-icon-link { background: transparent; border: none; color: var(--text); width: 36px; height: 36px; display: grid; place-items: center; text-decoration: none !important; opacity: 0.7; transition: color 0.2s, opacity 0.2s; font-size: 18px; position: relative; }
.header-icon-link:hover { opacity: 1; color: var(--accent); text-decoration: none !important; }
.cart-badge {
  position: absolute;
  top: 2px;
  right: 0;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.cart-icon { margin-right: 8px; }

/* Nav icons (hidden on desktop, shown in hamburger menu on mobile) */
.nav-mobile-icons { display: none; }
.nav-icon { display: none; }
.nav-icon-link { 
  display: flex; align-items: center; gap: 10px; padding: 12px 8px; 
  color: var(--text); text-decoration: none; background: transparent; border: none;
  width: 100%; cursor: pointer; font-size: inherit; font-family: inherit;
  transition: color 0.2s;
}
.nav-icon-link:hover { color: var(--accent); text-decoration: none; background: transparent; }
.nav-icon-link:focus { outline: none; background: transparent; }
.nav-icon-link i { width: 20px; text-align: center; opacity: 0.7; }
.nav-theme-form, .nav-logout-form { margin: 0; }
button.nav-icon-link { -webkit-appearance: none; appearance: none; }

/* Mobile responsive menu */
@media (max-width: 900px) {
  .hamburger { display: block; order: 10; margin-left: 8px; }
  .desktop-only { display: none !important; }
  .header-icons { order: 2; margin-left: auto; }
  
  .main-nav { 
    display: none; 
    position: absolute; 
    top: 100%; 
    left: 0; 
    right: 0; 
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    z-index: 100;
  }
  .theme-dark .main-nav {
    background: rgba(30, 31, 36, 0.95);
  }
  
  .main-nav.open { display: block; }
  
  .main-nav ul { 
    flex-direction: column; 
    gap: 0;
    align-items: stretch;
  }
  
  .main-nav li { 
    border-bottom: 1px solid var(--border);
  }
  .main-nav li:last-child { border-bottom: none; }
  
  .main-nav a { 
    padding: 12px 8px; 
    width: 100%;
    justify-content: flex-start;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .nav-icon { 
    display: inline-block; 
    width: 20px; 
    text-align: center; 
    opacity: 0.7; 
  }
  
  .nav-mobile-icons { 
    display: block; 
    border-top: 1px solid var(--border);
  }
  .nav-mobile-icons > a,
  .nav-mobile-icons > form { border-bottom: 1px solid var(--border); }
  .nav-mobile-icons > a:last-child,
  .nav-mobile-icons > form:last-child { border-bottom: none; }
  
  .site-header .container { flex-wrap: wrap; position: relative; }
}
.header-icon-link i { color: inherit; }
.theme-toggle { background: transparent; border: none; color: var(--text); padding: 6px; display: grid; place-items: center; cursor: pointer; opacity: 0.7; transition: color 0.2s, opacity 0.2s; }
.theme-toggle:hover { opacity: 1; background: transparent; color: var(--accent); }
.admin-login-icon { margin-left: 8px; background: transparent; border: none; color: var(--text); padding: 6px; display: grid; place-items: center; opacity: 0.7; transition: color 0.2s, opacity 0.2s; }
.admin-login-icon:hover { opacity: 1; background: transparent; color: var(--accent); }
.admin-logout-icon { margin-left: 8px; background: transparent; border: none; color: var(--text); padding: 6px; display: grid; place-items: center; cursor: pointer; opacity: 0.7; transition: color 0.2s, opacity 0.2s; }
.admin-logout-icon:hover { opacity: 1; background: transparent; color: var(--accent); }
.admin-logout-form { display: inline; }
.site-footer { margin-top: 40px; border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); }
.footer-container { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 768px) {
  .footer-container { flex-direction: row; justify-content: space-between; align-items: center; }
}
.footer-left { }
.copyright { font-weight: 500; color: var(--text); margin-bottom: 4px; }
.footer-tagline { font-size: 13px; line-height: 1.5; max-width: 500px; }
.footer-right { display: flex; gap: 16px; }
.social-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--card); color: var(--text); font-size: 18px; transition: background 0.2s, color 0.2s, transform 0.2s; }
.social-icon:hover { background: var(--primary); color: #fff; transform: translateY(-2px); text-decoration: none; }
.alert { padding: 10px 12px; border-radius: 3px; margin: 12px 0; }
.alert.error { background: #fee; color: #900; border: 1px solid #f99; }
.alert.success { background: #efe; color: #060; border: 1px solid #9f9; }
.alert.info { background: #eef; color: #003; border: 1px solid #99f; }
.muted { color: var(--muted); font-size: 14px; }
.form.card, .card { background: var(--card); padding: 16px; border-radius: 3px; }
label { display: block; margin-bottom: 15px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg); color: var(--text); margin-top: 5px;}
button, .button { display: inline-block; background: var(--accent); color: #fff; border: none; padding: 10px 14px; border-radius: 3px; cursor: pointer; text-decoration: none; font-weight: 500; }
button:hover, .button:hover { background: var(--accent); filter: brightness(0.85); }

/* AI Description Button */
.ai-description-btn-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ai-btn { background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); }
.ai-btn:hover { background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%); }
.ai-btn:disabled { opacity: 0.7; cursor: wait; }
.ai-status { font-size: 13px; color: var(--muted); }
.ai-status.success { color: #22c55e; }
.ai-status.error { color: #ef4444; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 12px 0; }
.checkbox-label input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; accent-color: var(--primary); }
.checkbox-label span { font-weight: 400; }
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.status-badge.active { background: #22c55e; color: #fff; }
.status-badge.inactive { background: #6b7280; color: #fff; }
.action-buttons { display: flex; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 6px; color: #fff; font-size: 14px; transition: background 0.2s, transform 0.15s; }
.icon-btn:hover { transform: translateY(-1px); text-decoration: none; }
.icon-btn.edit { background: #3b82f6; }
.icon-btn.edit:hover { background: var(--accent); }
.icon-btn.view { background: #22c55e; }
.icon-btn.view:hover { background: #16a34a; }
.icon-btn.approve { background: #22c55e; }
.icon-btn.approve:hover { background: #16a34a; }
.icon-btn.disapprove { background: #f59e0b; }
.icon-btn.disapprove:hover { background: #d97706; }
.icon-btn.delete { background: #dc2626; }
.icon-btn.delete:hover { background: #b91c1c; }
.mass-actions { display: flex; gap: 8px; }
.mass-actions .button { display: inline-flex; align-items: center; gap: 6px; }
.mass-actions .button:disabled { opacity: 0.5; cursor: not-allowed; }
.target-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; margin-right: 6px; }
.target-badge.album { background: #8b5cf6; color: #fff; }
.target-badge.photo { background: #0ea5e9; color: #fff; }
.comment-content { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.admin-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; }
.admin-table { background: var(--card); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.admin-table thead th { background: transparent; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.admin-table thead th.sortable { cursor: pointer; user-select: none; transition: color 0.15s; }
.admin-table thead th.sortable:hover { color: var(--text); }
.admin-table thead th.sortable::after { content: ''; display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: middle; opacity: 0.4; }
.admin-table thead th.sortable.asc::after { border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 5px solid currentColor; }
.admin-table thead th.sortable.desc::after { border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
.admin-table thead th.sortable.asc, .admin-table thead th.sortable.desc { color: var(--primary); }
.admin-table thead th.sortable.asc::after, .admin-table thead th.sortable.desc::after { opacity: 1; }
.table-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.table-filter { position: relative; flex: 1; max-width: 300px; }
.table-filter input { width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); font-size: 14px; }
.table-filter input:focus { outline: none; border-color: var(--primary); }
.table-filter .filter-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.admin-table tbody td { padding: 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background 0.15s; }
.admin-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.theme-light .admin-table tbody tr:hover { background: rgba(0,0,0,0.02); }
.admin-table .col-center { text-align: center; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

/* Home page album cards - minimal style, no background */
.album-grid .album-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s;
  position: relative;
  background: transparent;
}
.album-grid .album-card:hover {
  transform: translateY(-4px);
  text-decoration: none;
}
.album-grid .album-card .cover {
  aspect-ratio: 16/10;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.album-grid .album-card .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 100%); pointer-events: none; }
.album-grid .album-card .cover.placeholder { display: grid; place-items: center; color: var(--muted); border-radius: 12px; }
.album-grid .album-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s;
}
.album-grid .album-card:hover .cover img { transform: scale(1.05); }
.album-grid .album-card .info { padding: 10px 0 0; background: transparent; }
.album-grid .album-card h3 { margin: 0; font-size: 0.95em; font-weight: 400; line-height: 1.3; text-align: center; }

/* All Albums page - cards with background */
.albums-grid .album-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
}
.albums-grid .album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.2);
  text-decoration: none;
}
.albums-grid .album-card .cover {
  aspect-ratio: 16/10;
  background: var(--border);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  position: relative;
}
.albums-grid .album-card .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 100%); pointer-events: none; }
.albums-grid .album-card .cover.placeholder { display: grid; place-items: center; color: var(--muted); }
.albums-grid .album-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s;
}
.albums-grid .album-card:hover .cover img { transform: scale(1.05); }
.albums-grid .album-card .no-cover {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 32px;
}
.albums-grid .album-card .info { padding: 16px; }
.albums-grid .album-card h3 { margin: 0 0 8px; font-size: 1.1em; font-weight: 500; line-height: 1.3; text-align: center; }
.album-card .location,
.album-card .date,
.album-card .photo-count { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.album-card .location i,
.album-card .date i { width: 16px; opacity: 0.6; }
.album-card .photo-count { margin-top: 8px; font-size: 12px; }
.album-card .inactive-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

@media (max-width: 600px) {
  .albums-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .album-card .info { padding: 10px; }
  .album-card h3 { font-size: 0.9em; margin-bottom: 4px; }
  .album-card .location,
  .album-card .date { font-size: 11px; }
  .album-card .photo-count { font-size: 11px; margin-top: 4px; }
}
.albums-page { margin-top: 16px; }
.albums-page header { text-align: center; margin-bottom: 20px; }
.albums-page h1 { margin-bottom: 0; }
.album-count { color: var(--muted); font-size: 14px; text-align: center; margin: 16px 0 0; }

.album-filters {
  display: flex;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
  align-items: center;
}
.album-filters input[type="text"] {
  flex: 1;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}
.album-filters input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.album-filters select {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  width: 160px;
  flex-shrink: 0;
}
.album-filters select:focus {
  outline: none;
  border-color: var(--accent);
}
@media (max-width: 700px) {
  .album-filters { flex-wrap: wrap; }
  .album-filters input[type="text"] { width: 100%; flex: none; }
  .album-filters select { flex: 1; width: auto; min-width: 0; }
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 24px;
}
@media (max-width: 900px) {
  .albums-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .albums-grid { grid-template-columns: repeat(2, 1fr); }
}

.album-search-bar { margin: 32px 0; display: flex; justify-content: center; }
.search-wrapper { position: relative; max-width: 600px; width: 100%; }
.album-search-bar input { width: 100%; padding: 12px 16px; font-size: 16px; border-radius: 999px; }
.masonry {
  position: relative;
}
.masonry-item {
  position: absolute;
}
.masonry-item img {
  width: 100%;
  border-radius: 12px;
  display: block;
}
.photo-page { margin-top: 16px; }
.photo-view img { max-width: 100%; border-radius: 12px; }
.photo-title-caption { margin: 20px 0; }
.photo-title { font-size: 1.8em; font-weight: 400; margin: 0 0 8px; line-height: 1.3; }
.photo-caption { font-size: 1.1em; line-height: 1.6; color: var(--muted); margin: 0; }
.photo-album-nav {
  margin: 8px 0 16px;
}
.photo-album-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 14px;
  text-decoration: none;
}
.photo-album-nav a:hover {
  text-decoration: underline;
}
.photo-album-nav i {
  font-size: 0.85em;
}
.photo-meta dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 20px; }
.comments h2 { margin-bottom: 8px; }
.comment-list { display: flex; flex-direction: column; }
.comment { padding: 16px 0; }
.comment:last-child { }
.comment .author { font-weight: 600; margin-bottom: 8px; }
.comment .content { line-height: 1.5; }
.comment .meta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea { display: block; margin: 8px 0; }
.comment-form input[type="text"],
.comment-form input[type="email"] { max-width: 400px; width: 100%; }
.slideshow { position: relative; height: 416px; overflow: hidden; border-radius: 12px; background: var(--card); display: grid; margin-top: 16px; margin-bottom: 16px; }
.slideshow .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; display: flex; align-items: center; justify-content: center; }
.slideshow .slide img { width: calc(100% + 20px); height: 100%; object-fit: cover; object-position: center; margin-right: -20px; }
.slideshow .slide.active { opacity: 1; }
.slideshow .slide .caption { position: absolute; left: 50%; transform: translateX(-50%); bottom: 18px; padding: 0; background: transparent; color: #fff; font-weight: 100; text-align: center; font-size: 3em; text-shadow: 0 3px 5px rgba(0,0,0,0.9), 0 1px 2px rgba(0,0,0,0.9); }
.slideshow-controls { display: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.stats .card { display: grid; gap: 4px; place-items: center; }
.stats .value { font-size: 28px; font-weight: 700; }

.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.edit-icon { font-size: 0.6em; margin-left: 8px; text-decoration: none; opacity: 0.6; transition: opacity 0.2s; }
.edit-icon:hover { opacity: 1; text-decoration: none; }
/* Admin photo action buttons */
.photo-actions { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 4px; }
.photo-action-btn { 
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 4px; border: none; 
  cursor: pointer; transition: all 0.2s; color: #fff; font-size: 14px;
  background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
}
.photo-action-btn:hover { transform: scale(1.1); }
.photo-action-btn.cover:hover { background: #16a34a; }
.photo-action-btn.extract:hover { background: var(--accent); }
.photo-action-btn.delete:hover { background: #dc2626; }
.photo-action-btn.is-cover { background: #16a34a; cursor: default; }
.photo-action-btn.is-cover:hover { transform: none; }

/* Keywords */
.photo-meta .photo-keywords { margin-top: 24px !important; padding-top: 0px; }
.keyword-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-tag { 
  display: inline-block; 
  background: var(--card); 
  padding: 6px 12px; 
  border-radius: 999px; 
  font-size: 14px; 
  color: var(--text); 
  transition: background 0.2s; 
}
.keyword-tag:hover { 
  background: var(--primary); 
  color: #fff; 
  text-decoration: none; 
}
.keyword-page { margin-top: 16px; }
.keyword-page h1 { margin-bottom: 8px; }
.keyword-page .photo-count { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.photo-album-link { margin-top: 4px; font-size: 12px; color: var(--muted); }
.photo-album-link a { color: var(--muted); }
.photo-album-link a:hover { color: var(--primary); }

/* Keywords page */
.keywords-page { margin-top: 16px; }
.keyword-search-bar { margin-bottom: 20px; display: flex; justify-content: center; }
.keyword-search-bar .search-wrapper { max-width: 400px; width: 100%; }
.keyword-search-bar input { width: 100%; padding: 12px 16px; font-size: 16px; border-radius: 999px; }
.keyword-cloud { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.keyword-tag .count { opacity: 0.6; font-size: 0.85em; margin-left: 4px; }
.keyword-tag-1 { font-size: 14px; }
.keyword-tag-2 { font-size: 16px; }
.keyword-tag-3 { font-size: 18px; font-weight: 400; }
.keyword-tag-4 { font-size: 20px; font-weight: 500; }
.keyword-tag-5 { font-size: 22px; font-weight: 600; }

/* Search page */
.search-page { margin-top: 48px; }
.search-page header { text-align: center; }
.search-form { margin: 16px auto; max-width: 600px; }
.search-form input { width: 100%; padding: 12px 16px; font-size: 16px; border-radius: 999px; }
.search-summary { color: var(--muted); margin-bottom: 16px; text-align: center; }
.search-section { margin-top: 24px; }
.search-section h2 { margin-bottom: 12px; font-size: 1.2em; }
.search-hint { color: var(--muted); text-align: center; }
.no-results { color: var(--muted); text-align: center; padding: 40px 0; }
.photo-meta-mini { margin-top: 4px; font-size: 12px; color: var(--muted); }
.photo-meta-mini .album-link { color: var(--muted); }
.photo-meta-mini .album-link:hover { color: var(--primary); }
.photo-meta-mini .matched-keywords { display: block; font-style: italic; opacity: 0.8; }

/* About page */
.about-page { max-width: 1100px; margin: 0 auto; padding: 40px 16px; }
.about-hero { text-align: center; margin-bottom: 48px; }
.about-hero h1 { font-size: 2.5em; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.5px; }
.about-hero .lead { font-size: 1.3em; color: var(--muted); margin: 0; font-weight: 400; }
.about-content { margin-bottom: 40px; }
.about-text p { font-size: 1.1em; line-height: 1.8; margin: 0 0 16px; }
.about-text strong { font-weight: 500; }
.about-section { margin-bottom: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.about-section h2 { font-size: 1.4em; font-weight: 600; margin: 0 0 16px; }
.about-section p { line-height: 1.7; margin: 0 0 12px; }
.contact-info { background: var(--card); padding: 20px 24px; border-radius: 8px; margin-bottom: 16px; }
.contact-info p { margin: 0 0 8px; }
.contact-info p:last-child { margin-bottom: 0; }
.contact-info a { color: var(--primary); }
.about-footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); text-align: center; }
.copyright-notice { font-size: 0.9em; color: var(--muted); line-height: 1.6; }

/* Photo page */
.photo-page {
  margin-top: 16px;
}
.photo-view {
  display: flex;
  justify-content: center;
}
.photo-view img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  height: auto;
  width: auto;
  border-radius: 3px;
  object-fit: contain;
}

/* Photo page metadata sections */
.photo-meta { margin-top: 24px; }
.photo-meta h2 { font-size: 1.3em; font-weight: 400; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.photo-meta h2 i { font-size: 0.85em; color: var(--primary); opacity: 0.8; }
.photo-meta section { margin-top: 24px; padding-top: 0; }
.photo-meta section:first-of-type { margin-top: 0; }

.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.meta-group { background: var(--card); border-radius: 12px; padding: 20px; }
.meta-group h3 { font-size: 0.85em; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.meta-group h3 i { font-size: 1.1em; color: var(--primary); }
.meta-group dl { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px 12px; margin: 0; }
.meta-group dt { font-size: 0.9em; color: var(--muted); }
.meta-group dd { font-size: 0.9em; margin: 0; word-break: break-word; }
.meta-group dd a { color: var(--primary); }

.meta-list { display: grid; grid-template-columns: minmax(150px, auto) 1fr; gap: 8px 16px; margin: 0; }
.meta-list dt { font-size: 0.85em; color: var(--muted); padding: 4px 0; }
.meta-list dd { font-size: 0.85em; margin: 0; padding: 4px 0; word-break: break-word; }
.meta-list.compact { font-size: 0.8em; gap: 4px 12px; max-height: 400px; overflow-y: auto; }
.meta-list.compact dt, .meta-list.compact dd { padding: 2px 0; }

/* Collapsible metadata sections */
.metadata-details { margin-top: 16px; }
.metadata-details summary { 
  cursor: pointer; 
  font-weight: 500; 
  padding: 12px 16px; 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}
.metadata-details summary:hover { background: var(--border); }
.metadata-details summary i { color: var(--primary); }
.metadata-details[open] summary { border-radius: 8px 8px 0 0; border-bottom: none; }
.metadata-details .meta-list { 
  padding: 16px; 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-top: none;
  border-radius: 0 0 8px 8px;
}

/* Photo description section */
.photo-description { background: var(--card); border-radius: 12px; padding: 20px; border: 1px solid var(--border); }
.photo-description h2 { margin-bottom: 12px !important; }
.photo-description p { margin: 0; line-height: 1.7; }

/* IPTC/XMP sections */
.photo-iptc, .photo-xmp { background: transparent; }
.photo-iptc h2, .photo-xmp h2 { font-size: 1.1em; }

/* Buy Print Button */
.buy-print-section { text-align: center; margin: 24px 0 40px 0; }
.buy-print-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.buy-print-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.buy-print-btn i { font-size: 18px; }

/* Print Modal */
.print-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.print-modal-content {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.print-modal-content h2 {
  margin: 0 0 12px 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.print-modal-content h2 i { opacity: 0.6; font-size: 16px; }
.print-preview { margin-bottom: 16px; }
.print-preview img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: 6px;
}
.size-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px; }
.size-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}
.size-option:hover { border-color: var(--accent); }
.size-option.selected { border-color: var(--accent); background: rgba(var(--accent-rgb, 37, 99, 235), 0.1); }
.size-option input { display: none; }
.size-name { font-weight: 600; font-size: 14px; }
.size-dimensions { color: var(--muted); font-size: 11px; }
.size-price { font-weight: 600; color: var(--accent); font-size: 13px; }
.print-modal-actions { text-align: center; }
.print-modal-actions .button { padding: 12px 28px; font-size: 14px; }

/* Settings Page */
.settings-form { max-width: 800px; }
.settings-section { background: var(--card); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.settings-section h2 { font-size: 1.1em; font-weight: 600; margin: 0 0 20px 0; padding-bottom: 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.settings-section h2 i { opacity: 0.6; font-size: 0.95em; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.settings-grid label, .settings-section label.full-width { display: block; margin-bottom: 0; }
.settings-section label.full-width { grid-column: 1 / -1; margin-top: 8px; }
.settings-form .label-text { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.settings-form .label-text i { margin-right: 6px; opacity: 0.6; }
.settings-form .hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.settings-form .hint a { color: var(--primary); }
.settings-form input[type="text"],
.settings-form input[type="url"],
.settings-form input[type="email"],
.settings-form input[type="password"],
.settings-form input[type="number"],
.settings-form textarea,
.settings-form select { 
  width: 100%; 
  box-sizing: border-box; 
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
}
.checkbox-group { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.checkbox-group .checkbox-label { margin: 0; }
.color-input-wrap { display: flex; gap: 8px; align-items: center; }
.color-input { width: 50px; height: 38px; padding: 2px; cursor: pointer; border-radius: 4px; }
.color-text { flex: 1; font-family: monospace; }
.settings-actions { margin-top: 24px; }
.settings-actions .button { font-size: 15px; padding: 12px 24px; }
.alert-success { background: rgba(34, 197, 94, 0.1); color: #16a34a; padding: 12px 16px; border-radius: 8px; margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }
[data-theme="dark"] .alert-success { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
@media (max-width: 600px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Modern Toast Notification System
   ============================================ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100vw - 48px);
}

.toast {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 16px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 10px 40px -10px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  overflow: hidden;
  opacity: 0;
  transform: translateX(100%) scale(0.9);
  transition: none;
}

.theme-dark .toast {
  background: rgba(40, 42, 50, 0.9);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 10px 40px -10px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.toast-enter {
  animation: toastSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast-exit {
  animation: toastSlideOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
}

.toast-content {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
}

.toast-icon-wrapper {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes iconPop {
  0% {
    transform: scale(0) rotate(-45deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.toast-icon {
  width: 24px;
  height: 24px;
}

.toast-success .toast-icon-wrapper {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
}

.toast-error .toast-icon-wrapper {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.toast-info .toast-icon-wrapper {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.toast-warning .toast-icon-wrapper {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.toast-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.toast-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 2px;
  animation: textFadeIn 0.4s ease-out 0.3s both;
}

.toast-message {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
  word-break: break-word;
  animation: textFadeIn 0.4s ease-out 0.4s both;
}

@keyframes textFadeIn {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin: -4px -6px 0 0;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
  transform: scale(1.1);
}

.theme-dark .toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.toast-progress {
  height: 3px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.theme-dark .toast-progress {
  background: rgba(255, 255, 255, 0.1);
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
}

.toast-success .toast-progress-bar {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.toast-error .toast-progress-bar {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.toast-info .toast-progress-bar {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.toast-warning .toast-progress-bar {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Stacking effect for multiple toasts */
.toast-container .toast:nth-child(n+2) {
  transform-origin: top center;
}

/* Hover lift effect */
.toast:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 12px -2px rgba(0, 0, 0, 0.15),
    0 16px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.theme-dark .toast:hover {
  box-shadow: 
    0 8px 12px -2px rgba(0, 0, 0, 0.4),
    0 16px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
  
  .toast {
    border-radius: 12px;
  }
  
  .toast-content {
    padding: 14px 16px;
    gap: 12px;
  }
  
  .toast-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  
  .toast-icon {
    width: 20px;
    height: 20px;
  }
  
  .toast-title {
    font-size: 14px;
  }
  
  .toast-message {
    font-size: 13px;
  }
}

