/* --- GLOBAL CONTAINER --- */
.gr-access-wrap {
  max-width: 900px;
  margin: 0 auto;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  color: #333;
}

.gr-card {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 40px;
}

.gr-card h3 {
  margin-top: 0;
  font-size: 24px;
  font-weight: 700;
}

.gr-expiry {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

/* --- BUTTONS & INPUTS --- */
input#gr-code {
  padding: 12px 16px;
  font-size: 16px;
  border: 2px solid #eee;
  border-radius: 8px;
  margin-right: 10px;
  transition: border-color 0.2s;
  outline: none;
}
input#gr-code:focus {
  border-color: #ff2b6a;
}

/* Üldine nupu stiil */
button.gr-btn,
button#gr-open-album,
button#gr-send-selection,
button#gr-start-select,
button#gr-stop-select,
button#gr-back-to-login {
  border: none;
  padding: 10px 20px; /* Vähendatud padding */
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  min-height: 42px; /* Väiksem kõrgus mobiili jaoks */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

button:active {
  transform: translateY(1px);
  box-shadow: none;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Primary nupud (Roosad) */
button#gr-open-album,
button#gr-send-selection,
button#gr-start-select {
  background: #ff2b6a;
  color: #fff;
}
button#gr-open-album:hover,
button#gr-send-selection:hover,
button#gr-start-select:hover {
  background: #e01b55;
  box-shadow: 0 6px 12px rgba(255, 43, 106, 0.25);
}

/* Secondary nupud */
button#gr-stop-select,
.gr-reset {
  background: #f1f3f5;
  color: #555;
  border: 1px solid transparent;
}
button#gr-stop-select:hover,
.gr-reset:hover {
  background: #e9ecef;
  color: #333;
}

/* "Väljun" nupp - OUTLINE STYLE (Valge, punase äärega) */
button#gr-back-to-login {
  background: #fff;
  border: 2px solid #ff2b6a;
  color: #ff2b6a;
  box-shadow: none;
}
button#gr-back-to-login:hover,
button#gr-back-to-login:disabled {
  background: #fff0f5;
  color: #d0003e;
  border-color: #d0003e;
}

/* --- TOOLBAR --- */
.gr-toolbar {
  margin: 20px 0;
  text-align: left;
}

/* --- SELECTION OVERLAY --- */
.gr-overlay {
  display: none;
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 99999;
  background: rgba(255, 255, 255, 0.2);
  border: 4px solid transparent;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s;
  pointer-events: none;
}

.gr-select-mode .gr-overlay {
  display: block;
  pointer-events: auto;
}

@media (hover: hover) {
  .gr-select-mode .gr-overlay:hover {
    background: rgba(255, 43, 106, 0.15);
    border-color: rgba(255, 43, 106, 0.3);
  }
}

.gr-overlay.is-selected {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ff2b6a;
}

.gr-overlay-check {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 44px;
  height: 44px;
  background: #ff2b6a;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gr-overlay.is-selected .gr-overlay-check {
  transform: translate(-50%, -50%) scale(1);
}

/* --- SUMMARY AREA --- */
.gr-summary {
  background: #fafafa;
  border-top: 2px solid #f0f0f0;
  padding: 20px 0;
  margin-top: 30px;
}

.gr-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 15px;
}

.gr-reset {
  padding: 6px 14px !important;
  font-size: 12px !important;
  min-height: 30px !important;
}

.gr-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gr-thumb-wrap {
  position: relative;
  width: 70px;
  height: 70px;
}

.gr-thumb {
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.gr-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gr-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  background: #ff2b6a;
  color: white;
  border-radius: 50%;
  border: 2px solid white;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* --- FOOTER ACTIONS & MOBILE LAYOUT --- */
.gr-footer-actions {
  margin-top: 30px;
  display: flex;
  gap: 12px; /* Väiksem vahe */
  align-items: center;
  flex-wrap: wrap;
}

.gr-msg {
  margin-top: 15px;
  font-weight: 600;
  font-size: 14px;
}
.gr-msg.is-error {
  color: #d32f2f;
}
.gr-msg.is-success {
  color: #388e3c;
}

.gr-note {
  margin-top: 20px;
  font-size: 12px;
  color: #999;
  text-align: center;
}

/* --- MOBILE RESPONSIVENESS (Alla 600px) --- */
@media (max-width: 600px) {
  .gr-card {
    padding: 20px;
  }

  .gr-footer-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  button#gr-send-selection,
  button#gr-back-to-login {
    width: 100%;
    margin: 0;
  }

  /* Login vaade */
  input#gr-code {
    width: 100%;
    margin-bottom: 10px;
    box-sizing: border-box;
  }
  button#gr-open-album {
    width: 100%;
  }

  button#gr-start-select,
  button#gr-stop-select {
    width: 100%;
  }

  .gr-summary-head {
    flex-direction: row;
  }
}
