/* Modal styles */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: none;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: #C0C0C0;
  border: 2px solid;
  border-color: #DFDFDF #000000 #000000 #DFDFDF;
  box-shadow: none;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: none;
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 2px solid;
  border-color: #DFDFDF #000000 #000000 #DFDFDF;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: linear-gradient(90deg, #000080 0%, #1084D7 100%);
  color: #FFFFFF;
}

.modal-header h2 {
  margin: 0;
  flex: 1;
  min-width: 200px;
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: bold;
}

.modal-close-btn {
  background: #C0C0C0;
  border: 2px solid;
  border-color: #DFDFDF #808080 #808080 #DFDFDF;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  cursor: pointer;
  transition: none;
  flex-shrink: 0;
  font-weight: bold;
  font-size: 1rem;
}

.modal-close-btn:hover {
  color: #000000;
  border-color: #808080 #DFDFDF #DFDFDF #808080;
}

.modal-body {
  padding: 1rem;
  max-height: calc(90vh - 120px);
  overflow-y: auto;
  background-color: #C0C0C0;
  color: #000000;
}

/* Gallery Modal Specific */
#gallery-modal .modal-content {
  width: 90vw;
  height: 90vh;
  max-width: none;
  max-height: none;
  display: flex;
  flex-direction: column;
}

#gallery-modal .modal-body {
  max-height: none;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.modal-footer {
  padding: 0.75rem;
  border-top: 2px solid;
  border-color: #DFDFDF #000000 #000000 #DFDFDF;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  background-color: #C0C0C0;
}

/* Agreement Modal Specific */
#agreement-modal .modal-body {
  max-width: 600px;
}

.agreement-checkbox-container {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #808080;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  margin-bottom: 1rem;
  color: #000000;
}

.checkbox-label input[type='checkbox'] {
  flex-shrink: 0;
}

#agree-button {
  margin-top: 0.75rem;
}

/* Code Input Modal */
.code-input-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.code-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.code-form input {
  font-size: 1.125rem;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 0.5rem;
  border: 2px solid;
  border-color: #808080 #DFDFDF #DFDFDF #808080;
}

.code-form button {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
}

/* Error display in modals */
#error-display {
  margin-bottom: 0.5rem;
}

/* Scrollbar styling - Windows style */
.modal-body::-webkit-scrollbar {
  width: 12px;
}

.modal-body::-webkit-scrollbar-track {
  background: #C0C0C0;
  border: 1px solid #DFDFDF;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #C0C0C0;
  border: 2px solid;
  border-color: #DFDFDF #000000 #000000 #DFDFDF;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #D0D0D0;
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95%;
    max-height: 95vh;
    border: 2px solid;
    border-color: #DFDFDF #000000 #000000 #DFDFDF;
  }

  .modal-header {
    padding: 0.5rem;
    flex-direction: row;
    align-items: center;
  }

  .modal-header h2 {
    width: auto;
    flex: 1;
  }

  .modal-close-btn {
    position: relative;
  }

  .modal-body {
    padding: 1rem;
    max-height: calc(95vh - 100px);
  }

  .modal-footer {
    padding: 0.75rem;
    flex-direction: row-reverse;
  }

  .code-input-container {
    max-width: 100%;
  }

  .code-form button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .modal-content {
    max-width: 100%;
    max-height: 100vh;
    border: 2px solid;
    border-color: #DFDFDF #000000 #000000 #DFDFDF;
  }

  .modal-body {
    max-height: calc(100vh - 100px);
  }
}
