/* Geolocation Manager UI Styles */

/* Location picker styles */
.location-picker {
    position: relative;
    width: 100%;
}

.location-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.location-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.location-input::placeholder {
    color: #94a3b8;
}

/* GPS button */
.gps-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: #64748b;
}

.gps-button:hover {
    background: #f1f5f9;
    color: #4CAF50;
}

.gps-button:active {
    transform: translateY(-50%) scale(0.95);
}

.gps-button.loading {
    animation: spin 1s linear infinite;
    color: #4CAF50;
}

/* GPS icon */
.gps-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Location status indicators */
.location-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
}

.location-status.success {
    color: #16a34a;
}

.location-status.error {
    color: #dc2626;
}

.location-status.loading {
    color: #2563eb;
}

.status-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Distance display */
.distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f0fdf4;
    color: #166534;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
}

.distance-badge.far {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.distance-badge.very-far {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Location suggestions dropdown */
.location-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background: #f8fafc;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-main {
    font-weight: 500;
    color: #1e293b;
}

.suggestion-secondary {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* Location permission prompt */
.location-permission-prompt {
    background: #f0f9ff;
    border: 1px solid #7dd3fc;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.permission-title {
    font-weight: 600;
    color: #0c4a6e;
    margin-bottom: 8px;
}

.permission-description {
    color: #0369a1;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.permission-actions {
    display: flex;
    gap: 12px;
}

.permission-button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.permission-button.primary {
    background: #2563eb;
    color: white;
}

.permission-button.primary:hover {
    background: #1d4ed8;
}

.permission-button.secondary {
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.permission-button.secondary:hover {
    background: #eff6ff;
}

/* Loading states */
.location-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 14px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive design */
@media (max-width: 768px) {
    .location-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .permission-actions {
        flex-direction: column;
    }
    
    .permission-button {
        width: 100%;
        justify-content: center;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .location-input {
        border-width: 3px;
    }
    
    .distance-badge {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .location-input,
    .gps-button,
    .suggestion-item,
    .permission-button {
        transition: none;
    }
    
    .loading-spinner,
    .gps-button.loading {
        animation: none;
    }
    
    .pulse {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .location-input {
        background: #1e293b;
        border-color: #374151;
        color: #f1f5f9;
    }
    
    .location-input::placeholder {
        color: #64748b;
    }
    
    .location-suggestions {
        background: #1e293b;
        border-color: #374151;
    }
    
    .suggestion-item {
        border-color: #374151;
    }
    
    .suggestion-item:hover {
        background: #334155;
    }
    
    .suggestion-main {
        color: #f1f5f9;
    }
    
    .suggestion-secondary {
        color: #94a3b8;
    }
}