/* AfterWork Page Layout */
.afterwork-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.afterwork-header {
    text-align: center;
    padding: 1rem 0 2rem;
}

/* Store Finder Section */
.store-finder {
    padding: 1em;
    margin-bottom: 2em;
    transition: all 0.4s ease;
}

/* Initial centered state - before location is selected */
.store-finder:not(.location-selected) {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 700px;
    margin: 0 auto;
    padding: 3em 1em;
}

.store-finder:not(.location-selected) h2 {
    font-size: 1.8em;
    margin-bottom: 0.5em;
    text-align: center;
}

.location-subtitle {
    color: #666;
    text-align: center;
    margin-bottom: 2em;
    font-size: 1.05em;
    line-height: 1.6;
    max-width: 500px;
}

/* Hide subtitle after location is selected */
.store-finder.location-selected .location-subtitle {
    display: none;
}

.store-finder:not(.location-selected) .location-search {
    width: 100%;
    max-width: 600px;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5em;
}

.store-finder:not(.location-selected) .search-input-container {
    min-width: unset;
}

.store-finder:not(.location-selected) .address-input {
    font-size: 1.1em;
    padding: 1em 3.5em 1em 1.5em;
    box-shadow: 0 4px 12px rgba(0, 154, 61, 0.1);
}

.store-finder:not(.location-selected) .location-btn {
    font-size: 1.05em;
    padding: 1em 2em;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 154, 61, 0.2);
}

/* Hide store sections initially */
.store-sections {
    display: none;
    padding: 2rem 0;
    max-width: 1000px;
    margin: 0 auto;
}

.store-sections.visible {
    display: block;
}

.location-search {
    display: flex;
    gap: 1em;
    margin-bottom: 1em;
    flex-wrap: wrap;
    align-items: flex-start;
}

.search-input-container {
    flex: 1;
    min-width: 250px;
    position: relative;
    z-index: 1050;
}

.address-input {
    width: 100%;
    padding: 0.75em 3em 0.75em 1em;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.address-input:focus {
    outline: none;
    border-color: #009a3d;
}

.validation-icon {
    position: absolute;
    right: 1em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.validation-icon.valid {
    color: #009a3d;
}

.validation-icon.invalid {
    color: #d32f2f;
}

.validation-icon.loading {
    color: #666;
    font-size: 0.9em;
}

.validation-icon.multiple {
    color: #009a3d;
    font-size: 0.85em;
    pointer-events: auto;
    cursor: help;
}

.location-btn {
    padding: 0.75em 1.5em;
    background: #009a3d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    transition: background 0.3s;
}

.location-btn:hover {
    background: #007a2f;
}

.location-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Distance Filter Styles */
.distance-filter-container {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1em;
    margin-bottom: 1em;
}

.distance-filter-label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75em;
    font-size: 0.95em;
}

.distance-filter-label .ms-Icon {
    color: #009a3d;
    font-size: 1.1em;
}

.distance-filter-label span {
    color: #009a3d;
    font-weight: 700;
}

.distance-filter-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #009a3d 0%, #80cd90 100%);
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.distance-filter-slider:hover {
    opacity: 1;
}

.distance-filter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #009a3d;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 154, 61, 0.4);
    border: 3px solid white;
}

.distance-filter-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #009a3d;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 154, 61, 0.4);
    border: 3px solid white;
}

.distance-filter-slider::-webkit-slider-thumb:hover {
    background: #007a2f;
    box-shadow: 0 3px 8px rgba(0, 154, 61, 0.6);
}

.distance-filter-slider::-moz-range-thumb:hover {
    background: #007a2f;
    box-shadow: 0 3px 8px rgba(0, 154, 61, 0.6);
}

.distance-filter-marks {
    display: flex;
    position: relative;
    margin: 0.5em 0;
    font-size: 0.75em;
    color: #666;
    padding: 0 10px;
}

.distance-filter-marks span {
    position: absolute;
    transform: translateX(-50%);
}

.distance-filter-marks span:nth-child(1) {
    left: 0%;
    transform: translateX(0);
}

.distance-filter-marks span:nth-child(2) {
    left: 7.90%;
}

.distance-filter-marks span:nth-child(3) {
    left: 18%;
}

.distance-filter-marks span:nth-child(4) {
    left: 31.7%;
}

.distance-filter-marks span:nth-child(5) {
    left: 65.5%;
}

.distance-filter-marks span:nth-child(6) {
    left: 100%;
    transform: translateX(-100%);
}

.store-map {
    width: 100%;
    height: 350px;
    background: #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1em;
    display: none;
}

.store-map.visible {
    display: block;
}

.store-list {
    display: none;
    flex-direction: column;
    gap: 0.75em;
    overflow-y: auto;
    padding: 0 0.25rem;
}

.store-list.visible {
    display: flex;
}

/* Store section wrapper for expandable functionality */
.store-section {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.store-section-header {
    cursor: pointer;
    user-select: none;
}

.store-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s;
}

.store-item.has-events {
    background: #f0f9f4;
    border-color: #009a3d;
    border-left: 4px solid #009a3d;
}

.store-item.no-events {
    background: #f5f5f5;
    border-color: #e0e0e0;
    opacity: 0.75;
}

.store-section-header:hover .store-item.has-events {
    border-color: #007a2f;
    background: #e8f5ed;
    box-shadow: 0 2px 8px rgba(0, 154, 61, 0.15);
}

.store-section-header:hover .store-item.no-events {
    opacity: 1;
    background: #f9f9f9;
}

.store-section.highlighted .store-item {
    border-color: #009a3d;
    border-width: 2px;
    background: #e8f5ed;
}

.collapse-icon {
    display: inline-flex;
    align-items: center;
    font-size: 1em;
    transition: transform 0.3s ease;
    color: #009a3d;
    margin-right: 0.3em;
}

.store-section.expanded .collapse-icon {
    transform: rotate(90deg);
}

.store-info h3 {
    margin: 0 0 0.25em 0;
    color: #009a3d;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

.store-item.no-events .store-info h3 {
    color: #757575;
}

.event-badge,
.event-count-bubble {
    display: inline-block;
    padding: 0.2em 0.6em;
    background: #009a3d;
    color: white;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

.no-event-badge,
.event-count-bubble.no-events {
    display: inline-block;
    padding: 0.2em 0.6em;
    background: #9e9e9e;
    color: white;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

.store-info p {
    margin: 0.25em 0;
    color: #666;
    font-size: 0.9em;
}

.store-distance {
    display: inline-block;
    margin-top: 0.5em;
    padding: 0.25em 0.5em;
    background: #009a3d;
    color: white;
    border-radius: 4px;
    font-size: 0.8em;
}

.store-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 1em;
    background: #fff;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.store-section.expanded .store-section-content {
    max-height: 1000px;
    padding: 1em;
}

.store-link {
    color: #009a3d;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.store-link:hover {
    text-decoration: underline;
}

.store-link-disabled {
    color: #9e9e9e;
    font-size: 0.9em;
    font-style: italic;
    white-space: nowrap;
}

/* Address Dropdown Styles */
.address-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #009a3d;
    border-top: 1px solid #ccc;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1100;
    margin-top: 0;
}

.address-dropdown-item {
    padding: 0.75em 1em;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
    color: #333;
}

.address-dropdown-item:last-child {
    border-bottom: none;
}

.address-dropdown-item:hover,
.address-dropdown-item:focus {
    background: #e8f5ed;
    outline: none;
}

.address-dropdown-item:active {
    background: #d4ede0;
}

.no-events-message {
    color: #757575;
    font-style: italic;
    padding: 1em 0;
    text-align: center;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .event {
        margin-left: 0;
        margin-right: 0;
    }
    .afterwork-page {
        padding: 0 0.5rem;
    }

    .afterwork-header {
        padding: 0.5rem 0 1.5rem;
    }

    .store-finder {
        padding: 0.5em;
    }

    .store-finder:not(.location-selected) {
        padding: 2em 0.5em;
    }

    .store-sections {
        padding: 1.5rem 0;
    }

    .store-section {
        margin-bottom: 1rem;
    }

    .store-section-header {
        padding: 0;
    }

    .store-section-header h2 {
        font-size: 1.1rem;
    }

    .store-section.expanded .store-section-content {
        padding: 0;
    }

    .location-btn {
        width: 100%;
        justify-content: center;
    }
    
    .search-input-container {
        flex: 1 1 100%;
    }

    .store-list {
        padding: 0;
    }

    .distance-filter-container {
        padding: 0.75em;
    }

    .distance-filter-label {
        font-size: 0.9em;
    }

    .distance-filter-marks {
        font-size: 0.7em;
    }
}
