/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Basic animations for demonstration */
@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in-left {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fade-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.animate-fade-in-down { animation: fade-in-down 1s ease-out forwards; }
.animate-fade-in { animation: fade-in 1s ease-out forwards; }
.animate-fade-in-left { animation: fade-in-left 1s ease-out forwards; }
.animate-fade-in-right { animation: fade-in-right 1s ease-out forwards; }
.animate-pulse-text { animation: pulse-text 2s infinite ease-in-out; }

[data-controller="card-hover"] {
  transition: transform 0.3s ease, filter 0.3s ease;
  transform-style: preserve-3d;
}

[data-controller="card-hover"].is-hovering {
  transform: scale(1.05) rotateX(var(--rotate-x, 0)) rotateY(var(--rotate-y, 0));
  filter: drop-shadow(0 30px 20px rgba(0,0,0,0.3));
}

[data-controller="liquid-card-hover"] {
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Default subtle shadow */
  --light-x: 50%;
  --light-y: 50%;
  backdrop-filter: blur(10px) brightness(100%);
  -webkit-backdrop-filter: blur(10px) brightness(100%);
}

[data-controller="liquid-card-hover"].is-hovering {
  /* transform: scale(1.05) rotateX(var(--rotate-x, 0)) rotateY(var(--rotate-y, 0)); // Scale is now controlled by JS */
  transform: rotateX(var(--rotate-x, 0)) rotateY(var(--rotate-y, 0));
}

/* Carousel styles */
.carousel-container {
  perspective: 1000px;
  width: 520px;
  height: 440px;
  position: relative;
  margin: 0 auto;
}

.carousel {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  transition: transform 0.5s;
}

.carousel-cell {
  position: absolute;
  width: 500px;
  height: 400px;
  left: 10px;
  top: 20px;
  border-radius: 2rem;
  font-size: 30px;
  font-weight: bold;
  color: white;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.list-card-style {
  background-color: rgba(255, 223, 127, 0.4);
}

.note-card-style {
  background-color: rgba(59, 130, 246, 0.4);
}

.task-card-style {
  background-color: rgba(34, 197, 94, 0.4);
}

.liquid-glass-button {
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #333;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.liquid-glass-list-item {
  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #333;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.liquid-glass-list-item:hover {
  transform: scale(1.0) translateZ(5px);
}

.liquid-glass-input, .liquid-glass-select {
  background-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #333;
  transition: all 0.2s ease-in-out; /* Add transition for all properties */
}

.liquid-glass-input:focus, .liquid-glass-select:focus {
  transform: scale(1.005);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.5),
              0 8px 15px rgba(0, 0, 0, 0.2);
}


.liquid-glass-button:hover {
  transform: scale(1.1) translateZ(10px);
}

/* Editor Display/Input Transitions */
.note-editor-display, .note-editor-input {
  transition: opacity 0.5s ease, visibility 0.5s ease; /* Increased duration */
  position: absolute; /* To prevent layout shifts */
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.note-editor-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 768px) {
  .carousel-container {
    width: 320px;
    height: 240px;
  }

  .carousel-cell {
    width: 300px;
    height: 200px;
    font-size: 24px;
  }
}

.sortable-ghost {
  opacity: 0.4;
  background-color: #f0f0f0;
}

/* Email content scaling */
.email-wrapper {
  overflow: hidden;
  position: relative;
  touch-action: pan-x pan-y pinch-zoom;
}

.email-wrapper .email-content {
  transform-origin: top left;
}

.email-wrapper .email-content img {
  max-width: 100%;
  height: auto;
}

.email-wrapper .email-content table {
  max-width: 100%;
}

/* ===== Map Styles - Apple Maps Inspired ===== */

/* Full-size map container */
.map-container-full {
  height: 320px;
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Compact map widget */
.map-container-compact {
  height: 120px;
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.map-container-compact:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Glassmorphic wrapper */
/* .map-glass-wrapper {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 1rem;
  padding: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
} */

/* Custom marker styles */
.custom-marker {
  background: transparent;
  border: none;
}

.marker-pin {
  width: 30px;
  height: 42px;
  position: relative;
  animation: marker-drop 0.6s ease-out forwards;
}

.marker-pin::before {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  top: 0;
  left: 0;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.marker-inner {
  position: absolute;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  top: 9px;
  left: 9px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

@keyframes marker-drop {
  0% {
    transform: translateY(-50px);
    opacity: 0;
  }
  60% {
    transform: translateY(5px);
    opacity: 1;
  }
  80% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Glassmorphic popup */
.glassmorphic-popup .leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 0;
}

.glassmorphic-popup .leaflet-popup-content {
  margin: 0;
  padding: 12px 16px;
}

.glassmorphic-popup .leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: none;
}

.custom-popup .popup-title {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 4px;
}

.custom-popup .popup-coords {
  font-size: 12px;
  color: #6b7280;
  font-family: ui-monospace, monospace;
}

/* Leaflet control overrides */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  border-radius: 10px !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #374151 !important;
  border: none !important;
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 18px !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(255, 255, 255, 1) !important;
  color: #111827 !important;
}

.leaflet-control-zoom-in {
  border-radius: 10px 10px 0 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.leaflet-control-zoom-out {
  border-radius: 0 0 10px 10px !important;
}

/* Subtle attribution */
.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 10px !important;
  padding: 2px 6px !important;
  border-radius: 4px 0 0 0;
}

.leaflet-control-attribution a {
  color: #6b7280 !important;
}

/* Map fallback state */
.map-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 120px;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-radius: inherit;
}
