/* =============================================================
   Gallery Manager — Unified Design System
   Matches frankfarukceviz.uk (D-Summary)
   ============================================================= */

:root {
  --bg-color: #fcfcfc;
  --text-primary: #111111;
  --text-secondary: #555555;
  --text-tertiary: #888888;
  --accent-color: #000000;
  --border-color: #e2e2e2;
  --font-family: 'Inter', sans-serif;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 32px;
  --spacing-xl: 64px;

  --nav-height: 80px;
  --max-w: 1400px;
  --ease: 0.2s ease;
  
  /* App Specific */
  --card-bg: #ffffff;
  --gallery-gap: 24px;
}

/* ----- Reset & Base ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- Layout ----- */
.page-container {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--nav-height) + var(--spacing-xl)) 24px var(--spacing-xl);
}

/* ----- Navbar ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--ease);
}

.navbar__logo-img {
  height: 36px;
  width: auto;
  display: block;
  filter: invert(1);
}

.navbar__menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  list-style: none;
}

.navbar__link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color var(--ease);
  position: relative;
  padding-bottom: 4px;
}

.navbar__link:hover, .navbar__link.active {
  color: var(--text-primary);
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-primary);
  transition: width var(--ease);
}

.navbar__link:hover::after, .navbar__link.active::after {
  width: 100%;
}

.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.navbar__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

@media (max-width: 768px) {
  .navbar { padding: 0 20px; }
  .navbar__hamburger { display: flex; }
  .navbar__menu {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    border-bottom: 1px solid var(--border-color);
  }
  .navbar__menu.is-open { max-height: 400px; padding: 16px 0; }
  .navbar__link { display: block; padding: 12px 24px; text-align: center; }
  .navbar__link::after { display: none; }
}

/* ----- App Header ----- */
.app-header {
  margin-bottom: var(--spacing-xl);
  text-align: left;
  border-bottom: 1px solid var(--text-primary);
  padding-bottom: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

@media (min-width: 992px) {
  .app-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.app-header__info {
  flex: 1;
}

.app-header__title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--spacing-sm);
}

.app-header__sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ----- Toolbar ----- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: #fff;
}

.button:hover {
  background: var(--text-primary);
  color: #fff;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #fff;
  min-width: 120px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.1);
  z-index: 10;
  border: 1px solid var(--border-color);
  margin-top: 4px;
}

.dropdown-content.show {
  display: block;
}

.dropdown-content a {
  color: var(--text-secondary);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background var(--ease), color var(--ease);
}

.dropdown-content a:hover {
  background-color: #f9f9f9;
  color: var(--text-primary);
}

/* ----- Gallery Grid ----- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gallery-gap);
  margin-top: var(--spacing-xl);
}

.gallery-item {
  position: relative;
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1;
  transition: border-color var(--ease), transform var(--ease);
  cursor: pointer;
}

.gallery-item:hover {
  border-color: var(--text-primary);
  transform: translateY(-4px);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
}

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

/* Empty State */
.gallery:empty::after {
  content: 'Load images or drop files & folders here';
  grid-column: 1 / -1;
  text-align: center;
  padding: 100px 20px;
  color: var(--text-tertiary);
  border: 2px dashed var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
}

/* ----- Modal ----- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.95);
  z-index: 2000;
  padding: 40px;
  cursor: zoom-out;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

/* ----- Overlays ----- */
.drop-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
}

.drop-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
}

.drop-message {
  border: 2px dashed var(--text-primary);
  padding: 40px 80px;
  color: var(--text-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: #fff;
}

/* Progress */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s;
}

.progress-container.active {
  opacity: 1;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--text-primary);
  transition: width 0.3s ease-out;
}

/* ----- Footer Match ----- */
.footer {
  padding: var(--spacing-xl) 24px;
  background: var(--bg-color);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-xl);
}

@media (min-width: 768px) {
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

.footer__logo { height: 44px; filter: invert(1); margin-bottom: var(--spacing-sm); }
.footer__name { display: block; font-size: 1rem; font-weight: 700; margin-bottom: var(--spacing-md); color: var(--text-primary); }
.footer__nav { display: flex; flex-direction: column; gap: 12px; margin-bottom: var(--spacing-lg); }
.footer__navlink { color: var(--text-secondary); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; text-decoration: none; transition: color var(--ease); }
.footer__navlink:hover { color: var(--text-primary); }
.footer__copy { font-size: 0.8rem; color: var(--text-tertiary); }

.footer__newsletter p { font-size: 0.9rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md); }
.footer__form { display: flex; gap: 8px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.footer__input { background: transparent; border: none; color: var(--text-primary); font-family: inherit; font-size: 1rem; outline: none; flex: 1; }
.btn-white { border-color: var(--text-primary); background: transparent; padding: 10px 20px; text-transform: uppercase; font-weight: 600; cursor: pointer; }
.btn-white:hover { background: var(--text-primary); color: #fff; }

.footer__msg { font-size: 0.8rem; margin-top: 10px; color: var(--text-secondary); opacity: 0; transition: opacity 0.3s ease; }

/* ----- Utilities ----- */
.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
