/* Additional CSS for Street Address Display and Sorting */

/* Street Address Display on Cards */
.directory-street-address {
    margin: 10px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 3px solid #28a745;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
}

.directory-street-address .dashicons {
    color: #28a745;
    margin-right: 8px;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.directory-street-address strong {
    color: #343a40;
    font-weight: 600;
}

/* Street Address in List View */
.directory-container.view-list .directory-street-address {
    margin: 8px 0;
    font-size: 13px;
}

/* AppPresser Mobile Styling */
.in-apppresser .directory-street-address {
    background: #e8f5e8;
    border-left-color: #20c997;
    font-size: 15px;
    padding: 10px 14px;
    margin: 12px 0;
}

.in-apppresser .directory-street-address .dashicons {
    color: #20c997;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Ionic Card Subtitle Styling for Street Address */
.in-apppresser ion-card-subtitle {
    color: #666 !important;
    font-size: 14px !important;
    margin-top: 4px !important;
    display: flex !important;
    align-items: center !important;
}

.in-apppresser ion-card-subtitle ion-icon {
    margin-right: 6px !important;
    font-size: 16px !important;
}

/* Enhanced Filter Form for Street Sorting */
.directory-filters {
    position: relative;
}

.directory-filters .filter-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
    display: block;
}

.directory-filters select[name="directory_sort"] {
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='m0,1 2,2 2,-2z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 32px;
}

/* Sort indicator for active street sorting */
.directory-container[data-sort^="street"] .directory-item {
    border-left: 3px solid #28a745;
}

.directory-container[data-sort="street_asc"] .directory-street-address::after {
    content: " ↑";
    color: #28a745;
    font-weight: bold;
    margin-left: 4px;
}

.directory-container[data-sort="street_desc"] .directory-street-address::after {
    content: " ↓";
    color: #28a745;
    font-weight: bold;
    margin-left: 4px;
}

/* Responsive Design for Street Display */
@media (max-width: 768px) {
    .directory-street-address {
        font-size: 13px;
        padding: 6px 10px;
        margin: 8px 0;
    }
    
    .directory-street-address .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
        margin-right: 6px;
    }
}

@media (max-width: 480px) {
    .directory-street-address {
        font-size: 12px;
        padding: 5px 8px;
        margin: 6px 0;
    }
    
    .directory-street-address .dashicons {
        font-size: 13px;
        width: 13px;
        height: 13px;
        margin-right: 5px;
    }
}

/* Garage Sale / Community Event Specific Styling */
.directory-type-garage-sale .directory-street-address,
.directory-type-community-event .directory-street-address {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.directory-type-garage-sale .directory-street-address .dashicons,
.directory-type-community-event .directory-street-address .dashicons {
    color: #ffc107;
}

.directory-type-garage-sale .directory-street-address strong,
.directory-type-community-event .directory-street-address strong {
    color: #856404;
}

/* Loading state for street sorting */
.directory-container.loading-street-sort {
    position: relative;
    opacity: 0.7;
}

.directory-container.loading-street-sort::after {
    content: "Sorting by street...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    color: #495057;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

/* Street sort success indicator */
.directory-filters.street-sorted {
    border-left: 4px solid #28a745;
    background: #f8fff8;
}

.directory-filters.street-sorted::before {
    content: "✓ Sorted by Street";
    display: block;
    color: #28a745;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 10px;
    padding: 4px 8px;
    background: #d4edda;
    border-radius: 4px;
    text-align: center;
}

/* Enhanced street address display for print (useful for garage sale maps) */
@media print {
    .directory-street-address {
        background: #fff !important;
        border: 1px solid #000 !important;
        color: #000 !important;
        font-weight: bold !important;
        page-break-inside: avoid;
    }
    
    .directory-street-address .dashicons {
        display: none;
    }
    
    .directory-item {
        page-break-inside: avoid;
        margin-bottom: 20px;
        border: 1px solid #ccc;
        padding: 10px;
    }
}

/* Highlight street names that match search */
.directory-street-address .highlight {
    background: yellow;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: bold;
}

/* Street directory specific enhancements */
.directory-street-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.directory-street-group {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.directory-street-header {
    background: #f8f9fa;
    padding: 12px 16px;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
}

.directory-street-header .dashicons {
    margin-right: 8px;
    color: #6c757d;
}

.directory-street-items {
    padding: 8px;
}

.directory-street-items .directory-item {
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.directory-street-items .directory-item:last-child {
    margin-bottom: 0;
}

/* Quick street navigation (for large lists) */
.directory-street-nav {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 10px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.directory-street-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.directory-street-nav-item {
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #495057;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.directory-street-nav-item:hover {
    background: #e9ecef;
    color: #343a40;
    text-decoration: none;
}

.directory-street-nav-item.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}
