:root {
  --blue: #0057b7;
  --blue-dark: #003d82;
  --blue-light: #e8f0fe;
  --yellow: #ffd700;
  --yellow-dark: #e6c200;
  --red: #d32f2f;
  --red-dark: #b71c1c;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 16px 32px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  background-image: url('https://images.unsplash.com/photo-1519681393784-d120267933ba?ixlib=rb-4.0.3&auto=format&fit=crop&w=1950&q=80');
  background-size: cover;
  background-attachment: fixed;
  background-position: center 30%;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  z-index: -1;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
  padding-bottom: 60px;
}

/* ========== ХЕДЕР ========== */
.main-header {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(0,87,183,0.2);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 12px 28px;
  flex-wrap: wrap;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.header-logo-icon {
  width: 95px;
  height: 95px;
  border-radius: 24px;
  overflow: hidden;
  background: white;
  box-shadow: 0 10px 25px rgba(0,87,183,0.2);
  transition: transform 0.3s;
}

.header-logo-icon:hover {
  transform: scale(1.02);
}

.header-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.header-logo-text {
  display: flex;
  flex-direction: column;
}

.header-logo-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--blue);
  line-height: 1.1;
}

.header-logo-sub {
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 600;
}

.mobile-menu-toggle {
  display: none;
  background: var(--blue);
  border: none;
  color: white;
  font-size: 1.2rem;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.header-nav ul {
  display: flex;
  list-style: none;
  gap: 8px;
  flex-wrap: wrap;
}

.header-nav a {
  text-decoration: none;
  color: var(--gray-700);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 18px;
  border-radius: 30px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-nav a:hover,
.header-nav a.active {
  background: var(--blue-light);
  color: var(--blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}


.btn-support {
  background: var(--red);
  color: white;
  padding: 8px 22px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-support:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
}

/* ========== ВИПАДАЮЧЕ МЕНЮ "БІЛЬШЕ" – ТІЛЬКИ ВНИЗ ========== */
.has-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-radius: 12px;
  min-width: 220px;
  z-index: 1000;
  padding: 8px 0;
  list-style: none;
}

.has-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: #2d3748;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background: #ebf4ff;
  color: #0057b7;
}

/* ========== ФУТЕР ========== */
.main-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 40px 0 20px;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-700);
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  overflow: hidden;
  background: white;
}

.footer-social a {
  background: var(--blue);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  transition: var(--transition);
}

.footer-social a:hover {
  background: var(--yellow);
  color: black;
}

.footer-middle {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 30px;
  padding: 30px 0;
  border-bottom: 1px solid var(--gray-700);
}

.footer-nav h4 {
  color: white;
  margin-bottom: 12px;
}

.footer-nav ul {
  list-style: none;
}

.footer-nav li {
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.footer-nav a {
  color: var(--gray-400);
  text-decoration: none;
}

.footer-nav a:hover {
  color: white;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  font-size: 0.75rem;
  color: var(--gray-500);
  flex-wrap: wrap;
  gap: 10px;
}

/* ========== ЗАГАЛЬНІ КОМПОНЕНТИ ========== */
.section-header {
  text-align: center;
  margin: 50px 0 30px;
}

.section-label {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  padding: 6px 20px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--gray-900);
  margin-bottom: 12px;
}

.section-subtitle {
  color: var(--gray-600);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Кнопки */
.add-trip-btn {
  background: var(--yellow);
  color: var(--gray-900);
  padding: 10px 24px;
  border: none;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.add-trip-btn:hover {
  background: #ffe44d;
  transform: translateY(-2px);
}

/* ===== АДМІН-ПАНЕЛЬ (стильні кнопки) ===== */
.admin-only {
  display: none;
}

.admin-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 0;
}

.admin-controls a,
.admin-controls button {
  white-space: nowrap;
}
.admin-controls button {
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--blue);
  color: var(--blue);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

/* Стилі для адмін-кнопок у хедері (Заявки, Відгуки, Вийти) */
.admin-controls a,
.admin-controls button {
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--blue);
  color: var(--blue);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.admin-controls a:hover,
.admin-controls button:hover {
  background: var(--blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 87, 183, 0.25);
}

#adminLogoutBtn {
  border-color: var(--red);
  color: var(--red);
}

#adminLogoutBtn:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

/* Виправлення для випадаючого меню "Більше" */
.has-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  min-width: 170px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s;
  list-style: none;
  z-index: 1001;
}

.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
}

/* Гарантія, що хедер на великих екранах не ламається */
@media (min-width: 1024px) {
  .header-container {
    flex-wrap: nowrap;
  }
  .header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
  }
  .header-nav ul {
    justify-content: center;
    flex-wrap: nowrap;
  }
  .header-actions {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
  }
}

/* Стильне спливаюче повідомлення */
.custom-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 24px 40px;
  text-align: center;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.2);
  min-width: 280px;
  max-width: 90vw;
  width: auto;
}

.custom-notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.notification-content i {
  font-size: 48px;
  color: #4caf50;
  margin-bottom: 16px;
  display: block;
}

.notification-content p {
  color: white;
  font-size: 1rem;
  margin: 0;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.4;
  max-width: 400px;
}

@media (max-width: 600px) {
  .custom-notification {
    padding: 20px 24px;
    min-width: 260px;
  }
  .notification-content p {
    font-size: 0.85rem;
  }
  .notification-content i {
    font-size: 36px;
  }
}

@media (max-width: 600px) {
  .custom-notification {
    padding: 20px 30px;
  }
  .notification-content p {
    font-size: 0.9rem;
    white-space: normal;
    min-width: 250px;
  }
}

/* Адаптивність */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    padding: 16px;
    border-radius: 0 0 20px 20px;
    box-shadow: var(--shadow-md);
  }
  .header-nav.active {
    display: block;
  }
  .header-nav ul {
    flex-direction: column;
    gap: 12px;
  }
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    padding-left: 20px;
  }
  .header-logo-icon {
    width: 70px;
    height: 70px;
  }
  .header-logo-title {
    font-size: 1.3rem;
  }
}

/* ========== ДЕКОРАТИВНИЙ КОЛАЖ ========== */
#bgCollage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.collage-img {
  position: absolute;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  animation: collageFloat 6s ease-in-out infinite;
  opacity: 0.75;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 0;
}

.collage-img:hover {
  opacity: 0.95;
  transform: scale(1.02);
}

.collage-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.98) contrast(1.02);
  display: block;
}

@keyframes collageFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 1024px) {
  .collage-img {
    opacity: 0.65;
    width: 10vw !important;
  }
}

@media (max-width: 768px) {
  .collage-img {
    opacity: 0.5;
    width: 14vw !important;
  }
}
/* Для великих екранів - хедер в один рядок */
@media (min-width: 1024px) {
  .header-container {
    flex-wrap: nowrap;
  }
  .header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
  }
  .header-nav ul {
    justify-content: center;
  }
  .header-actions {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
  }
}

/* Гарантуємо, що admin-controls не ламають рядок */
.admin-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 0;
}

/* ========== СТИЛІ ДЛЯ СТАРИХ ФОТО (POLAROID) ========== */
#bgCollage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.collage-polaroid {
  position: absolute;
  background: #fef9e8;  /* старий папір/білий колір */
  padding: 12px 12px 20px 12px;
  border-radius: 8px 12px 12px 8px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  transition: all 0.3s ease;
  animation: floatOldPhoto 8s ease-in-out infinite;
  backdrop-filter: blur(0.5px);
}

.collage-polaroid img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  filter: sepia(0.2) contrast(1.05) brightness(0.98);
  border-radius: 2px;
}

/* Додатковий ефект "обгризаних" країв через clip-path (різні форми) */
.collage-polaroid:nth-child(odd) {
  clip-path: polygon(0% 0%, 100% 0%, 98% 98%, 2% 100%);
}
.collage-polaroid:nth-child(even) {
  clip-path: polygon(2% 0%, 98% 0%, 96% 96%, 4% 100%);
}
.collage-polaroid:nth-child(3n) {
  clip-path: polygon(1% 1%, 99% 2%, 97% 97%, 3% 99%);
}

/* Легка тінь текстури паперу */
.collage-polaroid::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 2px, transparent 2px, transparent 8px);
  pointer-events: none;
  border-radius: inherit;
}

/* Анімація плавання */
@keyframes floatOldPhoto {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-12px) rotate(1deg);
  }
}

/* Адаптивність: на малих екранах зменшуємо розміри та ховаємо деякі фото */
@media (max-width: 1024px) {
  .collage-polaroid {
    width: 200px !important;
    padding: 8px 8px 14px 8px;
  }
  .collage-polaroid:nth-child(3),
  .collage-polaroid:nth-child(6) {
    display: none;
  }
}

@media (max-width: 768px) {
  .collage-polaroid {
    width: 150px !important;
    opacity: 0.5 !important;
  }
  .collage-polaroid:nth-child(2),
  .collage-polaroid:nth-child(5) {
    display: none;
  }
}
/* Гарантія видимості адмін-кнопок */
.admin-only.add-trip-btn {
  display: none;
}
/* Коли адмін залогінений, клас admin-only отримує display: inline-flex через JS */
/* Дублюємо для надійності */
body:has(.admin-controls a[href="admin/applications.html"]:not([style*="display: none"])) .admin-only.add-trip-btn {
  display: inline-flex !important;
}