/**
 * Custom Fonts - Apotek
 */

/* Apotek Comp Medium - Regular text */
@font-face {
    font-family: 'Apotek';
    src: url('/assets/fonts/Apotek_Comp_Medium.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Apotek Bold - Headings */
@font-face {
    font-family: 'Apotek';
    src: url('/assets/fonts/Apotek_Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Override the theme font variables */
:root,
[data-bs-theme=light],
[data-bs-theme=dark] {
    --si-font-sans-serif: 'Apotek', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --si-body-font-family: 'Apotek', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --si-body-font-size: 1.0625rem; /* 17px - increased from default 16px */
}

/* Headings use bold weight */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Apotek', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
}

/* Body text uses medium weight with increased size */
body {
    font-family: 'Apotek', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    font-size: 1.0625rem; /* 17px */
}

/* Ensure paragraphs and common text elements inherit the larger size */
p, span, a, li, td, th, label, .form-control, .btn {
    font-size: inherit;
}

/* Slightly larger for better readability in content areas */
.card-body, .modal-body, article, main {
    font-size: 1.0625rem;
}

/* Dropdown menu items - larger font size */
.dropdown-menu .dropdown-item {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

/* Navigation dropdown menus */
.navbar .dropdown-menu .dropdown-item {
    font-size: 1rem;
}

/* Filter form controls - consistent sizing and dark theme */
.filters-row .form-select,
.filters-row .form-control,
#location-filters .form-select {
    font-size: 1rem;
    background-color: #1a1d23;
    color: #e5e7eb;
    border-color: #374151;
}

.filters-row .form-select:focus,
.filters-row .form-control:focus,
#location-filters .form-select:focus {
    background-color: #1a1d23;
    color: #e5e7eb;
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Dark themed dropdown menus for filters */
.filters-row .dropdown-menu {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

.filters-row .dropdown-menu .form-check-label {
    color: #e5e7eb;
}

.filters-row .dropdown-menu .form-check-input {
    background-color: #374151;
    border-color: #4b5563;
}

.filters-row .dropdown-menu .form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* Native select dropdown styling - dark arrow for dark theme */
.filters-row .form-select,
#location-filters .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* Native select option styling (limited browser support) */
.filters-row .form-select option,
#location-filters .form-select option {
    background-color: #1f2937;
    color: #e5e7eb;
}

/* ============================================
   Leaflet Map Tooltips & Popups - Apotek Font
   ============================================ */

/* Leaflet tooltips */
.leaflet-tooltip {
    font-family: 'Apotek', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 0.875rem;
}

/* Leaflet popups */
.leaflet-popup-content-wrapper,
.leaflet-popup-content {
    font-family: 'Apotek', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Dark themed Leaflet tooltips */
.leaflet-tooltip-dark,
.dark-tooltip {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
    border: 1px solid #374151 !important;
    font-family: 'Apotek', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.leaflet-tooltip-dark::before,
.dark-tooltip::before {
    border-top-color: #1f2937 !important;
}

/* Dark themed Leaflet popups */
.leaflet-popup-content-wrapper.dark-popup,
.dark-popup .leaflet-popup-content-wrapper {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
    border: 1px solid #374151 !important;
}

.dark-popup .leaflet-popup-tip {
    background-color: #1f2937 !important;
}

/* Ensure all map container text uses Apotek */
.leaflet-container,
.leaflet-container * {
    font-family: 'Apotek', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}
