/**
 * Global Counts CSS - Compact List Layout
 * Tight spacing, Nunito font, minimal design
 */

/* Import Nunito font */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700&display=swap');

/* Container */
.global-counts-container {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Tile Layout Specific */
.global-counts-tiles {
    background: transparent;
    border-radius: 0;
    padding: 0;
}

/* Section Container */
.global-counts-section {
    margin-bottom: 25px;
}

.global-counts-section:last-child {
    margin-bottom: 0;
}

/* Section Header */
.section-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    font-family: 'Nunito', sans-serif;
    letter-spacing: -0.5px;
}

.section-count {
    font-size: 20px;
    color: #6c757d;
    font-weight: 400;
    margin-left: 5px;
}

/* Location Grid - 2 Column Layout */
.location-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px 12px; /* Minimal vertical gap, small horizontal gap */
    margin: 0;
}

/* Location Tile - Compact list style */
.location-tile {
    display: block;
    background: #f8f9fa;
    border: none;
    border-radius: 4px;
    padding: 8px 12px; /* Reduced padding */
    text-decoration: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Brand color on hover */
.location-tile:hover {
    background: #0073aa;
    transform: none; /* No lift effect */
    box-shadow: none; /* No shadow */
}

.location-tile:hover .location-name,
.location-tile:hover .location-count {
    color: #ffffff;
}

/* Tile Content */
.tile-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Location Name */
.location-name {
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    transition: color 0.2s ease;
    flex: 1;
    font-family: 'Nunito', sans-serif;
    line-height: 1.2;
}

/* Location Count - Hidden by default */
.location-count {
    font-size: 14px;
    color: #6c757d;
    font-weight: 600;
    padding: 0 0 0 8px;
    transition: all 0.2s ease;
    font-family: 'Nunito', sans-serif;
}

/* Hide counts by default */
.global-counts-container:not(.show-counts) .location-count {
    display: none;
}

/* Show counts when explicitly enabled */
.global-counts-container.show-counts .location-count {
    display: inline-block;
}

.location-tile:hover .location-count {
    color: rgba(255, 255, 255, 0.9);
}

/* Disabled tiles (0 properties) */
.location-tile.no-properties {
    opacity: 0.5;
    cursor: not-allowed;
}

.location-tile.no-properties:hover {
    background: #f8f9fa;
    color: #333333;
}

.location-tile.no-properties:hover .location-name {
    color: #333333;
}

/* Dropdown Menu Specific Styles */
.dropdown-menu .global-counts-tiles {
    padding: 12px;
    min-width: 450px;
}

.dropdown-menu .section-header {
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.dropdown-menu .section-title {
    font-size: 18px;
    font-weight: 600;
}

.dropdown-menu .location-tile {
    padding: 6px 10px;
}

.dropdown-menu .location-name {
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .location-grid {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .location-tile {
        padding: 10px 14px;
    }
    
    .location-name {
        font-size: 15px;
    }
    
    .dropdown-menu .global-counts-tiles {
        min-width: 100%;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .global-counts-tiles {
        padding: 0;
    }
    
    .section-header {
        margin-bottom: 8px;
    }
    
    .location-grid {
        gap: 2px;
    }
    
    .location-tile {
        padding: 8px 12px;
    }
}

/* Single Column Layout Option */
.global-counts-container.columns-1 .location-grid {
    grid-template-columns: 1fr;
    gap: 2px;
}

/* Three Column Layout Option */
.global-counts-container.columns-3 .location-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3px 10px;
}

@media (max-width: 768px) {
    .global-counts-container.columns-3 .location-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .global-counts-container.columns-3 .location-grid {
        grid-template-columns: 1fr;
    }
}

/* Custom brand colors */
.global-counts-container[data-brand-color="blue"] .location-tile:hover {
    background: #0073aa;
}

.global-counts-container[data-brand-color="green"] .location-tile:hover {
    background: #46b450;
}

.global-counts-container[data-brand-color="purple"] .location-tile:hover {
    background: #826eb4;
}

.global-counts-container[data-brand-color="orange"] .location-tile:hover {
    background: #ff6900;
}

/* Focus states for accessibility */
.location-tile:focus {
    outline: 2px solid #0073aa;
    outline-offset: 1px;
}

.location-tile:focus:not(:focus-visible) {
    outline: none;
}

/* Remove animations for cleaner look */
.global-counts-section {
    animation: none;
}

.location-tile {
    animation: none;
}

/* Loading state */
.global-counts-container.loading {
    position: relative;
    min-height: 200px;
}

.global-counts-container.loading::after {
    content: "Loading properties...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #6c757d;
    background: white;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Print Styles */
@media print {
    .global-counts-tiles {
        background: white;
        padding: 0;
    }
    
    .location-tile {
        break-inside: avoid;
        background: white;
        border: 1px solid #dee2e6;
        padding: 4px 8px;
    }
    
    .location-tile:hover {
        background: white;
    }
}