/* Custom styles for sh4meful */

/* Header with black background */
.header-brand {
    background-color: #000;
    padding: 1rem 0;
    border-bottom: 2px solid #212529;
}

.brand-link {
    color: #fff !important;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.brand-link:hover {
    color: #f8f9fa !important;
    text-decoration: none;
}

.brand-link img {
    height: 40px;
    margin-right: 10px;
}

.brand-link strong {
    font-size: 1.25rem;
}

/* Sticky navigation menu */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.navbar .nav-link:hover {
    color: #fff !important;
}

/* Menu pipe separators */
.menu-separator {
    color: rgba(255, 255, 255, 0.4);
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    align-self: center;
    line-height: 1.5rem;
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.footer {
    margin-top: auto;
}

/* Table improvements */
/* Removed max-height to allow full page scrolling instead of scrolling within container */
/* .table-responsive {
    max-height: 70vh;
} */

.table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Badge improvements */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Card improvements */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

/* Stat cards */
.display-6 {
    font-weight: 600;
    color: #4D6267;
}

/* Override Bootstrap blue with theme color */
a {
    color: #4D6267;
}

a:hover {
    color: #3a4a4d;
}

.btn-primary {
    background-color: #4D6267;
    border-color: #4D6267;
}

.btn-primary:hover {
    background-color: #3a4a4d;
    border-color: #3a4a4d;
}

.badge.bg-secondary {
    background-color: #4D6267 !important;
}

/* Pagination styling - WCAG AA compliant colors */
.page-link {
    color: #212529; /* High contrast: 16.1:1 on white */
}

.page-link:hover {
    color: #000000;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    background-color: #212529; /* Darker for better contrast */
    border-color: #212529;
    color: #ffffff;
}

/* Accessibility: #6c757d provides 4.54:1 contrast on white (WCAG AA compliant) */
.page-item.disabled .page-link {
    color: #6c757d !important;
    background-color: #ffffff !important;
}

/* Improved contrast for text-muted - darker than Bootstrap default for better readability */
.text-muted {
    color: #5a6268 !important; /* 5.74:1 contrast ratio - improved WCAG AA compliance */
}

/* Better contrast for text-muted on light backgrounds (card-header, footer) */
.card-header .text-muted,
.bg-light .text-muted,
.card-header small.text-muted,
.bg-light small.text-muted {
    color: #495057 !important; /* 7:1 contrast ratio on #f8f9fa background - WCAG AAA */
}

/* Ensure small text in card headers has sufficient contrast */
.card-header small {
    color: #495057; /* Higher contrast for smaller text */
}

/* Better contrast for outline-secondary buttons in card headers */
.card-header .btn-outline-secondary {
    color: #212529; /* High contrast on light gray background */
    border-color: #6c757d;
}

.card-header .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #ffffff;
}

.card-header .btn-outline-secondary.active {
    background-color: #212529;
    border-color: #212529;
    color: #ffffff;
}

/* Geographic chart container */
.geo-chart-container {
    position: relative;
    height: 500px;
}

/* Responsive height for geo chart */
@media (max-width: 990px) and (min-width: 769px) {
    .geo-chart-container {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .geo-chart-container {
        height: 300px;
    }
}

/* Links */
a.text-decoration-none:hover {
    text-decoration: underline !important;
}

/* Code blocks */
code {
    background-color: #f8f9fa;
    padding: 0.2em 0.4em 0.2em 0;  /* top, right, bottom, left - no left padding */
    border-radius: 3px;
    font-size: 0.9em;
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
}

/* Prevent line breaks between names and their icons */
.no-break-icons {
    white-space: nowrap;
}

/* Responsive table text */
@media (max-width: 768px) {
    .table {
        font-size: 0.85rem;
    }

    .badge {
        font-size: 0.7rem;
    }

    /* Hide full country name on mobile, show only code */
    .country-name {
        display: none;
    }

    /* Hide city column on mobile */
    .city-column {
        display: none;
    }

    /* Hide count column on mobile */
    .count-column {
        display: none;
    }

    /* Hide rows per page selector on mobile */
    .rows-per-page-selector {
        display: none;
    }

    /* Hide menu pipe separators in mobile hamburger menu */
    .menu-separator {
        display: none;
    }

    /* Hide activity chart on mobile to save bandwidth and screen space */
    .activity-chart-container {
        display: none !important;
    }

    /* Center pagination on mobile */
    .pagination {
        justify-content: center !important;
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty state */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #6c757d;
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
}

/* Search form validation */
.navbar form.d-flex {
    position: relative;
}

.navbar .invalid-feedback {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #dc3545;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    width: 300px;
    max-width: 90vw;
    z-index: 1030;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
}

.navbar .form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.navbar .form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

@media (max-width: 768px) {
    .navbar .invalid-feedback {
        width: calc(100vw - 2rem);
        left: 0;
        right: auto;
    }
}
