@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');
@import "tailwindcss";

@theme {
  --color-primary: #1E3A8A;
  --color-secondary: #2563EB;
  --color-bg-soft: #F8FAFC;
  --color-text-main: #1E293B;
  --font-family-sans: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

@layer base {
  html {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
  }
  body {
    color: var(--color-text-main);
    background-color: white;
    overflow-x: hidden;
    letter-spacing: -0.011em;
  }
}

@layer components {
  .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    min-height: 2.625rem;
    background-color: var(--color-secondary);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    text-decoration: none;
    cursor: pointer;
  }
  .btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  }

  .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    min-height: 2.625rem;
    background-color: white;
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border: 1.5px solid var(--color-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    cursor: pointer;
  }
  .btn-secondary:hover {
    background-color: var(--color-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
  }

  .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    min-height: 2.5rem;
    background-color: #dc2626;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: background-color 0.2s;
    text-decoration: none;
    cursor: pointer;
  }
  .btn-danger:hover { background-color: #b91c1c; }

  .card {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f1f5f9;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .card:hover { 
    box-shadow: 0 12px 24px -4px rgba(0,0,0,0.08), 0 4px 8px -2px rgba(0,0,0,0.04); 
    transform: translateY(-3px);
  }

  .card-admin {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
  }
  @media (min-width: 640px) {
    .card-admin {
      padding: 1.5rem;
    }
  }

  .section-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
  }
  @media (min-width: 640px) {
    .section-title { font-size: 1.625rem; }
  }
  @media (min-width: 768px) {
    .section-title { font-size: 1.875rem; }
  }

  .section-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
  }
  @media (min-width: 640px) {
    .section-subtitle { font-size: 1rem; }
  }

  .section-divider {
    width: 3.5rem;
    height: 0.25rem;
    background-color: var(--color-secondary);
    border-radius: 9999px;
    margin-bottom: 1.25rem;
  }

  .stat-card {
    background-color: white;
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f1f5f9;
    transition: all 0.3s;
  }
  @media (min-width: 640px) {
    .stat-card { padding: 1.5rem; }
  }
  .stat-card:hover { 
    box-shadow: 0 8px 20px rgba(0,0,0,0.08); 
    transform: translateY(-2px);
  }

  .stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.2;
    letter-spacing: -0.03em;
  }
  @media (min-width: 640px) { .stat-number { font-size: 2.25rem; } }
  @media (min-width: 768px) { .stat-number { font-size: 2.5rem; } }

  .stat-label {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 0.25rem;
  }
  @media (min-width: 640px) { .stat-label { font-size: 0.875rem; } }

  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    transition: color 0.2s;
    position: relative;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    white-space: nowrap;
  }
  .nav-link:hover { color: #bfdbfe; }
  .nav-link.active { color: #bfdbfe; }

  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #bfdbfe;
    border-radius: 0.75rem;
    transition: all 0.2s;
    text-decoration: none;
  }
  .sidebar-link:hover { background-color: #1d4ed8; color: white; }
  .sidebar-link.active { background-color: var(--color-secondary); color: white; box-shadow: 0 2px 4px rgba(0,0,0,0.12); }

  .badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
  }
  .badge-blue { background-color: #dbeafe; color: #1e40af; }
  .badge-green { background-color: #dcfce7; color: #166534; }
  .badge-red { background-color: #fee2e2; color: #991b1b; }
  .badge-gray { background-color: #f1f5f9; color: #374151; }

  .form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
  }
  .form-input, .form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    background-color: white;
  }
  .form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  }
  .form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    resize: vertical;
  }
  .form-textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  }
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Dropdown animation */
.dropdown-menu {
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Leaflet */
.leaflet-container {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
  border-radius: 1rem;
  z-index: 10 !important;
}
.leaflet-popup-content-wrapper {
  border-radius: 0.875rem !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
}

/* Line clamp */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
