/* =====================================================
   TABELA WYNIKÓW WYSZUKIWANIA
   ===================================================== */
.library-search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    max-height: 500px;
    overflow: hidden;
    display: none;
}

.suggestions-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.suggestions-count {
    font-size: 14px;
    color: #666;
}

.suggestions-count strong {
    color: #2271b1;
    font-weight: 700;
}

/* Tabela */
.suggestions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.suggestions-table thead {
    background: #f0f4f8;
    position: sticky;
    top: 0;
    z-index: 10;
}

.suggestions-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.suggestions-table tbody {
    display: block;
    max-height: 400px;
    overflow-y: auto;
}

.suggestions-table thead,
.suggestions-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.suggestions-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
    cursor: pointer;
}

.suggestions-table tbody tr:hover {
    background: #f0f6fc;
}

.suggestions-table tbody tr:last-child {
    border-bottom: none;
}

.suggestions-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* Kolumny - szerokości */
.suggestions-table .col-logo {
    width: 70px;
    text-align: center;
}

.suggestions-table .col-name {
    width: 25%;
}

.suggestions-table .col-address {
    width: 25%;
}

.suggestions-table .col-city {
    width: 15%;
}

.suggestions-table .col-www {
    width: 10%;
    text-align: center;
}

.suggestions-table .col-action {
    width: 140px;
    text-align: center;
}

/* Logo */
.suggestion-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 6px;
    background: #f5f5f5;
}

.suggestion-logo-placeholder {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 6px;
    margin: 0 auto;
}

/* Nazwa */
.suggestion-name {
    display: block;
    font-weight: 600;
    color: #1e3a5f;
    text-decoration: none;
    line-height: 1.4;
}

.suggestion-name:hover {
    color: #2271b1;
    text-decoration: underline;
}

.suggestion-name strong {
    background: #fff3cd;
    padding: 1px 3px;
    border-radius: 3px;
}

/* Adres */
.suggestion-address {
    display: block;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Miasto */
.suggestion-city {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #2271b1;
    background: #e8f4fc;
    border-radius: 15px;
}

/* Link WWW */
.suggestion-www-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #2271b1;
    background: #f0f6fc;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.suggestion-www-link:hover {
    background: #2271b1;
    color: #fff;
}

.suggestion-no-www {
    color: #ccc;
}

/* Przycisk "Zobacz na mapie" */
.suggestion-map-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #2271b1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.suggestion-map-btn:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(34, 113, 177, 0.3);
}

.suggestion-map-btn svg {
    flex-shrink: 0;
}

/* Puste wyniki */
.suggestions-empty {
    padding: 40px 20px;
    text-align: center;
    color: #888;
    font-size: 15px;
}

/* =====================================================
   RESPONSYWNOŚĆ - TABELA SUGESTII
   ===================================================== */
@media (max-width: 1024px) {
    .suggestions-table .col-address {
        display: none;
    }
    
    .suggestions-table .col-name {
        width: 35%;
    }
    
    .suggestions-table .col-city {
        width: 20%;
    }
}

@media (max-width: 768px) {
    .library-search-suggestions {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 70vh;
        border-radius: 20px 20px 0 0;
        z-index: 99999;
    }
    
    .suggestions-header {
        padding: 12px 15px;
        border-radius: 20px 20px 0 0;
    }
    
    /* Ukryj nagłówki tabeli na mobile */
    .suggestions-table thead {
        display: none;
    }
    
    .suggestions-table,
    .suggestions-table tbody,
    .suggestions-table tbody tr,
    .suggestions-table tbody td {
        display: block;
        width: 100%;
    }
    
    .suggestions-table tbody {
        max-height: calc(70vh - 60px);
    }
    
    .suggestions-table tbody tr {
        padding: 15px;
        border-bottom: 1px solid #eee;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }
    
    .suggestions-table td {
        padding: 0;
    }
    
    .suggestions-table .col-logo {
        width: 50px;
        flex-shrink: 0;
    }
    
    .suggestions-table .col-name {
        flex: 1;
        min-width: calc(100% - 70px);
    }
    
    .suggestions-table .col-address {
        display: none;
    }
    
    .suggestions-table .col-city {
        width: auto;
    }
    
    .suggestions-table .col-www {
        width: auto;
    }
    
    .suggestions-table .col-action {
        width: 100%;
        margin-top: 5px;
    }
    
    .suggestion-map-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .suggestions-table .col-www {
        display: none;
    }
    
    .suggestion-logo {
        width: 40px;
        height: 40px;
    }
    
    .suggestion-logo-placeholder {
        width: 40px;
        height: 40px;
    }
}