/*
 * HelloLawyer - Judicial Job Board
 * Clean, Professional Design System
 * Light theme with professional dark blue accent
 */

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

:root {
  /* Design tokens */
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  /* Brand colors - Professional Dark Blue */
  --brand-primary: #1e3a5f;
  --brand-primary-hover: #162d4d;
  --brand-primary-light: #2d5a8a;
  --brand-dark: #0f172a;
  
  /* Legacy alias for gradual migration */
  --brand-orange: #1e3a5f;
  --brand-orange-hover: #162d4d;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* Light theme */
[data-theme="hellolaw"],
:root {
  --color-base-100: #ffffff;
  --color-base-200: #f8fafc;
  --color-base-300: #e2e8f0;
  --color-base-content: #0f172a;

  --color-primary: #1e3a5f;
  --color-primary-content: #ffffff;

  --color-secondary: #0f172a;
  --color-secondary-content: #ffffff;

  --color-accent: #1e3a5f;
  --color-accent-content: #ffffff;

  --color-neutral: #0f172a;
  --color-neutral-content: #ffffff;

  --color-info: #3b82f6;
  --color-info-content: #ffffff;

  --color-success: #22c55e;
  --color-success-content: #ffffff;

  --color-warning: #f59e0b;
  --color-warning-content: #0f172a;

  --color-error: #ef4444;
  --color-error-content: #ffffff;

  color-scheme: light;
}

/* Typography */
body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #ffffff;
  color: #1d1d1b;
}

/* Ensure short pages (e.g. /login) keep footer at the bottom */
body.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.login-page main {
  flex: 1 0 auto;
}

body.login-page footer {
  margin-top: auto;
}

/* Internships page styles must be global for hx-boost navigation */
:root {
  --apple-gray-50: #fafafa;
  --apple-gray-100: #f5f5f7;
  --apple-gray-200: #e8e8ed;
  --apple-gray-400: #86868b;
  --apple-gray-500: #6e6e73;
  --apple-gray-600: #424245;
  --apple-gray-900: #1d1d1f;
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
}

.internships-page {
  font-feature-settings: "kern" 1, "liga" 1;
  letter-spacing: -0.01em;
}

.apple-title {
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--apple-gray-900);
}

.apple-subtitle {
  font-weight: 400;
  color: var(--apple-gray-500);
  line-height: 1.5;
}

.internship-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--apple-gray-200);
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.internship-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  border-color: transparent;
}

.apple-link {
  color: var(--apple-blue);
  transition: opacity 0.2s ease;
}

.apple-link:hover {
  opacity: 0.8;
}

.apple-btn-primary {
  background: var(--apple-gray-900);
  color: #fff;
  border-radius: 980px;
  padding: 12px 24px;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
}

.apple-btn-primary:hover {
  background: var(--apple-gray-600);
}

.apple-btn-secondary {
  background: transparent;
  color: var(--apple-blue);
  border-radius: 980px;
  padding: 12px 24px;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: -0.01em;
  transition: opacity 0.2s ease;
}

.apple-btn-secondary:hover {
  opacity: 0.7;
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
  opacity: 0;
}

.fade-in-delay-1 {
  animation-delay: 0.1s;
}
.fade-in-delay-2 {
  animation-delay: 0.2s;
}
.fade-in-delay-3 {
  animation-delay: 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pagination-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--apple-gray-200);
  transition: all 0.2s ease;
}

.pagination-dot.active {
  background: var(--apple-gray-900);
  width: 24px;
  border-radius: 4px;
}

/* Logo styling */
.logo-mark {
  height: 32px;
  width: auto;
}

.logo-mark-lg {
  height: 48px;
  width: auto;
}

/* Navigation */
.nav-main {
  background: #ffffff;
  border-bottom: 1px solid #e9ecef;
}

/* Primary button */
.btn-brand {
  background-color: var(--brand-primary);
  color: #ffffff;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.btn-brand:hover {
  background-color: var(--brand-primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

/* Outline button */
.btn-brand-outline {
  background: transparent;
  color: var(--brand-primary);
  border: 2px solid var(--brand-primary);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.btn-brand-outline:hover {
  background-color: var(--brand-primary);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Dark button */
.btn-dark {
  background-color: var(--brand-dark);
  color: #ffffff;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.btn-dark:hover {
  background-color: #333;
  color: #ffffff;
}

/* Cards */
.card-clean {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-clean:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Vacancy card */
.vacancy-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all 0.2s ease;
}

.vacancy-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
}

/* Badge styling */
.badge-brand {
  background-color: rgba(30, 58, 95, 0.1);
  color: var(--brand-primary);
  border: none;
  font-weight: 500;
}

.badge-gray {
  background-color: #f3f4f6;
  color: #6b7280;
  border: none;
  font-weight: 500;
}

/* Status badges */
.status-draft {
  background-color: #f3f4f6;
  color: #6b7280;
}

.status-published {
  background-color: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.status-closed {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* Form inputs */
.input-clean {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-md);
  color: #0f172a;
  transition: all 0.2s ease;
}

.input-clean:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
  outline: none;
}

.input-clean::placeholder {
  color: #9ca3af;
}

/* Table styling */
.table-clean thead {
  background: #f8f9fa;
}

.table-clean thead th {
  color: #6b7280;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid #e9ecef;
}

.table-clean tbody tr {
  border-bottom: 1px solid #f3f4f6;
}

.table-clean tbody tr:hover {
  background-color: #f9fafb;
}

/* Stats */
.stat-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.stat-value {
  color: var(--brand-primary);
  font-size: 2.5rem;
  font-weight: 700;
}

.stat-label {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Sidebar */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: #6b7280;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  font-weight: 500;
}

.sidebar-item:hover {
  background: #f3f4f6;
  color: #1d1d1b;
}

.sidebar-item.active {
  background: rgba(30, 58, 95, 0.1);
  color: var(--brand-primary);
}

/* Link styling */
.link-brand {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-brand:hover {
  color: var(--brand-primary-hover);
  text-decoration: underline;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  color: #d1d5db;
}

/* Footer */
.footer-main {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

/* Section backgrounds */
.bg-gray {
  background-color: #f8f9fa;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Animations */
.fade-up {
  animation: fadeUp 0.5s ease-out forwards;
  opacity: 0;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}

/* Divider */
.divider-line {
  height: 1px;
  background: #e9ecef;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 1000;
}

/* Alert styling */
.alert-clean {
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.alert-success-clean {
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #16a34a;
}

.alert-error-clean {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

/* Hero section */
.hero-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* Print styles */
@media print {
  .nav-main,
  .btn,
  .toast-container {
    display: none;
  }
}

/* HTMX loading indicator */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: flex;
}

.htmx-request.htmx-indicator {
  display: flex;
}

/* Loading state for vacancy list */
#vacancies-list.htmx-request {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

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

/* Select styling */
select.input-clean {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Filter sidebar on mobile */
@media (max-width: 1023px) {
  #filters-sidebar {
    margin-bottom: 1.5rem;
  }
}

/* ==========================================
    Enhanced Filter Styles
    ========================================== */

/* Filter bar sticky shadow */
.filter-bar-shadow {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05);
}

/* Filter input focus glow */
.filter-input:focus {
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* Filter select custom styling */
.filter-select {
  background-image: none;
}

/* Quick filter chips */
.quick-filter-chip {
  backdrop-filter: blur(4px);
}

.quick-filter-chip:hover:not(.bg-brand-primary) {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quick-filter-chip.bg-brand-primary {
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.25);
}

/* Active filter pills animation */
.active-filter-pill {
  transition: all 0.2s ease;
}

.active-filter-pill:hover {
  transform: translateY(-1px);
}

/* Mobile filter panel */
#mobile-filters {
  max-height: 500px;
  overflow: hidden;
}

/* Filter select mobile */
.filter-select-mobile {
  font-size: 14px;
}

/* Results grid loading state */
#vacancies-list.htmx-request > * {
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

/* Vacancy card enhanced hover */
.vacancy-card-enhanced {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vacancy-card-enhanced:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(30, 58, 95, 0.15);
}

/* Tag pills */
.tag-pill {
  transition: all 0.15s ease;
}

.tag-pill:hover {
  transform: scale(1.02);
}

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

/* Filter animation keyframes */
@keyframes filterPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.filter-updating {
  animation: filterPulse 0.5s ease-in-out;
}

/* Empty state animation */
@keyframes emptyBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.empty-state-icon {
  animation: emptyBounce 2s ease-in-out infinite;
}

/* Filter bar glass effect */
.filter-bar-glass {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Results count badge pulse */
@keyframes countPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.count-updated {
  animation: countPulse 0.3s ease-out;
}

/* Pagination hover effects */
.pagination-btn {
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Active page number */
.pagination-active {
  background: linear-gradient(135deg, #1e3a5f 0%, #162d4d 100%);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

/* Search input icon animation */
.search-icon-animated {
  transition: transform 0.2s ease;
}

.filter-input:focus + .search-icon-animated,
.filter-input:not(:placeholder-shown) + .search-icon-animated {
  transform: translateY(-50%) scale(1.1);
  color: var(--brand-primary);
}

/* Filter dropdown arrow rotation */
.filter-select-arrow {
  transition: transform 0.2s ease;
}

.filter-select:focus ~ .filter-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Responsive adjustments for filter bar */
@media (max-width: 640px) {
  .filter-bar-glass {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .quick-filter-chip {
    font-size: 11px;
    padding: 6px 10px;
  }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
  /* Placeholder for dark mode filter styles */
}
