/* ========================================
   CUSTOM FEATURES STYLES
   Gallery, Contact Form, Share, Mini Map
   ======================================== */

/* ===================================
   CONTROL PANEL LAYOUT (COLLAPSIBLE)
   =================================== */
#controlPanel {
  position: fixed;
  left: 20px;
  bottom: 80px;  /* Space for toggle button */
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: bottom left;
}

/* Hidden state - buttons collapse */
#controlPanel.collapsed {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-100px) scale(0.8);
  pointer-events: none;
}

/* Visible state - buttons show */
#controlPanel:not(.collapsed) {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  pointer-events: all;
}

/* Panel Toggle Button */
.panel-toggle-button {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-size: 24px;
  color: white;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.panel-toggle-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.panel-toggle-button:active {
  transform: scale(0.95);
}

/* Toggle icons */
.toggle-icon {
  position: absolute;
  transition: all 0.3s ease;
}

.toggle-icon.close {
  opacity: 0;
  transform: rotate(90deg);
}

/* When panel is open */
#controlPanel:not(.collapsed) ~ .panel-toggle-button .toggle-icon.open {
  opacity: 0;
  transform: rotate(-90deg);
}

#controlPanel:not(.collapsed) ~ .panel-toggle-button .toggle-icon.close {
  opacity: 1;
  transform: rotate(0deg);
}

/* All control buttons have consistent styling */
#controlPanel .control-button {
  position: relative;
  left: auto;
  bottom: auto;
  margin: 0;
  /* Ensure all buttons have exact same dimensions */
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  max-width: 50px;
  max-height: 50px;
  padding: 12px 16px;
  box-sizing: border-box;
}

/* Info button gets special color ONLY (no size/position changes) */
#infoToggle {
  background: rgba(52, 152, 219, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.2);
  /* Remove any inherited positioning */
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
}

#infoToggle:hover {
  background: rgba(52, 152, 219, 1);
}

/* ===================================
   IMAGE GALLERY STYLES
   =================================== */
.gallery-content {
  max-width: 800px;
  max-height: 85vh;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.gallery-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  aspect-ratio: 4/3;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
  transform: translateY(0);
}

/* Gallery Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
}

.lightbox.show {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100000;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: #ccc;
}

#lightboxImage {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-caption {
  position: absolute;
  bottom: 30px;
  color: white;
  font-size: 18px;
  text-align: center;
  width: 100%;
  padding: 0 20px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  padding: 20px 15px;
  font-size: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 5px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}

/* ===================================
   CONTACT FORM STYLES
   =================================== */
.contact-content {
  max-width: 600px;
}

#contactForm {
  margin-top: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 600;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.submit-btn:hover {
  background: linear-gradient(135deg, #2980b9, #21618c);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

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

.form-status {
  margin-top: 15px;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  display: none;
}

.form-status.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.form-status.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

/* ===================================
   SOCIAL SHARE STYLES
   =================================== */
.share-content {
  max-width: 500px;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.share-btn svg {
  width: 20px;
  height: 20px;
}

.share-btn.facebook {
  background: #1877f2;
}

.share-btn.facebook:hover {
  background: #1565c0;
}

.share-btn.twitter {
  background: #1da1f2;
}

.share-btn.twitter:hover {
  background: #0d8bd9;
}

.share-btn.whatsapp {
  background: #25d366;
}

.share-btn.whatsapp:hover {
  background: #1fb855;
}

.share-btn.linkedin {
  background: #0077b5;
}

.share-btn.linkedin:hover {
  background: #005885;
}

.share-btn.email {
  background: #ea4335;
}

.share-btn.email:hover {
  background: #d33426;
}

.share-btn.copy {
  background: #6c757d;
}

.share-btn.copy:hover {
  background: #5a6268;
}

.share-status {
  margin-top: 15px;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  display: none;
}

.share-status.show {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   MINI MAP STYLES
   =================================== */
.mini-map {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 280px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9998;
  display: none;
  overflow: hidden;
}

/* ===================================
   GOOGLE MAPS MODAL STYLES
   =================================== */
.maps-content {
  max-width: 500px;
  text-align: center;
}

.location-name {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
  margin: 10px 0 5px 0;
}

.location-address {
  font-size: 14px;
  color: #7f8c8d;
  margin-bottom: 25px;
}

.maps-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.maps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.maps-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.maps-btn svg {
  width: 24px;
  height: 24px;
}

.maps-btn.primary {
  background: linear-gradient(135deg, #4285f4, #34a853);
  color: white;
}

.maps-btn.primary:hover {
  background: linear-gradient(135deg, #3367d6, #2d9145);
}

.maps-btn.secondary {
  background: linear-gradient(135deg, #fbbc04, #ea4335);
  color: white;
}

.maps-btn.secondary:hover {
  background: linear-gradient(135deg, #f9ab00, #d33426);
}

.maps-btn.tertiary {
  background: linear-gradient(135deg, #5f6368, #3c4043);
  color: white;
}

.maps-btn.tertiary:hover {
  background: linear-gradient(135deg, #4d5156, #2d3033);
}

.coordinates-display {
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 15px;
}

.coordinates-display small {
  color: #5f6368;
  font-size: 12px;
  font-family: monospace;
}

/* ===================================
   MINI MAP STYLES (Continued)
   =================================== */

.mini-map.show {
  display: block;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mini-map-header {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
}

.mini-map-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 0.2s ease;
}

.mini-map-close:hover {
  transform: scale(1.2);
}

.mini-map-content {
  padding: 15px;
}

.floor-plan {
  width: 100%;
  height: auto;
}

.room-area {
  cursor: pointer;
  transition: all 0.3s ease;
}

.room-area:hover {
  fill: #ffd700 !important;
  stroke-width: 2;
}

.room-area.current {
  fill: #90EE90 !important;
  stroke: #28a745;
  stroke-width: 2;
}

#currentLocationDot {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.3);
  }
}

/* ===================================
   MOBILE RESPONSIVE ADJUSTMENTS
   =================================== */
@media (max-width: 768px) {
  #controlPanel {
    left: 10px;
    bottom: 70px;
    gap: 10px;
  }

  .panel-toggle-button {
    left: 10px;
    bottom: 10px;
    width: 55px;
    height: 55px;
    font-size: 26px;
  }

  .control-button {
    width: 48px !important;
    height: 48px !important;
    font-size: 22px !important;
  }

  #pageHeader {
    top: 10px;
    padding: 10px 20px;
    max-width: calc(100% - 20px);
  }

  #pageTitle {
    font-size: 18px;
  }

  #pageSubtitle {
    font-size: 11px;
  }

  /* Logo stays in bottom-right corner on mobile */
  #logoOverlay {
    bottom: 10px;  /* Fixed to actual bottom */
    right: 10px;
  }

  #logoOverlay img {
    width: 80px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .gallery-content,
  .contact-content,
  .share-content,
  .maps-content {
    max-width: 95%;
    padding: 20px 15px;
  }

  .mini-map {
    width: calc(100% - 20px);
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 480px) {
  #controlPanel {
    gap: 8px;
    bottom: 65px;
  }

  .panel-toggle-button {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .control-button {
    width: 45px !important;
    height: 45px !important;
    font-size: 20px !important;
    padding: 10px !important;
  }

  #pageHeader {
    padding: 8px 15px;
  }

  #pageTitle {
    font-size: 16px;
  }

  #pageSubtitle {
    font-size: 10px;
  }

  /* Logo stays in bottom-right corner on small phones */
  #logoOverlay {
    bottom: 10px;  /* Fixed to actual bottom */
    right: 10px;
  }

  #logoOverlay img {
    width: 60px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .share-buttons {
    grid-template-columns: 1fr;
  }
}

/* Landscape mobile optimization */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  #pageHeader {
    top: 5px;
    padding: 6px 15px;
  }

  #pageTitle {
    font-size: 14px;
  }

  #pageSubtitle {
    font-size: 9px;
  }

  #controlPanel {
    bottom: 10px;
    gap: 6px;
  }

  .panel-toggle-button {
    bottom: 10px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .control-button {
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
  }

  /* Logo stays in bottom-right corner on landscape */
  #logoOverlay {
    bottom: 10px;  /* Fixed to actual bottom */
    right: 10px;
  }

  #logoOverlay img {
    width: 50px;
  }
}

/* ===================================
   DARK MODE COMPATIBILITY (Optional)
   =================================== */
@media (prefers-color-scheme: dark) {
  .modal-content {
    background-color: #2c2c2c;
    color: #e0e0e0;
  }

  .modal-content h2 {
    color: #ffffff;
  }

  .modal-content p,
  .modal-content li {
    color: #d0d0d0;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    background-color: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
  }

  .form-group label {
    color: #e0e0e0;
  }

  .close-button {
    color: #aaa;
  }

  .close-button:hover {
    color: #fff;
  }
}
