:root {
  --black: #252422;
  --brown: #3A2F2F;
  --vanilla: #e3e7af;
  --blue: #6a8eae;
  --sugar: #be9e46;
}

/* General */

body {
  background-color: var(--sugar);
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
}

.content {
  margin: 20px;
  display: flex;
  justify-content: center;
}


.horizontal-container {
  display: flex; /* Use Flexbox */
}

.horizontal-container > div { /* Target direct children */
  flex: 1; /* Allow children to grow equally */
  padding: 10px;
  margin: 5px; /* Optional spacing between children */
  border-radius: 4px;
  border: 0;
}

/* Navbar */

ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--black);
}

li {
  float: left;
}

li a {
  display: block;
  color: var(--vanilla);
  text-align: center;
  padding: 7px 8px;
  text-decoration: none;
  margin: 7px 8px;
  border-radius: 4px;
}

/* Change the link color to #111 (black) on hover */
li a:hover {
  background-color: var(--brown);
}

.concert-one-regular {
  font-family: "Concert One", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1.5em;
}

.navbar {
  width: 100%;
  margin: 0;
}

.gallery-title-nav {
  float: left;
}

.gallery-title-nav span {
  display: block;
  color: var(--vanilla);
  text-align: center;
  padding: 7px 8px;
  margin: 7px 8px;
  border-radius: 4px;
  font-style: italic;
  opacity: 0.9;
}

.montserrat-body {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
}

/* End of Navbar */

/* Full-width input fields */
.login-input, .login-input-password {
  width: 100%;
  padding: 15px;
  margin: 5px 0 22px 0;
  display: inline-block;
  border: none;
  background: var(--vanilla);
}

.login-input:focus, .login-input-password:focus {
  background-color: var(--vanilla);
  outline: none;
}

hr {
  border: 1px solid var(--blue);
  margin-bottom: 25px;
}

/* Set a style for all buttons */
button {
  background-color: var(--blue);
  color: var(--vanilla);
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  cursor: pointer;
  width: 100%;
  opacity: 0.9;
}

button:hover {
  opacity:1;
}

/* Float cancel and signup buttons and add an equal width */
.signupbtn {
  float: left;
  width: 50%;
}

/* Add padding to container elements */
.container {
  padding: 16px;
  background-color: var(--vanilla);
  width: 50vw;
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  border-radius: 10px;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}

/* Change styles for cancel button and signup button on extra small screens */
@media screen and (max-width: 300px) {
  .cancelbtn, .signupbtn {
    width: 100%;
  }
}
.error {
  color: red;
  font-size: 0.875rem;
}

.success {
  color: green;
  font-size: 0.875rem;
}

.submitbtn {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  font-size: 1rem;
  opacity: 0.6;
  /* Initially disabled */
  pointer-events: none;
  /* Initially disabled */
}

.submitbtn.enabled {
  opacity: 1;
  /* Enabled */
  pointer-events: auto;
  /* Enabled */
}

.submitbtn:hover {
  background-color: #0056b3;
}

/* End of login */

/* Gallery - Legacy styles removed, now using unified system */

/* End of Gallery */

/* Unified Grid System */

/* Unified grid container */
.unified-grid {
  display: grid;
  gap: 20px;
  padding: 20px;
  grid-template-columns: repeat(4, minmax(0, 300px));
  justify-content: center;
  max-width: 1400px;
  margin: 0 auto;
}

/* Responsive breakpoints for unified grid */
@media (max-width: 576px) {
  .unified-grid {
    grid-template-columns: minmax(0, 300px);
    gap: 15px;
    padding: 15px;
  }
}

@media (min-width: 577px) and (max-width: 768px) {
  .unified-grid {
    grid-template-columns: repeat(2, minmax(0, 300px));
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .unified-grid {
    grid-template-columns: repeat(3, minmax(0, 300px));
  }
}

@media (min-width: 1201px) {
  .unified-grid {
    grid-template-columns: repeat(4, minmax(0, 300px));
  }
}

/* Unified tile styles */
.unified-tile {
  background: var(--vanilla);
  border: 1px solid var(--black);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
}

.unified-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.unified-tile-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.unified-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.unified-tile-image img.gallery-placeholder {
  padding: 25px;
  object-fit: fill;
}

.unified-tile-content {
  padding: 12px;
  background: var(--vanilla);
  border-top: 1px solid var(--black);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Unified tile caption for images */
.unified-tile-caption {
  font-size: 0.9em;
  color: var(--black);
  margin: 0 0 10px 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Unified tile delete button for images */
.unified-tile-delete {
  align-self: flex-end;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.unified-tile-delete:hover {
  opacity: 1;
}

/* Gallery-specific styles within unified tiles */
.unified-tile .editable-text {
  margin-bottom: 0;
}

.unified-tile .details {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  color: #555;
  padding: 5px 0;
}

.unified-tile .details span {
  display: block;
}

/* End of Unified Grid System */

/* Removed clearfix - no longer needed with CSS Grid */


/* Form */

.upload-form {
  background: var(--brown);
  color: var(--vanilla);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin: 20px;
  border-radius: 4px;
}

h2 {
  text-align: center;
  margin-bottom: 20px;
}

form h2 {
  text-align: left;
  margin-top: 0;
}

.form-group {
  margin-bottom: 15px;
  display: flex;
}

.form-group label {
  flex: 1;
}

.form-group input {
  flex: 1;
  background-color: var(--vanilla);
  color: var(--black);
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.file-input,
.caption-input {
  width: 100%;
  border: 1px solid var(--black);
  border-radius: 2px;
  transition: border-color 0.3s;
}

.file-input {
  padding: 0px;
}

.caption-input {
  padding: 8px;
}

.file-input:focus,
.caption-input:focus {
  border-color: var(--blue);
  outline: none;
}

.upload-button {
  width: 100%;
  padding: 8px;
  background-color: var(--blue);
  color: var(--vanilla);
  border: 1px solid var(--black);
  border-radius: 2px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

input[type=file]::file-selector-button {
  border: none;
  padding: 8px;
  border-radius: 0;
  background-color: var(--blue);
  transition: 1s;
  color: var(--vanilla);
}

input[type=file]::file-selector-button:hover {
  background-color: var(--sugar);
  color: var(--black);
}

.upload-button:hover {
  background-color: var(--sugar);
  color: var(--black);
}

.upload-form-title {
    display: flex;
    width: 100%;
    background-color: var(--blue);
    padding: 8px;
    color: var(--black);
    font-weight: bold;
}

.upload-form-title .close-button {
  margin-left: auto;
  cursor: pointer;
}

.progress-bar {
  width: 100%;
  height: 20px;
  margin-top: 10px;
}

.croppie-container {
  margin-top: 20px;
  height: 450px;
  width: 450px;
}
/* End of Form */


.no-underline {
  text-decoration: none;
}

/* Editable Text Component */
.editable-text {
  position: relative;
  display: block;
  width: 100%;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 24px 2px 2px; /* Space for edit icon */
  transition: all 0.2s ease;
  margin: 0;
}

.editable-text:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: none;
}

.editable-text .title,
.editable-text span,
.editable-text div,
.editable-text h2 {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-icon {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.editable-text:hover .edit-icon {
  opacity: 0.6;
}

.editable-text:hover .edit-icon:hover {
  opacity: 1;
}

.clickable-icon {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* Gallery Title Styles */
.gallery-title {
  font-size: 1.5em;
  font-weight: bold;
  color: #333;
  text-align: left;
}

.gallery-title-input {
  background-color: var(--vanilla);
  border: 2px solid transparent; /* No border by default */
  border-radius: 4px;
  outline: none;
  font-size: 1.5em;
  font-weight: 700;
  text-align: left;
  padding: 4px 8px;
  margin: -2px;
  font-family: inherit;
  color: var(--black);
  letter-spacing: 0.5px;
  width: 100%;
  box-shadow: 0 0 0 2px transparent; /* No shadow by default */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gallery-title-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Caption Text Styles */
.caption-text {
  color: #555;
  font-size: 0.9em;
}

.caption-text-input {
  background-color: var(--vanilla);
  border: 2px solid transparent; /* No border by default */
  border-radius: 4px;
  outline: none;
  font-size: 0.9em;
  color: var(--black);
  text-align: left;
  padding: 4px 8px;
  margin: -2px;
  font-family: inherit;
  width: 100%;
  box-shadow: 0 0 0 2px transparent; /* No shadow by default */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.caption-text-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  padding: 25px;
  object-fit: fill;
}

/* Removed complex image overlay styles - simplified design */

.lightbox-container {
    position: relative;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    padding: 20px;
}

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

.lightbox img {
    width: 100%;
    height: 100%;
    border: 1px solid var(--black);
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

.lightbox-nav-button {
    position: absolute;
    top: 24%;
    height: 50%;
    width: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
}

.lightbox-nav-button:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev-button {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.lightbox-next-button {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    text-align: center;
    z-index: 2;
}
