/*
 * 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.
 *
 * NOTE: Propshaft doesn't support @import. Component stylesheets are loaded separately in the layout.
 */

/* ═══════════════════════════════════════════════════════════════ */
/* BEAUTIFUL HEADER STYLES - Professional, Clean, Modern */
/* ═══════════════════════════════════════════════════════════════ */

/* ========================================
   GEPESAT BRAND - CUSTOM ANIMATIONS
   ======================================== */

/* Slow Spin Animation for Auto-Refresh Icon */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Gradient Animation for Loading States */
@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animate-gradient {
  animation: gradient 3s ease infinite;
}

.animate-spin-slow {
  animation: spin-slow 3s linear infinite;
}

/* ========================================
   PRICING PAGE ANIMATIONS (Jan 2025)
   Beautiful, smooth, professional
   ======================================== */

/* Fade-in animations */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in {
  animation: fade-in 0.6s ease-out forwards;
}

.animate-fade-in-up {
  animation: fade-in-up 0.8s ease-out forwards;
}

.animate-fade-in-down {
  animation: fade-in-down 0.8s ease-out forwards;
}

.animate-slide-in-left {
  animation: slide-in-left 0.8s ease-out forwards;
}

.animate-slide-in-right {
  animation: slide-in-right 0.8s ease-out forwards;
}

.animate-scale-in {
  animation: scale-in 0.6s ease-out forwards;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Gradient text utility */
.gradient-text {
  background: linear-gradient(135deg, #FF7C1E 0%, #FFA500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   NAVIGATION - WORLD-CLASS PROFESSIONAL
   ======================================== */

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION LINKS - WORLD-CLASS PROFESSIONAL DESIGN
   ═══════════════════════════════════════════════════════════════

   Design Philosophy:
   - Minimalist & Clean (text-only, no icons)
   - Beautiful active states (orange gradient underline)
   - Smooth animations (cubic-bezier easing)
   - Perfect spacing (comfortable click targets)
   - Responsive (adapts to Spanish/English text lengths)
   ═══════════════════════════════════════════════════════════════ */

/* Base Navigation Link - Clean & Professional */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem; /* Increased padding for better click targets */
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
  color: #64748b; /* slate-500 - Subtle default state */
  border-radius: 0.5rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  letter-spacing: -0.01em;
  text-decoration: none;
  min-height: 2.5rem; /* 40px - Consistent height */
}

/* Hover State - Subtle & Elegant */
.nav-link:hover {
  color: #334155; /* slate-700 - Darker on hover */
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  transform: translateY(-1px); /* Subtle lift effect */
}

/* Active Navigation Link - Beautiful & Bold */
.nav-link-active {
  color: #1046B1; /* Brand blue - Strong contrast */
  font-weight: 600;
  background: transparent;
}

/* Active State Underline - Stunning Orange Gradient */
.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1.5rem); /* Slightly narrower for elegance */
  height: 3px;
  background: linear-gradient(90deg, #FF7C1E 0%, #E66A0F 100%);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 2px 8px rgba(255, 124, 30, 0.4); /* Stronger glow */
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slide-in animation for active underline */
@keyframes slideIn {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: calc(100% - 1.5rem);
    opacity: 1;
  }
}

/* Hover on Active Link - Brighten & Lift */
.nav-link-active:hover {
  color: #0d3a8f; /* Darker blue */
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  transform: translateY(-1px);
}

/* Focus State - Accessibility */
.nav-link:focus {
  outline: 2px solid #FF7C1E;
  outline-offset: 2px;
}

/* ========================================
   FILTER PILLS - Beautiful Filter UI
   ======================================== */

/* Filter Pill - Base Style */
.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 9999px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.filter-pill:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Filter Pill - Active State (Default Blue) */
.filter-pill-active {
  color: #ffffff;
  background: linear-gradient(135deg, #1046B1 0%, #071D4A 100%);
  border-color: #1046B1;
  box-shadow: 0 4px 12px rgba(16, 70, 177, 0.25);
}

/* Filter Pill - Green Variant */
.filter-pill-green {
  color: #065f46;
  background: #d1fae5;
  border-color: #6ee7b7;
}

.filter-pill-green:hover {
  background: #a7f3d0;
  border-color: #34d399;
}

.filter-pill-green.filter-pill-active {
  color: #ffffff;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border-color: #10B981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Filter Pill - Blue Variant */
.filter-pill-blue {
  color: #1e40af;
  background: #dbeafe;
  border-color: #93c5fd;
}

.filter-pill-blue:hover {
  background: #bfdbfe;
  border-color: #60a5fa;
}

.filter-pill-blue.filter-pill-active {
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* Filter Pill - Orange Variant */
.filter-pill-orange {
  color: #c2410c;
  background: #fed7aa;
  border-color: #fdba74;
}

.filter-pill-orange:hover {
  background: #fbbf24;
  border-color: #f59e0b;
}

.filter-pill-orange.filter-pill-active {
  color: #ffffff;
  background: linear-gradient(135deg, #FF7C1E 0%, #E66A0F 100%);
  border-color: #FF7C1E;
  box-shadow: 0 4px 12px rgba(255, 124, 30, 0.25);
}

/* Filter Tag - Smaller, Simpler Style for Secondary Filters */
.filter-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.filter-tag:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.filter-tag-active {
  color: #ffffff;
  background: #1046B1;
  border-color: #1046B1;
  font-weight: 600;
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  display: flex;
  height: 1.25rem;
  width: 1.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: #ef4444;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.notification-badge-ping {
  position: absolute;
  display: inline-flex;
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  background-color: #f87171;
  opacity: 0.75;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* User Dropdown - Beautiful Animations */
.dropdown-open {
  animation: dropdown-fade-in 0.2s ease-out;
}

@keyframes dropdown-fade-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile Menu - Animated Hamburger Icon */
[data-mobile-menu-target="hamburger"].open span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

[data-mobile-menu-target="hamburger"].open span:nth-child(2) {
  opacity: 0;
}

[data-mobile-menu-target="hamburger"].open span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Utility Classes - Buttons */
.btn-primary {
  @apply px-4 py-2 bg-[#FF7C1E] hover:bg-[#E66A0F] text-white font-semibold rounded-lg transition-colors duration-200;
}

.btn-secondary {
  @apply px-4 py-2 bg-white hover:bg-neutral-50 text-neutral-700 font-medium rounded-lg border border-neutral-300 transition-colors duration-200;
}

.btn-danger {
  @apply px-4 py-2 bg-red-600 hover:bg-red-700 text-white font-semibold rounded-lg transition-colors duration-200 shadow-sm hover:shadow-md;
}

/* Utility Classes - Inputs */
.input {
  @apply px-3 py-2 border border-neutral-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#FF7C1E] focus:border-transparent transition-all duration-200;
}

/* Utility Classes - Cards */
.card {
  @apply bg-white rounded-lg shadow-md p-4 sm:p-6;
}

/* Utility Classes - Text Truncation */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   ADMIN SIDEBAR COLLAPSE
   ======================================== */

/* MOBILE/TABLET/DESKTOP: Hide collapsed sidebar completely off-screen */
#admin-sidebar.sidebar-collapsed {
  transform: translateX(-100%) !important;
}

/* DESKTOP: Main content expands to full width when sidebar is collapsed */
@media (min-width: 1024px) {
  main.sidebar-collapsed {
    margin-left: 0 !important;
  }

  /* Floating toggle button - moves with sidebar */
  [data-admin-sidebar-target="toggleButton"] {
    left: 256px; /* Position at right edge of expanded sidebar */
  }

  /* When sidebar is collapsed, button stays at left edge */
  #admin-sidebar.sidebar-collapsed ~ [data-admin-sidebar-target="toggleButton"] {
    left: 0 !important;
  }

  /* Change icon direction based on state */
  /* Base icon: fa-angles-right (points right by default) */

  /* When sidebar is COLLAPSED: Icon points RIGHT (no rotation needed) */
  #admin-sidebar.sidebar-collapsed ~ [data-admin-sidebar-target="toggleButton"] i {
    transform: rotate(0deg); /* Keep fa-angles-right pointing right (to expand) */
  }

  /* When sidebar is EXPANDED: Icon points LEFT (rotate fa-angles-right 180deg) */
  #admin-sidebar:not(.sidebar-collapsed) ~ [data-admin-sidebar-target="toggleButton"] i {
    transform: rotate(180deg); /* Rotate to point left (to collapse) */
  }
}

/* ========================================
   STATISTICS TOGGLE - COLLAPSIBLE DESIGN
   ======================================== */

/* Hide Scrollbar (for horizontal scroll on mobile) */
.scrollbar-hide {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Chrome, Safari, Opera */
}

/* Fade In Animation for Statistics Toggle */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out;
}

/* ========================================
   LEAFLET MAP LAYER CONTROL - GEPESAT BRANDED
   ======================================== */

/* Layer Control Container */
.leaflet-control-layers {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: white;
  font-family: 'Montserrat', Arial, sans-serif;
  transition: all 0.3s ease;
  border: none !important;
}

.leaflet-control-layers:hover {
  box-shadow: 0 6px 16px rgba(255, 124, 30, 0.25);
}

/* Layer Control Toggle Button */
.leaflet-control-layers-toggle {
  width: 44px;
  height: 44px;
  background-color: #FF7C1E;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>');
  background-size: 26px 26px;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.leaflet-control-layers-toggle:hover {
  background-color: #E66A0F;
  transform: scale(1.05);
}

.leaflet-control-layers-toggle:active {
  transform: scale(0.95);
}

/* Layer Control Expanded State */
.leaflet-control-layers-expanded {
  padding: 16px;
  min-width: 200px;
}

.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
  display: none;
}

/* Layer Labels */
.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
  font-size: 14px;
  font-weight: 500;
  color: #071D4A;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  border-radius: 6px;
  margin: 4px 0;
  border: none !important;
  outline: none !important;
}

.leaflet-control-layers-base label:hover,
.leaflet-control-layers-overlays label:hover {
  background-color: rgba(255, 124, 30, 0.08);
  border: none !important;
  outline: none !important;
}

/* Selected state - beautiful orange background, NO BORDER */
.leaflet-control-layers-base label:has(input:checked),
.leaflet-control-layers-overlays label:has(input:checked) {
  background-color: rgba(255, 124, 30, 0.12);
  color: #FF7C1E;
  font-weight: 600;
  border: none !important;
  outline: none !important;
}

/* Force remove borders on label spans */
.leaflet-control-layers-base label span,
.leaflet-control-layers-overlays label span,
.leaflet-control-layers-base label > span,
.leaflet-control-layers-overlays label > span {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Override any Leaflet default borders */
.leaflet-control-layers label,
.leaflet-control-layers label *,
.leaflet-control-layers-base *,
.leaflet-control-layers-overlays * {
  border: none !important;
  outline: none !important;
}

/* Re-apply our custom radio/checkbox borders */
.leaflet-control-layers-selector {
  border: 2px solid #D1D5DB !important;
}

.leaflet-control-layers-selector:hover {
  border-color: #FF7C1E !important;
}

.leaflet-control-layers-selector:checked {
  border-color: #FF7C1E !important;
}

/* Hide default radio buttons and checkboxes */
.leaflet-control-layers-selector {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  margin-right: 10px;
  margin-top: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
  border: 2px solid #D1D5DB;
  background-color: white;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* Radio buttons - circular */
.leaflet-control-layers-base .leaflet-control-layers-selector {
  border-radius: 50%;
}

/* Checkboxes - rounded square */
.leaflet-control-layers-overlays .leaflet-control-layers-selector {
  border-radius: 4px;
}

/* Hover state */
.leaflet-control-layers-selector:hover {
  border-color: #FF7C1E;
  background-color: rgba(255, 124, 30, 0.05);
}

/* Checked state - beautiful orange */
.leaflet-control-layers-selector:checked {
  background-color: #FF7C1E;
  border-color: #FF7C1E;
  position: relative;
}

/* Radio button checked - inner circle */
.leaflet-control-layers-base .leaflet-control-layers-selector:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
}

/* Checkbox checked - checkmark */
.leaflet-control-layers-overlays .leaflet-control-layers-selector:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

/* Focus state - subtle orange glow */
.leaflet-control-layers-selector:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 124, 30, 0.2);
}

/* Remove focus outline on labels */
.leaflet-control-layers-base label:focus,
.leaflet-control-layers-overlays label:focus,
.leaflet-control-layers-base label:focus-within,
.leaflet-control-layers-overlays label:focus-within {
  outline: none;
}

/* Section Separator */
.leaflet-control-layers-separator {
  border-top: 2px solid #E5E7EB;
  margin: 12px 0;
  height: 0;
}

/* Zoom Control Styling */
.leaflet-control-zoom {
  border: 2px solid #FF7C1E !important;
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.leaflet-control-zoom a {
  background-color: white;
  color: #071D4A;
  font-weight: 600;
  transition: all 0.2s ease;
}

.leaflet-control-zoom a:hover {
  background-color: #FF7C1E;
  color: white;
}

.leaflet-control-zoom a:active {
  background-color: #E66A0F;
}

/* Attribution Control */
.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.leaflet-control-attribution a {
  color: #1046B1;
  text-decoration: none;
}

.leaflet-control-attribution a:hover {
  color: #FF7C1E;
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .leaflet-control-layers-toggle {
    width: 40px;
    height: 40px;
    background-size: 22px 22px;
  }

  .leaflet-control-layers-expanded {
    padding: 12px;
    min-width: 180px;
    max-width: 220px;
  }

  .leaflet-control-layers-base label,
  .leaflet-control-layers-overlays label {
    font-size: 13px;
    padding: 6px 4px;
  }

  .leaflet-control-layers-selector {
    width: 16px;
    height: 16px;
    margin-right: 8px;
  }
}
