/* NagieFotki.pl - Image gallery with light/dark theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root, [data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-card: #161616;
  --bg-nav: #0f0f0f;
  --bg-input: #1e1e1e;
  --text: #e0e0e0;
  --text-muted: #888;
  --accent: #ff4d6a;
  --accent-hover: #ff6b82;
  --accent-dark: #c93050;
  --border: #252525;
  --shadow: rgba(0,0,0,0.4);
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --bg-card: #fff;
  --bg-nav: #fff;
  --bg-input: #f0f0f0;
  --text: #222;
  --text-muted: #666;
  --accent: #e0294a;
  --accent-hover: #c91e3d;
  --accent-dark: #a01530;
  --border: #ddd;
  --shadow: rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
header {
  background: linear-gradient(180deg, var(--bg-nav) 0%, #0a0a0a 100%);
  border-bottom: 2px solid var(--accent);
  padding: 16px 0;
  text-align: center;
  position: relative;
}

header .logo {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
}

header .tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.theme-toggle {
  position: absolute;
  top: 16px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: rgba(255,77,106,0.08);
}

[data-theme="light"] header {
  background: #fff;
  border-bottom-color: var(--accent);
  box-shadow: 0 2px 8px var(--shadow);
}

[data-theme="light"] nav { box-shadow: 0 2px 8px var(--shadow); }
[data-theme="light"] .image-card { box-shadow: 0 1px 4px var(--shadow); }
[data-theme="light"] .image-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
[data-theme="light"] .gv-backdrop { background: rgba(0,0,0,0.92); }
[data-theme="light"] main h1,
[data-theme="light"] .category-section h2 a,
[data-theme="light"] .seo-text h2,
[data-theme="light"] .seo-text h3 { color: #111; }
[data-theme="light"] header .tagline { color: #888; }
[data-theme="light"] .theme-toggle { background: #f0f0f0; }

/* Navigation */
nav {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-toggle {
  display: none;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.nav-toggle::after {
  content: '\25BC';
  float: right;
  font-size: 0.7rem;
  line-height: 1.6;
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-item {
  color: var(--text);
  text-decoration: none;
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Dropdown */
.nav-dropdown { position: relative; }

.nav-dropdown-btn {
  background: none;
  border: none;
  color: var(--text);
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-dropdown-btn .arrow {
  font-size: 0.6rem;
  transition: transform 0.2s;
}

.nav-dropdown-btn:hover,
.nav-dropdown-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  min-width: 200px;
  padding: 8px 0;
  z-index: 200;
}

[data-theme="light"] .nav-dropdown-menu { box-shadow: 0 12px 32px rgba(0,0,0,0.12); }

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: block; }

.nav-dropdown:hover .nav-dropdown-btn .arrow { transform: rotate(180deg); }

.nav-dropdown-menu a {
  display: block;
  color: var(--text);
  text-decoration: none;
  padding: 10px 20px;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.nav-dropdown-menu a:hover {
  background: rgba(255, 77, 106, 0.08);
  color: var(--accent);
  padding-left: 24px;
}

.nav-dropdown-menu a.active {
  color: var(--accent);
  font-weight: 600;
  border-left: 3px solid var(--accent);
  padding-left: 17px;
}

/* Main content */
main { padding: 24px 0 40px; }

main h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: #fff;
}

.intro {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
  max-width: 800px;
}

/* Image Grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.image-card {
  background: var(--bg-card);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
  position: relative;
}

.image-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px var(--shadow);
  border-color: var(--accent);
  z-index: 2;
}

.image-card a { display: block; }

.image-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
}

.image-card img[loading="lazy"] {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

/* Category sections on homepage */
.category-section { margin-bottom: 36px; }

.category-section h2 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.category-section h2 a {
  color: #fff;
  text-decoration: none;
}

.category-section h2 a:hover { color: var(--accent); }

.category-section .count {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: normal;
}

.view-all {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  padding: 8px 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.view-all:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Related categories */
.related-categories { margin: 40px 0 20px; }
.related-categories h2 { font-size: 1.2rem; margin-bottom: 12px; }

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-link {
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.related-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 77, 106, 0.08);
}

/* SEO Text */
.seo-text {
  margin-top: 40px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.seo-text h2, .seo-text h3 { margin-bottom: 8px; color: #fff; }
.seo-text h3 { font-size: 1.1rem; margin-top: 16px; }
.seo-text p { color: var(--text-muted); margin-bottom: 8px; }

/* Tags page */
.tag-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 20px 0 32px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  justify-content: center;
}

.tag-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.2s;
}

.tag-letter:hover {
  color: var(--accent);
  background: rgba(255, 77, 106, 0.12);
}

.tags-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.tag-group {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 20px 24px;
}

.tag-group-letter {
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  letter-spacing: 1px;
}

.tag-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0;
}

.tag-item {
  color: var(--text);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tag-item:hover {
  color: var(--accent);
  background: rgba(255, 77, 106, 0.06);
}

.tag-count {
  color: var(--text-muted);
  font-size: 0.75rem;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 28px;
  text-align: center;
}

@media (max-width: 768px) {
  .tag-list { grid-template-columns: repeat(2, 1fr); }
  .tag-group { padding: 14px 16px; }
  .tag-item { padding: 8px 10px; font-size: 0.85rem; }
  .tag-letter { width: 34px; height: 34px; font-size: 0.9rem; }
}

@media (max-width: 480px) {
  .tag-list { grid-template-columns: 1fr; }
}

/* Ads */
.ad-block { margin: 20px 0; text-align: center; }

/* Footer */
footer {
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  margin-top: 40px;
}

footer p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 8px;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
}

footer a:hover { color: var(--accent); }

/* Gallery Viewer */
.gallery-viewer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2000;
  display: none;
  flex-direction: column;
}

.gallery-viewer.active { display: flex; }

.gv-backdrop {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #000;
}

.gv-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0,0,0,0.8);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.gv-counter { color: #ccc; font-size: 0.9rem; font-weight: 500; }
.gv-counter .gv-current { color: #fff; font-weight: 700; }
.gv-actions { display: flex; gap: 4px; }

.gv-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: #ccc;
  width: 40px; height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.gv-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

.gv-close-btn { font-size: 1.5rem; }

.gv-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

.gv-image-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.gv-image {
  max-width: 94%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.25s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.gv-loading {
  position: absolute;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: none;
}

.gv-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 52px; height: 52px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  user-select: none;
}

.gv-nav:hover {
  background: rgba(255, 77, 106, 0.4);
  border-color: var(--accent);
}

.gv-prev { left: 16px; }
.gv-next { right: 16px; }

/* Thumbnail strip */
.gv-thumbstrip {
  position: relative;
  z-index: 2;
  background: rgba(0,0,0,0.85);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 8px 0;
}

.gv-thumbs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
  scroll-behavior: smooth;
}

.gv-thumbs::-webkit-scrollbar { height: 4px; }
.gv-thumbs::-webkit-scrollbar-track { background: transparent; }
.gv-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.gv-thumb {
  flex-shrink: 0;
  width: 64px; height: 48px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: all 0.2s;
}

.gv-thumb:hover { opacity: 0.8; border-color: rgba(255,255,255,0.3); }
.gv-thumb.active { opacity: 1; border-color: var(--accent); }
.gv-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Age gate */
.age-gate {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.97);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.age-gate-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
}

.age-gate-box h2 { color: #fff; margin-bottom: 16px; font-size: 1.5rem; }
.age-gate-box p { color: var(--text-muted); margin-bottom: 24px; font-size: 0.9rem; }

.age-gate-buttons { display: flex; gap: 12px; justify-content: center; }

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.btn:hover { background: var(--accent-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover { background: rgba(255, 77, 106, 0.1); }

.age-gate-buttons .btn { min-width: 120px; }

/* Responsive - Tablet */
@media (max-width: 900px) {
  .image-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .image-card img { height: 200px; }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  header .logo { font-size: 1.5rem; }
  header { padding: 12px 0; }
  .theme-toggle { top: 10px; right: 12px; width: 34px; height: 34px; }

  .nav-toggle { display: block; }

  .nav-bar {
    display: none;
    flex-direction: column;
    max-height: 70vh;
    overflow-y: auto;
  }

  .nav-bar.open { display: flex; }

  .nav-item { padding: 12px 16px; width: 100%; border-bottom: none; }

  .nav-dropdown { width: 100%; }
  .nav-dropdown-btn { width: 100%; padding: 12px 16px; justify-content: space-between; border-bottom: none; }
  .nav-dropdown-menu { position: static; border: none; border-radius: 0; box-shadow: none; background: rgba(255,77,106,0.03); display: none; padding: 0; }
  .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  .nav-dropdown.open:hover .nav-dropdown-menu { display: block; }
  .nav-dropdown-menu a { padding: 10px 16px 10px 32px; }

  .image-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .image-card img { height: 160px; }
  .image-card { border-radius: 4px; }

  main h1 { font-size: 1.3rem; }
  .intro { font-size: 0.85rem; }

  .gv-nav { width: 40px; height: 40px; font-size: 1.2rem; }
  .gv-prev { left: 4px; }
  .gv-next { right: 4px; }
  .gv-thumb { width: 48px; height: 36px; }
  .gv-toolbar { padding: 6px 10px; }
  .gv-btn { width: 36px; height: 36px; font-size: 1rem; }
  .gv-fullscreen-btn { display: none; }
}

@media (max-width: 400px) {
  .image-card img { height: 130px; }
  .container { padding: 0 10px; }
}
