
:root {
  --green: #16834a;
  --darkgreen: #0d5932;
  --black: #0b0b0b;
  --white: #ffffff;
  --light: #f5f5f5;
  --gray: #777777;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  background: var(--white);
  color: var(--black);
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  transition: .25s ease;
}

button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* HEADER */

.header {
  background: var(--black);
  color: var(--white);
  padding: 22px 7%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo, .footer-logo {
  color: var(--white);
  font-size: 25px;
  font-weight: bold;
  letter-spacing: 3px;
  text-decoration: none;
}

.logo span, .footer-logo span {
  color: var(--green);
}

nav {
  display: flex;
  gap: 25px;
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 13px;
  transition: color .2s;
}

nav a:hover {
  color: var(--green);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: white;
  font-size: 25px;
}

.hero {
  min-height: 530px;
  display: flex;
  align-items: center;
  padding: 80px 10%;

  background-image:
    linear-gradient(
      rgba(0, 0, 0, 0.45),
      rgba(0, 0, 0, 0.65)
    ),
    url("./images/4B8FF45E-948B-4084-B769-DE0EDFC639DB.gif");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  color: white;
  overflow: hidden;
}

.hero-content {
  animation: slideUp .8s ease;
}

.eyebrow {
  display: block;
  color: var(--green);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 3px;
  margin-bottom: 15px;
}

.hero .eyebrow {
  color: white;
}

.hero h1 {
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.08;
  margin-bottom: 20px;
}

.hero h1 span {
  color: var(--black);
}

.hero p {
  line-height: 1.8;
}

.primary-button {
  background: var(--black);
  color: white;
  border: 2px solid var(--black);
  padding: 15px 23px;
  font-size: 12px;
  font-weight: bold;
  margin-top: 25px;
}

.primary-button:hover {
  background: white;
  color: var(--black);
}

.black-button {
  background: var(--black);
  color: white;
  border: none;
  padding: 13px 20px;
  margin-top: 15px;
}

.black-button:hover {
  background: var(--darkgreen);
}

/* GALLERY */

.section {
  padding: 75px 7%;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 35px;
}

.section-heading h2,
.admin h2 {
  font-size: clamp(30px, 5vw, 42px);
  margin-bottom: 10px;
}

.section-heading h2 span,
.admin h2 span {
  color: var(--green);
}

.section-heading p,
.admin-panel > p {
  color: var(--gray);
  font-size: 14px;
  line-height: 1.7;
}

.gallery-stats {
  display: flex;
  gap: 30px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat strong {
  font-size: 27px;
  color: var(--green);
}

.stat span {
  font-size: 10px;
  letter-spacing: 1px;
}

/* SEARCH */

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #ddd;
  padding: 0 15px;
  min-width: 220px;
  flex: 1;
}

.search-box span {
  font-size: 25px;
  color: var(--green);
}

.search-box input {
  border: none;
  outline: none;
  width: 100%;
  padding: 14px 0;
  background: transparent;
  color: var(--black);
}

.filter-buttons {
  display: flex;
  gap: 8px;
}

.filter {
  background: white;
  color: var(--black);
  border: 1px solid #ddd;
  padding: 12px 15px;
  font-size: 10px;
  font-weight: bold;
}

.filter.active,
.filter:hover {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

/* PHOTO CARDS */

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

.card {
  border: 1px solid #e5e5e5;
  background: white;
  overflow: hidden;
  animation: fadeIn .4s ease;
  transition: transform .3s, box-shadow .3s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
}

.image-wrap {
  height: 245px;
  position: relative;
  overflow: hidden;
  background: var(--light);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform .5s;
}

.card:hover .card-image {
  transform: scale(1.06);
}

.favorite-button {
  position: absolute;
  top: 12px;
  right: 12px;
  background: white;
  color: var(--black);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 19px;
}

.favorite-button.active {
  color: var(--green);
}

.card-content {
  padding: 18px;
}

.card-content h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.card-content p {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.7;
  min-height: 40px;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.actions button {
  flex: 1;
  padding: 11px;
  border: none;
  font-size: 11px;
  font-weight: bold;
}

.edit {
  background: var(--green);
  color: white;
}

.delete {
  background: var(--black);
  color: white;
}

.actions button:hover {
  opacity: .8;
}

.loading, .empty-message {
  padding: 35px 0;
  color: var(--gray);
}

.hidden {
  display: none !important;
}

/* ADMIN */

.admin {
  background: var(--light);
  border-top: 4px solid var(--green);
}

.admin-panel {
  max-width: 650px;
  margin: auto;
  background: white;
  padding: 35px;
  border: 1px solid #e5e5e5;
}

.admin-panel h3 {
  margin-bottom: 15px;
}

.admin-panel form {
  margin-top: 25px;
}

.admin-panel label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  margin: 15px 0 7px;
}

.admin-panel input,
.admin-panel textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid #ddd;
  background: white;
  outline: none;
  color: var(--black);
}

.admin-panel input:focus,
.admin-panel textarea:focus {
  border-color: var(--green);
}

.admin-panel textarea {
  min-height: 100px;
  resize: vertical;
}

.full-button {
  width: 100%;
}

.admin-divider {
  height: 1px;
  background: #ddd;
  margin: 30px 0;
}

.upload-preview {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.upload-preview img {
  width: 85px;
  height: 85px;
  object-fit: cover;
}

#status {
  text-align: center;
  margin: 20px auto 0;
  max-width: 650px;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* LIGHTBOX */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 75px;
}

.lightbox-content {
  max-width: 900px;
  width: 100%;
  text-align: center;
  color: white;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.lightbox-content h3 {
  margin-top: 15px;
}

.lightbox-content p {
  margin-top: 8px;
  color: #ccc;
  font-size: 13px;
}

#lightboxPosition {
  display: block;
  margin-top: 10px;
  color: var(--green);
  font-size: 12px;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: transparent;
  color: white;
  border: none;
}

.lightbox-close {
  top: 20px;
  right: 30px;
  font-size: 38px;
}

.lightbox-nav {
  top: 50%;
  font-size: 55px;
  transform: translateY(-50%);
}

.previous {
  left: 20px;
}

.next {
  right: 20px;
}

.lightbox button:hover {
  color: var(--green);
}

/* FOOTER */

footer {
  background: var(--black);
  color: white;
  text-align: center;
  padding: 35px 15px;
}

.footer-logo {
  margin-bottom: 15px;
}

footer p {
  font-size: 11px;
  line-height: 2;
  color: #ccc;
}

/* MOBILE */

@media(max-width: 650px) {

  .header {
    padding: 18px 5%;
  }

  .menu-toggle {
    display: block;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 20px;
    background: var(--black);
    flex-direction: column;
    gap: 20px;
  }

  nav.open {
    display: flex;
  }

  .hero {
    min-height: 440px;
    padding: 65px 6%;
  }

  .section {
    padding: 50px 5%;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .gallery-stats {
    margin-top: 10px;
  }

  .toolbar {
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .filter-buttons button {
    flex: 1;
  }

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

  .image-wrap {
    height: 175px;
  }

  .card-content {
    padding: 12px;
  }

  .card-content h3 {
    font-size: 15px;
  }

  .card-content p {
    font-size: 12px;
  }

  .admin-panel {
    padding: 22px;
  }

  .lightbox {
    padding: 50px 35px;
  }

  .lightbox-nav {
    font-size: 35px;
  }

  .previous {
    left: 5px;
  }

  .next {
    right: 5px;
  }
}


/* =====================================
   CYBER GALLERY - PREMIUM ANIMATIONS
===================================== */

/* HERO ANIMATION */

.hero-content {
  animation: heroReveal 1s ease both;
}

@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(35px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* HERO BUTTON */

.primary-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.primary-button:hover {
  background: white;
  color: var(--black);
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,.2);
}

/* PHOTO CARD REVEAL */

.card {
  opacity: 0;
  animation: none;
  transform: translateY(35px) scale(.97);
  transition:
    opacity .7s ease,
    transform .45s ease,
    box-shadow .4s ease;
  transition-delay: var(--card-delay, 0ms);
  transform-style: preserve-3d;
}

.card.is-visible {
  opacity: 1;
  transform:
    perspective(1000px)
    translateY(0)
    scale(1)
    rotateX(var(--rotate-x, 0deg))
    rotateY(var(--rotate-y, 0deg));
}

.card.is-visible:hover {
  transform:
    perspective(1000px)
    translateY(-6px)
    scale(1.01)
    rotateX(var(--rotate-x, 0deg))
    rotateY(var(--rotate-y, 0deg));

  box-shadow: 0 18px 40px rgba(0,0,0,.18);
}

/* IMAGE ZOOM */

.card-image {
  transition:
    transform .65s cubic-bezier(.2,.8,.2,1),
    filter .4s ease;
}

.card:hover .card-image {
  transform: scale(1.08);
  filter: brightness(1.08);
}

/* IMAGE OVERLAY */

.image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.15),
    transparent 50%
  );
  opacity: 0;
  transition: opacity .4s ease;
}

.card:hover .image-wrap::after {
  opacity: 1;
}

/* FAVORITE BUTTON */

.favorite-button {
  transition:
    transform .3s ease,
    color .3s ease,
    background .3s ease;
}

.favorite-button:hover {
  transform: scale(1.15);
}

.favorite-button.active {
  animation: heartPop .35s ease;
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* GENERAL BUTTON EFFECTS */

button {
  transition:
    transform .25s ease,
    background .25s ease,
    color .25s ease,
    box-shadow .25s ease;
}

button:active {
  transform: scale(.95);
}

@keyframes buttonPulse {
  0% { transform: scale(1); }
  50% { transform: scale(.95); }
  100% { transform: scale(1); }
}

.button-tap {
  animation: buttonPulse .22s ease;
}

/* FILTER ANIMATION */

.filter {
  transition: all .3s ease;
}

.filter:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0,0,0,.12);
}

/* SEARCH FOCUS */

.search-box {
  transition:
    border-color .3s ease,
    box-shadow .3s ease;
}

.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,131,74,.12);
}

/* ADMIN PANEL */

.admin-panel {
  transition:
    box-shadow .3s ease,
    transform .3s ease;
}

.admin-panel:focus-within {
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

.admin-panel input:focus,
.admin-panel textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,131,74,.10);
}

/* LOADING SPINNER */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading::before {
  content: "";
  display: block;
  width: 35px;
  height: 35px;
  margin: 0 auto 15px;
  border: 4px solid #e5e5e5;
  border-top: 4px solid var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* LIGHTBOX ANIMATION */

@keyframes lightboxOpen {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes imageZoom {
  from {
    opacity: 0;
    transform: scale(.90);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox {
  animation: lightboxOpen .3s ease;
}

.lightbox-content img {
  animation: imageZoom .4s ease;
}

.lightbox-close {
  transition:
    transform .3s ease,
    color .3s ease;
}

.lightbox-close:hover {
  transform: rotate(90deg);
  color: var(--green);
}

.lightbox-nav {
  transition:
    transform .3s ease,
    color .3s ease;
}

.lightbox-nav:hover {
  color: var(--green);
}

/* HEADER NAVIGATION */

nav a {
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--green);
  transition: width .3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* FOOTER */

.footer-logo {
  transition: color .3s ease;
}

.footer-logo:hover {
  color: var(--green);
}

/* MOBILE OPTIMIZATION */

@media (max-width: 650px) {
  .card.is-visible:hover {
    transform: translateY(0) scale(1);
    box-shadow: none;
  }

  .card:hover .card-image {
    transform: none;
  }

  .hero-content {
    animation-duration: .7s;
  }
}

/* ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .card {
    opacity: 1;
    transform: none;
  }
}

