/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* app/assets/stylesheets/custom.css */

/* Home Page */
.welcome-container {
  width: 100%;
  height: 100%;
  margin: 150px 20px 0;
  max-width: 1200px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

.home-title {
  color: black;
  font-weight: 900;
  font-size: clamp(28px, 6vw, 48px);
  margin-bottom: 15px;
}

.welcome-image {
  width: min(80vw, 300px);
  height: min(80vw, 300px);
  object-fit: cover;
  border: 2px solid var(--main-color);
  box-shadow: 4px 4px var(--main-color);
  background-color: var(--primary);
  margin: 30px 0;
}

.welcome-text {
  color: black;
  font-size: clamp(16px, 3vw, 20px);
  max-width: 600px;
  margin: 0 auto 30px;
  padding: 0 20px;
  line-height: 1.5;
}

.button-explore {
  width: min(70%, 200px);
  height: 60px;
  border: 2px solid var(--main-color);
  background-color: var(--secondary);
  box-shadow: 4px 4px var(--main-color);
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 600;
  color: var(--font-color);
  cursor: pointer;
  transition: all 0.2s;
  margin: 20px 0 40px;
}

.button-explore:hover {
    transform: translate(1px, 1px);
    box-shadow: 3px 3px var(--main-color);
}

.button-explore:active {
    box-shadow: 0px 0px var(--main-color);
    transform: translate(4px, 4px);
}

@media (max-width: 480px) {
  .welcome-container {
    padding: 0;
  }
  
  .welcome-image {
    margin: 20px 0;
  }
  
  .button-explore {
    height: 50px;
    margin: 15px 0 30px;
  }
  .cooldown-warning {
    font-size: 10px;
  }
  .error-warning {
    font-size: 10px;
  }
  .cooldown-timer {
    font-size: 10px;
  }

  #controls .control-btn {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 900px) {
  #exportButton {
    display: none;
  }

  #colorDropdown {
    padding:10px;
  }

  .container #coordinatesDisplay {
    bottom: 80px;
    padding: 5px;
    font-size: 10px;
  }
  .container .color-picker-wrapper {
    left: 120px;
  }
}

#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: black;
  background-color: var(--primary);
  font-size: 1.5rem;
  z-index: 100000; /* Ensure it's on top of everything */
}

#container {
  margin: 0;
  padding: 0;
  overflow: hidden;
  /* background-color: #F0F0F0; */
}

#canvas {
  display: block;
}

#controls {
  position: absolute;
  top: 120px;
  left: 10px;
  z-index: 10;
}

#controls button {
  width: 40px;
  height: 40px;
  margin: 2px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#controls svg {
  pointer-events: none;
}

/* Color Dropdown Styles */
.color-picker-wrapper {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 200px;
}

.modern-dropdown {
  position: fixed;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 12px 16px;
  padding-right: 40px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: white;
  border: 2px solid var(--main-color);
  box-shadow: 4px 4px var(--main-color);
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: none;
}

.color-picker-wrapper .dropdown-arrow {
  position: absolute;
  top: 20px;
  right: 12px;
  transform: translateY(-50%);
  pointer-events: none;
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.modern-dropdown:focus + .dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
  color: black;
}

/* Custom option styling */
.modern-dropdown option {
  padding: 8px 12px;
  position: relative;
}

.modern-dropdown option:not(.add-color-option)::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  vertical-align: middle;
}

/* For browsers that support :has (future-proofing) */
@supports selector(:has(*)) {
  .modern-dropdown option:has([data-color])::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: attr(data-color);
    margin-right: 8px;
    vertical-align: middle;
  }
}

.modern-dropdown:focus {
  outline: none;
}

/* Custom scrollbar */
.modern-dropdown::-webkit-scrollbar {
  width: 6px;
}

.modern-dropdown::-webkit-scrollbar-track {
  background: #F9FAFB;
  border-radius: 3px;
}

.modern-dropdown::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 3px;
}

.modern-dropdown::-webkit-scrollbar-thumb:hover {
  background: #D1D5DB;
}

.modern-dropdown .add-color-option {
  font-weight: bold;
  background-color: #f0f0f0;
  color: black;
  border-top: 5px solid gray;
  font-weight: 500;
  padding-top: 12px;
  margin-top: 4px;
}


/* Modal overlay */
#modalOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Darker background */
    z-index: 1000;
}

/* Color Modal Styles */
.color-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10010;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-container {
  position: relative;
  background: white;
  border: 2px solid var(--main-color);
  background-color: var(--primary);
  box-shadow: 4px 4px var(--main-color);
  width: 320px;
  overflow: hidden;
  z-index: 1;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.color-modal.active .modal-container {
  transform: translateY(0);
  opacity: 1;
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--main-color);
}

#cancelAddColor {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--main-color);
  transition: all 0.2s;
}

#cancelAddColor svg {
  cursor: pointer;
  width: 20px;
  height: 20px;
}

#cancelAddColor:hover {
  color: #111827;
  transform: rotate(90deg);
}

.modal-body {
  padding: 20px;
}

#newColorInput {
  width: 100%;
  height: 40px;
  opacity: 0;
  position: absolute;
  border: 1px dashed black;
}

#newColorInput + label {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: #f9fafb;
  text-align: center;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

#newColorInput + label:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* Export Button Styles */
.export-btn {
  font-family: 'Inter', sans-serif;
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 16px 10px 12px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--font-color);
  border: 2px solid var(--main-color);
  background-color: var(--secondary);
  box-shadow: 4px 4px var(--main-color);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 1000;
}

.export-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.export-btn:active {
  transform: translateY(0);
}

/* Button Primary Style */
.btn-primary {
  padding: 10px 16px;
  background: var(--secondary);
  color: var(--main-color);
  border: 2px solid var(--main-color);
  box-shadow: 4px 4px var(--main-color);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary svg {
  cursor: pointer;
  width: 18px;
  height: 18px;
  stroke: var(--main-color);
}

/* Color Picker Container */
.color-picker-container {
  display: block;
  width: 100%;
  margin-bottom: 20px;
  position: relative;
}

/* Hide the default color input */
.color-picker-container input[type="color"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* Custom Color Preview */
.color-preview {
  width: 100%;
  height: 80px;
  border: 2px solid var(--main-color);
  box-shadow: 4px 4px var(--main-color);
  background-color: var(--colorPreview);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.color-preview svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

/* Update this in your JavaScript */
.modal-body {
  padding: 20px;
}

/* Coordinates display */
#coordinatesDisplay {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 10px;
  color: var(--main-color);
  border: 2px solid var(--main-color);
  background-color: var(--secondary);
  box-shadow: 4px 4px var(--main-color);
  font-family: monospace;
  z-index: 1000;
  display: none; /* Hidden by default */
}

.placePixelBtn {
  display: flex;
  font-family: 'Inter', sans-serif;
  position: fixed;
  bottom: 15px;
  right: 20px;
  padding: 10px;
  font-size: 16px;
  font-weight: 900;
  align-items: center;
  gap: 8px;
  color: var(--font-color);
  border: 2px solid var(--main-color);
  background-color: var(--secondary);
  box-shadow: 4px 4px var(--main-color);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 1000;
}

rect:hover {
  cursor: pointer;
}

/* Cooldown Timer */
.cooldown-timer {
  position: fixed;
  top: 120px;
  width: 50px;
  left: 50%;
  text-align: center;
  transform: translateX(-50%);
  background: var(--primary);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--main-color);
  background-color: var(--secondary);
  box-shadow: 4px 4px var(--main-color);
  z-index: 100;
  opacity: 0;
  transform: translate(-50%, -20px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.cooldown-timer.active {
  opacity: 1;
  transform: translate(-50%, 0);
}

.cooldown-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  width: 100%;
  transform-origin: left;
}

.cooldown-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cooldown-icon {
  width: 20px;
  height: 20px;
}

.cooldown-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
}

.cooldown-time {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  min-width: 20px;
  text-align: center;
}

/* Warning Message */
.cooldown-warning {
  position: fixed;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff3bf;
  color: #854d0e;
  padding: 12px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  text-align: center;
  font-weight: 500;
  box-shadow: 4px 4px var(--main-color);
  border: 2px solid var(--main-color);
  display: none;
  z-index: 100;
  animation: fadeIn 0.3s ease-out;
}

.error-warning {
  position: fixed;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFFDD3;
  color: #9b111E;
  padding: 12px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  box-shadow: 4px 4px var(--main-color);
  border: 2px solid var(--main-color);
  display: none;
  z-index: 100;
  animation: fadeIn 0.3s ease-out;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--font-color);
}

.checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--main-color);
  background-color: var(--secondary);
  box-shadow: 2px 2px var(--main-color);
  accent-color: var(--input-focus); /* For modern browser coloring */
  cursor: pointer;
}

.signup-message {
  margin-top: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  text-align: center;
  width: 100%;
}

.signup-link {
  color: var(--font-color);
  text-decoration: none;
  margin-left: 5px;
  padding: 2px 6px;
  border: 2px solid var(--main-color);
  background-color: var(--secondary);
  box-shadow: 2px 2px var(--main-color);
  font-weight: 700;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.signup-link:active {
  box-shadow: 0px 0px var(--main-color);
  transform: translate(2px, 2px);
}

#remaining-seconds {
  padding: 0 0.3em;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
}
