:root {
  --bg-main: #0b0f19;
  --bg-card: #121826;
  --glass: rgba(255, 255, 255, 0.06);

  --text-main: #f5f7fa;
  --text-soft: #aab4c3;
  --text-muted: #6f7b8c;

  --aurora: #5fffb2;
  --ice: #7fd6ff;
  --warm: #ffb86b;
  --danger: #ff6b6b;

  --radius-lg: 28px;
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 24px 60px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  padding-bottom: 140px;
  font-family: "Inter", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(95, 255, 178, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(127, 214, 255, 0.12), transparent 30%),
    var(--bg-main);
}

button,
input,
textarea,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  outline: none;
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1150px, 100%);
  margin: 0 auto;
  padding: 28px 18px;
}

.app-header,
.form-card,
.gallery-section,
.settings-section {
  margin-bottom: 34px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--aurora);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 12px;
}

.app-header h1 {
  margin-bottom: 12px;
  font-size: 44px;
}

.header-text {
  max-width: 650px;
  color: var(--text-soft);
  line-height: 1.7;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.form-card,
.settings-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

form {
  display: grid;
  gap: 14px;
}

.file-label {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.file-label span {
  color: var(--text-soft);
  font-size: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.danger-btn {
  border: none;
  border-radius: 18px;
  padding: 14px 18px;
  font-weight: 700;
}

.primary-btn {
  color: #061016;
  background: linear-gradient(135deg, var(--aurora), var(--ice));
  box-shadow: 0 14px 35px rgba(95, 255, 178, 0.22);
}

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

.danger-btn {
  color: #ffb4b4;
  background: rgba(255, 107, 107, 0.14);
}

.image-preview {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.image-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.remove-image-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  font-size: 16px;
  z-index: 10;
}

.gallery-controls {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 12px;
  margin-bottom: 18px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.photo-card {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.photo-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover);
}

.photo-card img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  display: block;
  transition:
    transform 1s ease,
    filter 1s ease;
}

.photo-card:hover img {
  transform: scale(1.08);
  filter: brightness(1.06) contrast(1.05) saturate(1.08);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82),
    rgba(0, 0, 0, 0.18),
    transparent
  );
}

.card-content {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
}

.trip-badge,
.category-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 11px;
}

.trip-badge {
  background: rgba(95, 255, 178, 0.14);
  border: 1px solid rgba(95, 255, 178, 0.22);
}

.category-badge {
  background: rgba(255, 255, 255, 0.12);
}

.card-location {
  margin-bottom: 6px;
  color: var(--ice);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-date {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.card-title {
  margin-bottom: 8px;
  font-size: 22px;
}

.card-meta {
  color: var(--text-soft);
  font-size: 13px;
}

.favorite-btn,
.edit-btn,
.delete-btn {
  position: absolute;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  z-index: 5;
  backdrop-filter: blur(12px);
}

.favorite-btn {
  top: 14px;
  left: 14px;
}

.favorite-btn.active {
  color: gold;
}

.edit-btn {
  top: 14px;
  right: 64px;
}

.delete-btn {
  top: 14px;
  right: 14px;
}

.empty-state {
  padding: 50px 20px;
  border-radius: 28px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
}

.empty-state p {
  color: var(--text-soft);
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  background: rgba(2, 6, 14, 0.82);
  backdrop-filter: blur(24px);
  transition: opacity 0.45s ease;
}

.photo-viewer.active {
  opacity: 1;
  pointer-events: auto;
}

#viewer-image {
  width: min(1200px, 100%);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 30px;
  box-shadow: 0 45px 120px rgba(0, 0, 0, 0.65);
}

.viewer-close-btn,
.viewer-nav-btn {
  position: absolute;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 24px;
  backdrop-filter: blur(18px);
  z-index: 10;
}

.viewer-close-btn {
  top: 24px;
  right: 24px;
}

.viewer-prev-btn {
  left: 24px;
}

.viewer-next-btn {
  right: 24px;
}

.viewer-info {
  position: absolute;
  left: 30px;
  bottom: 30px;
  max-width: 600px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
}

.viewer-info p {
  color: var(--text-soft);
  line-height: 1.7;
}

.floating-add-btn {
  position: fixed;
  right: 24px;
  bottom: 110px;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--aurora), var(--ice));
  color: #051016;
  font-size: 30px;
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(95, 255, 178, 0.28);
  z-index: 999;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(92%, 520px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 14px 10px;
  border-radius: 28px;
  background: rgba(10, 15, 25, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  z-index: 9998;
}

.nav-item {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.nav-item span {
  font-size: 20px;
}

.nav-item p {
  font-size: 11px;
}

.nav-item.active {
  color: var(--aurora);
  transform: translateY(-4px);
}

.app-footer {
  color: var(--text-soft);
  text-align: center;
  padding: 20px 0 40px;
  font-size: 13px;
}

@media (max-width: 768px) {
  .gallery-controls {
    grid-template-columns: 1fr;
  }

  .app-header h1 {
    font-size: 36px;
  }

  .photo-card,
  .photo-card img {
    min-height: 360px;
  }

  .viewer-info {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: unset;
  }

  .viewer-prev-btn,
  .viewer-next-btn {
    width: 48px;
    height: 48px;
  }

  .floating-add-btn {
    width: 58px;
    height: 58px;
    font-size: 26px;
  }
}