/**
 * Rideshare Map - Frontend Styles
 * Highly graphical and modern design
 */

/* Container */
.rideshare-map-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: 30px auto;
    position: relative;
    overflow: hidden;
}

.rideshare-map-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Header */
.rideshare-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.rideshare-map-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.rideshare-icon {
    font-size: 32px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Locate Button */
.rideshare-locate-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.rideshare-locate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.rideshare-locate-btn:active {
    transform: translateY(0);
}

.locate-icon {
    font-size: 20px;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%, 100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Map */
.rideshare-map {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

/* Loading */
.rideshare-loading {
    display: none;
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.rideshare-loading.active {
    display: block;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 5px solid rgba(102, 126, 234, 0.2);
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.rideshare-loading p {
    color: #667eea;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Results Container */
.rideshare-results {
    margin-top: 25px;
    position: relative;
    z-index: 1;
}

.rideshare-service-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.service-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.service-logo {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: contain;
    background: white;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.service-name {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Ride Cards */
.ride-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ride-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ride-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.ride-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.ride-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.ride-info {
    flex: 1;
}

.ride-name {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 5px 0;
}

.ride-description {
    font-size: 14px;
    color: #718096;
    margin: 0;
}

.ride-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.ride-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.ride-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.detail-icon {
    font-size: 20px;
}

.detail-label {
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

.detail-value {
    font-size: 16px;
    color: #2d3748;
    font-weight: 700;
}

.surge-indicator {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
}

/* QR Code Section */
.ride-qr-section {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    margin-top: 15px;
}

.qr-label {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.qr-code-container {
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.qr-code-container canvas,
.qr-code-container img {
    display: block;
    margin: 0 auto;
}

.qr-instruction {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin-top: 10px;
}

/* Info Section */
.rideshare-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.info-text {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #4a5568;
    font-size: 15px;
    line-height: 1.6;
}

.info-icon {
    font-size: 24px;
    flex-shrink: 0;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin-top: 20px;
}

.no-results-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.no-results h3 {
    color: #2d3748;
    font-size: 24px;
    margin: 0 0 10px 0;
}

.no-results p {
    color: #718096;
    font-size: 16px;
    margin: 0;
}

/* Leaflet Customization */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.user-location-popup {
    text-align: center;
}

.user-location-popup h4 {
    margin: 0 0 10px 0;
    color: #667eea;
    font-size: 18px;
}

.user-location-popup p {
    margin: 0;
    color: #718096;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rideshare-map-container {
        padding: 15px;
        border-radius: 15px;
    }
    
    .rideshare-map-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .rideshare-map-title {
        font-size: 24px;
        justify-content: center;
    }
    
    .rideshare-locate-btn {
        width: 100%;
        justify-content: center;
    }
    
    .ride-cards {
        grid-template-columns: 1fr;
    }
    
    .service-header {
        flex-direction: column;
        text-align: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ride-card {
    animation: fadeIn 0.5s ease-out;
}

.ride-card:nth-child(1) { animation-delay: 0.1s; }
.ride-card:nth-child(2) { animation-delay: 0.2s; }
.ride-card:nth-child(3) { animation-delay: 0.3s; }
.ride-card:nth-child(4) { animation-delay: 0.4s; }