/* =============================================================================
   Port Finder — Component Styles
   Converted from Tailwind utility classes
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. Layout & Wrapper
   ----------------------------------------------------------------------------- */

[x-cloak] {
    display: none !important;
}
:root {
    --color-primary: #154376;
}
.port-finder {
    width: 100%;
    box-sizing: border-box;
}

.port-finder *,
.port-finder *::before,
.port-finder *::after {
    box-sizing: border-box;
}

/* -----------------------------------------------------------------------------
   2. Header Section
   ----------------------------------------------------------------------------- */

.pf-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem; /* gap-4 */
    margin-bottom: 1rem; /* mb-4 */
}

.pf-title {
    font-size: 1.875rem; /* text-3xl */
    font-weight: 600; /* font-semibold */
    color: var(--pf-color-primary, #154376);
}

/* -----------------------------------------------------------------------------
   3. Search Bar Row
   ----------------------------------------------------------------------------- */

.pf-controls-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* gap-2 */
    width: 100%;
}

@media (min-width: 768px) {
    /* md:flex-row */
    .pf-controls-row {
        flex-direction: row;
    }
}

/* Search input group */
.pf-input-group {
    display: flex;
    align-items: center;
    flex: 1;
    min-height: 3rem; /* min-h-12 */
    border: 1px solid var(--pf-color-primary, #154376);
    padding: 0.5rem; /* p-2 */
    border-radius: 1rem;
    background: #fff;
}

.pf-input-group input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.5rem;
    color: inherit;
}

.pf-input-icon {
    display: flex;
    align-items: center;
    padding: 0 0.375rem;
    color: #6b7280;
}

.pf-result-count {
    white-space: nowrap;
    font-size: 1.5rem;
    color: #6b7280;
    padding-left: 0.5rem;
}

/* Country select */
.pf-select {
    min-height: 3rem; /* min-h-12 */
    width: 100%; /* w-full */
    border: 1px solid #d1d5db;
    border-radius: 1rem;
    color: #fff;
    padding: 0 0.75rem;
    font-size: 1.5rem;
    background: var(--color-primary, #154376);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

@media (min-width: 768px) {
    /* md:w-[220px] */
    .pf-select {
        width: 220px;
        flex-shrink: 0;
    }
}

/* -----------------------------------------------------------------------------
   4. Map Section
   ----------------------------------------------------------------------------- */

.pf-map-section {
    display: flex;
    flex-direction: column;
}

.pf-map-container {
    z-index: 50;
    /* slide transition */
    overflow: hidden;
    transition:
        max-height 0.3s ease,
        opacity 0.3s ease;
}

.pf-map-container[hidden] {
    display: none;
}

#port-map {
    height: 400px;
    width: 100%;
    z-index: 1;
}

/* Map toggle button */
.pf-map-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    background-color: #bfdbfe; /* bg-blue-200 */
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    color: #1e3a5f;
    transition: background-color 0.15s ease;
    width: 100%;
}

.pf-map-toggle:hover {
    background-color: #93c5fd; /* slightly darker on hover */
}

/* When map is visible, button sits visually on top of map edge */
.pf-map-toggle--visible {
    position: relative;
    z-index: 99;
    transform: translateY(-50%);
    margin-bottom: -1.25rem; /* compensate for the translateY */
}

/* -----------------------------------------------------------------------------
   5. Port List
   ----------------------------------------------------------------------------- */

.pf-list-section {
    margin-top: 1rem;
}

.pf-country-group {
    margin-bottom: 1.5rem;
}

.pf-country-heading {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600;
    margin-top: 1rem; /* mt-4 */
    margin-bottom: 0.5rem;
    color: inherit;
}

.pf-port-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 1rem;
}

.pf-port-item:last-child {
    border-bottom: none;
}

/* -----------------------------------------------------------------------------
   6. Utility — visually hidden (for empty states etc.)
   ----------------------------------------------------------------------------- */

.pf-hidden {
    display: none !important;
}

/* -----------------------------------------------------------------------------
   7. Port Card
   ----------------------------------------------------------------------------- */

.pf-card {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 1.5rem;
    color: var(--pf-color-primary, #154376);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .pf-card {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

@media (min-width: 1280px) {
    .pf-card {
        grid-template-columns: repeat(9, 1fr);
    }
}

/* Identity */
.pf-card__identity {
    display: flex;
    flex-direction: column;
}
.pf-card__city {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}
.pf-card__country {
    font-size: 1.25rem;
    margin: 0;
}

/* Address */
.pf-card__address {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: inherit;
    text-decoration: none;
}

@media (min-width: 1280px) {
    .pf-card__address {
        grid-column: span 2;
    }
}

.pf-card__address:hover {
    text-decoration: underline;
}

/* Phones */
.pf-card__phones {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 1280px) {
    .pf-card__phones {
        grid-column: span 2;
    }
}

.pf-card__phone-list,
.pf-card__email-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Emails */
.pf-card__emails {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 1280px) {
    .pf-card__emails {
        grid-column: span 2;
    }
}

/* Shared link style */
.pf-card__link {
    color: inherit;
    text-decoration: none;
}
.pf-card__link:hover {
    text-decoration: underline;
}

/* Agents */
.pf-card__agents {
    margin: 0;
}

/* Actions */
.pf-card__actions {
    text-align: right;
}

.pf-card__details-btn {
    border: 1px solid currentColor;
    background: transparent;
    color: var(--pf-color-primary, #154376);
    padding: 0.375rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.pf-card__details-btn:hover {
    background-color: var(--pf-color-primary, #154376);
    color: #fff;
}
/* -----------------------------------------------------------------------------
   8. Leaflet Popup
   ----------------------------------------------------------------------------- */

.pf-popup {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 120px;
    padding: 0.25rem 0;
}

.pf-popup__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e3a5f;
}

.pf-popup__link {
    font-size: 1.5rem;
    color: var(--pf-color-primary, #1d4ed8);
    text-decoration: none;
    font-weight: 500;
}

.pf-popup__link:hover {
    text-decoration: underline;
}
