/* Find Page Styles */

/* ==========================================
   1. HEADER & SUMMARY
   ========================================== */

.find-header {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3b5998;
}

.find-header h1 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.find-results-summary {
    color: #666;
    margin-top: 5px;
    font-size: 14px;
}

/* ==========================================
   2. FILTER CHIPS
   ========================================== */

.find-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px 0;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 14px;
    color: #495057;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    background-color: #dee2e6;
    border-color: #adb5bd;
}

.filter-chip .chip-label {
    margin-right: 5px;
    font-weight: 600;
}

.filter-chip .chip-value {
    margin-right: 8px;
}

.chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #adb5bd;
    color: white;
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s;
}

.chip-remove:hover {
    background-color: #dc3545;
    text-decoration: none;
    color: white;
}

/* Combined Layout */
.find-combined-layout {
    display: flex;
    flex-direction: column;
}

.find-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* ==========================================
   3. BOOTSTRAP UTILITY ALIASES
   These map Bootstrap class names to CSS
   so HTML in find.php renders correctly.
   ========================================== */

/* Flex alignment (Bootstrap naming) */
.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-center {
    justify-content: center !important;
}

.align-items-center {
    align-items: center !important;
}

.flex-direction-column {
    flex-direction: column !important;
}

/* Spacing - Bootstrap numeric scale */
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.mt-5 { margin-top: 48px !important; }

.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mb-5 { margin-bottom: 48px !important; }

.my-3 { margin-top: 16px !important; margin-bottom: 16px !important; }
.my-4 { margin-top: 24px !important; margin-bottom: 24px !important; }
.my-5 { margin-top: 48px !important; margin-bottom: 48px !important; }

.ms-2 { margin-left: 8px !important; }
.me-2 { margin-right: 8px !important; }

.p-2 { padding: 8px !important; }
.p-3 { padding: 16px !important; }
.p-4 { padding: 24px !important; }
.p-5 { padding: 48px !important; }

.gap-2 { gap: 8px !important; }
.gap-3 { gap: 16px !important; }

/* Bootstrap gutter classes (used in form rows) */
.g-2 { gap: 8px !important; }
.g-3 { gap: 16px !important; }

/* Background aliases */
.bg-light {
    background-color: #f8f9fa !important;
}

.bg-secondary {
    background-color: #6c757d !important;
}

/* Text aliases */
.text-dark {
    color: #343a40 !important;
}

.text-decoration-none {
    text-decoration: none !important;
}

/* Border aliases */
.border-start {
    border-left: 1px solid #dee2e6 !important;
}

/* Typography */
.lead {
    font-size: 1.15em;
    font-weight: 300;
    color: #555;
}

.display-4 {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1.2;
}

.small, small {
    font-size: 0.875em;
}

/* Height */
.h-100 {
    height: 100% !important;
}

/* ==========================================
   4. CONTAINER
   ========================================== */

.container {
    width: 100%;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 12px;
    padding-right: 12px;
}

.main-content {
    padding: 10px 0;
}

/* ==========================================
   5. BUTTONS
   ========================================== */

.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 6px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 4px;
    text-decoration: none;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
    color: #333;
}

.btn:hover {
    text-decoration: none;
}

.btn-sm {
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 3px;
}

.btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: #fff;
}

.btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
    background-color: transparent;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
    background-color: transparent;
}

.btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-dark {
    color: #343a40;
    border-color: #343a40;
    background-color: transparent;
}

.btn-outline-dark:hover {
    color: #fff;
    background-color: #343a40;
    border-color: #343a40;
}

.btn-outline-warning {
    color: #997404;
    border-color: #ffc107;
    background-color: transparent;
}

.btn-outline-warning:hover {
    color: #000;
    background-color: #ffc107;
    border-color: #ffc107;
}

/* ==========================================
   6. BADGES
   ========================================== */

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 4px;
}

/* ==========================================
   7. DROPDOWN (CSS-only, no Bootstrap JS)
   ========================================== */

.sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-dropdown .dropdown-toggle {
    cursor: pointer;
}

.sort-dropdown .dropdown-toggle::after {
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
    content: "";
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

.sort-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
    min-width: 160px;
    padding: 6px 0;
    margin: 2px 0 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    list-style: none;
}

.sort-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 6px 16px;
    clear: both;
    font-weight: 400;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.dropdown-item:hover {
    color: #1e2125;
    background-color: #f0f0f0;
    text-decoration: none;
}

.dropdown-item.active {
    color: #fff;
    background-color: #0d6efd;
}

/* ==========================================
   8. NAV TABS
   ========================================== */

.nav {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-item {
    margin-bottom: -1px;
}

.nav-link {
    display: block;
    padding: 8px 16px;
    color: #555;
    text-decoration: none;
    border: 1px solid transparent;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    font-size: 14px;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.nav-link:hover {
    color: #0d6efd;
    border-color: #e9ecef #e9ecef #dee2e6;
    text-decoration: none;
}

.nav-link.active {
    color: #0d6efd;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    font-weight: 600;
}

/* ==========================================
   9. GRID (Bootstrap-compatible)
   ========================================== */

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px;
    margin-right: -8px;
}

.row > * {
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
}

.col-auto {
    flex: 0 0 auto;
    width: auto;
}

.col-md-3 { flex: 0 0 auto; width: 25%; }
.col-md-4 { flex: 0 0 auto; width: 33.333%; }
.col-md-6 { flex: 0 0 auto; width: 50%; }
.col-md-auto { flex: 0 0 auto; width: auto; }

@media (max-width: 768px) {
    .col-md-3,
    .col-md-4,
    .col-md-6 {
        width: 100%;
    }
}

/* ==========================================
   10. ALERTS
   ========================================== */

.alert {
    position: relative;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

.alert h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: inherit;
}

.alert p {
    margin-bottom: 0;
}

/* ==========================================
   11. FORM CONTROLS
   ========================================== */

.form-control {
    display: block;
    width: 100%;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.form-control:focus {
    color: #333;
    background-color: #fff;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.form-select {
    display: block;
    width: 100%;
    padding: 6px 32px 6px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    appearance: none;
    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='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px 10px;
    box-sizing: border-box;
}

.form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.form-select-sm {
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 12px;
    border-radius: 3px;
}

/* ==========================================
   12. CARDS
   ========================================== */

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: box-shadow 0.2s;
}

.card-body {
    flex: 1 1 auto;
    padding: 16px;
}

.card-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.card-text {
    margin-top: 0;
    margin-bottom: 0;
}

/* ==========================================
   13. TABLES
   ========================================== */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    margin-bottom: 16px;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 8px 12px;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #333;
    background-color: #f8f9fa;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.03);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

/* ==========================================
   14. HOVER SHADOW
   ========================================== */

.hover-shadow {
    transition: box-shadow 0.2s ease;
}

.hover-shadow:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   15. CERTIFICATE & AWARD CARD EXTRAS
   ========================================== */

.award-card,
.cert-card {
    transition: transform 0.15s, box-shadow 0.15s;
}

.award-card:hover,
.cert-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.certificate-header {
    background-color: #f8f9fa;
}

.award-filters form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.pairing-form h4 {
    margin-top: 0;
}

/* ==========================================
   16. SORT CONTROLS (Pill Tabs)
   ========================================== */

.sort-controls {
    flex-shrink: 0;
}

.results-count {
    font-size: 13px;
}

/* Pill-style sort tabs (used across all filter modes) */
.cert-sort-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 95%;
    margin: 0 auto 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.cert-sort-tabs a {
    padding: 8px 16px;
    text-decoration: none;
    color: #666;
    border-radius: 20px;
    transition: all 0.2s;
    font-size: 0.9em;
}

.cert-sort-tabs a:hover {
    background-color: #f0f0f0;
    color: #333;
}

.cert-sort-tabs a.active {
    background-color: #333;
    color: white;
}

/* ==========================================
   17. RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .find-controls,
    .find-header .d-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .row {
        margin-left: -4px;
        margin-right: -4px;
    }

    .row > * {
        padding-left: 4px;
        padding-right: 4px;
    }

    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .nav-link {
        white-space: nowrap;
        font-size: 13px;
        padding: 6px 12px;
    }

    .award-filters form {
        flex-direction: column;
        align-items: stretch;
    }

    .col-auto,
    .col-md-auto {
        width: 100%;
    }

    .pairing-form .row {
        flex-direction: column;
    }

    .pairing-form .col-md-3,
    .pairing-form .col-md-auto {
        width: 100%;
        text-align: center;
    }

    .cert-sort-tabs {
        gap: 6px;
    }

    .cert-sort-tabs a {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}
