/* ============================================
   CROWDSOURCING GO MODE - Styles
   V60: Bouton GO intégré au bottom sheet
   ============================================ */

/* ============================================
   SECTION GO DANS LE BOTTOM SHEET
   ============================================ */
.go-contribution-section {
    margin-top: 1.5rem;
    padding-top: 0;
}

.go-contribution-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin-bottom: 1.5rem;
}

.go-contribution-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.08), rgba(76, 175, 80, 0.03));
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 16px;
}

.go-contribution-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.go-contribution-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.go-contribution-text strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.go-contribution-text span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.go-contribution-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #4CAF50, #43A047);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.go-contribution-button:hover {
    background: linear-gradient(135deg, #43A047, #388E3C);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.go-contribution-button:active {
    transform: translateY(0);
}

.go-contribution-button .go-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
}

/* Dark mode */
[data-theme="dark"] .go-contribution-content {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.12), rgba(76, 175, 80, 0.05));
    border-color: rgba(76, 175, 80, 0.3);
}

/* Mobile: layout vertical */
@media (max-width: 400px) {
    .go-contribution-content {
        flex-direction: column;
        text-align: center;
    }
    
    .go-contribution-text {
        align-items: center;
    }
    
    .go-contribution-button {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   ANCIEN BOUTON FLOTTANT - Conservé pour compatibilité
   mais caché par défaut (V60)
   ============================================ */

/* Container principal - CACHÉ par défaut */
.go-container {
    display: none; /* V60: Supprimé */
    position: fixed;
    bottom: 100px;
    right: 16px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.go-container.hidden {
    display: none;
}

/* Bouton GO principal */
.go-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
    transition: all 0.3s ease;
}

.go-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.go-button:active {
    transform: translateY(0);
}

.go-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
}

.go-status {
    white-space: nowrap;
}

/* Panel actif (quand GO est activé) */
.go-panel {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 220px;
}

.go-panel.hidden {
    display: none;
}

.go-container.active .go-panel {
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(76, 175, 80, 0.6);
    }
}

.go-trip-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.go-route-badge {
    padding: 4px 10px;
    background: #1976D2;
    color: white;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
}

.go-direction {
    font-size: 13px;
    color: #666;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.go-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 12px;
}

.go-duration {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    font-family: 'Roboto Mono', monospace;
}

.go-points {
    font-size: 14px;
    color: #4CAF50;
    font-weight: 600;
}

.go-stop-button {
    width: 100%;
    padding: 10px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.go-stop-button:hover {
    background: #d32f2f;
}

/* Modal de sélection de trip */
.go-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.go-modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.go-modal-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.go-modal-subtitle {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #666;
}

.go-trip-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.go-loading {
    text-align: center;
    padding: 24px;
    color: #666;
}

.go-no-trips {
    text-align: center;
    padding: 24px;
    color: #666;
}

.go-no-trips p {
    margin: 0 0 8px 0;
}

.go-hint {
    font-size: 12px;
    color: #999;
}

.go-trip-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.go-trip-option:hover {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.go-trip-route {
    padding: 4px 8px;
    background: #1976D2;
    color: white;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
    min-width: 40px;
    text-align: center;
}

.go-trip-direction {
    flex: 1;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.go-trip-time {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.go-modal-cancel {
    width: 100%;
    padding: 12px;
    background: #eee;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.go-modal-cancel:hover {
    background: #ddd;
}

/* Indicateur de position crowdsourcée sur la carte */
.crowdsource-marker {
    width: 24px;
    height: 24px;
    background: #4CAF50;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.crowdsource-marker::after {
    content: '🚌';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

.crowdsource-marker.live {
    animation: live-pulse 1.5s infinite;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Badge niveau utilisateur */
.go-user-level {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

.go-user-level .level-icon {
    font-size: 14px;
}

.go-user-level .level-name {
    font-weight: 500;
}

/* Stats panel (pour page profil) */
.go-stats-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.go-stats-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.go-stats-icon {
    font-size: 32px;
}

.go-stats-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.go-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.go-stat-item {
    text-align: center;
}

.go-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
}

.go-stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Progress vers prochain niveau */
.go-level-progress {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.go-level-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.go-level-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.go-level-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .go-panel,
    .go-modal-content,
    .go-stats-panel {
        background: #1e1e1e;
        color: #fff;
    }

    .go-stats {
        background: #2d2d2d;
    }

    .go-duration {
        color: #fff;
    }

    .go-direction,
    .go-modal-subtitle,
    .go-stat-label,
    .go-level-text {
        color: #aaa;
    }

    .go-trip-option {
        background: #2d2d2d;
        border-color: #3d3d3d;
    }

    .go-trip-option:hover {
        background: #1b3d1b;
        border-color: #4CAF50;
    }

    .go-trip-direction {
        color: #fff;
    }

    .go-modal-cancel {
        background: #3d3d3d;
        color: #ccc;
    }

    .go-level-bar {
        background: #3d3d3d;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .go-container {
        bottom: 80px;
        right: 12px;
        left: 12px;
    }

    .go-button {
        width: 100%;
        justify-content: center;
    }

    .go-panel {
        min-width: unset;
    }
}

/* ============================================
   DELAY ALERTS - Alertes de retard
   ============================================ */

/* Bannière d'alerte retard */
#alert-banner.delay-alert {
    background: linear-gradient(135deg, #ff5252, #f44336);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    animation: alert-pulse 2s infinite;
}

@keyframes alert-pulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(244, 67, 54, 0.3);
    }
    50% {
        box-shadow: 0 2px 20px rgba(244, 67, 54, 0.6);
    }
}

#alert-banner.delay-alert .delay-icon {
    font-size: 20px;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

#alert-banner.delay-alert .delay-title {
    font-weight: 600;
    font-size: 14px;
}

.delay-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 13px;
}

.delay-badge {
    background: var(--line-color, #1976D2);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
}

.delay-time {
    font-weight: 500;
}

/* Marqueur de bus en retard sur la carte */
.delayed-bus-marker {
    position: relative;
    width: 36px;
    height: 36px;
}

.delayed-bus-marker .bus-icon {
    width: 36px;
    height: 36px;
    background: var(--line-color, #1976D2);
    border: 3px solid #f44336;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(244, 67, 54, 0.5);
    animation: delayed-pulse 1.5s infinite;
}

@keyframes delayed-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 10px rgba(244, 67, 54, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 20px rgba(244, 67, 54, 0.7);
    }
}

.delayed-bus-marker .delay-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #f44336;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    animation: bounce 1s infinite;
}

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

.delayed-bus-marker .delay-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 8px;
}

.delayed-bus-marker .delay-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.delayed-bus-marker:hover .delay-tooltip {
    opacity: 1;
}

/* Horaires avec retard */
.schedule-time.delayed {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.schedule-time.delayed .original-time {
    text-decoration: line-through;
    color: #999;
    font-size: 11px;
}

.schedule-time.delayed .delayed-time {
    color: #f44336;
    font-weight: bold;
    position: relative;
}

.schedule-time.delayed .delayed-time::before {
    content: '⚠️';
    margin-right: 4px;
    font-size: 12px;
}

/* Badge de retard dans les résultats */
.itinerary-delay-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffebee;
    color: #c62828;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.itinerary-delay-badge .delay-warning-icon {
    font-size: 12px;
}

/* Card de bus en retard dans l'état du réseau */
.network-status-card.has-delays {
    border-left: 4px solid #f44336;
}

.delay-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fff5f5;
    border-radius: 8px;
    margin-bottom: 8px;
}

.delay-status-item .route-badge {
    min-width: 40px;
    padding: 4px 8px;
    text-align: center;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    color: white;
}

.delay-status-item .delay-info {
    flex: 1;
}

.delay-status-item .delay-minutes {
    font-weight: bold;
    color: #c62828;
    font-size: 14px;
}

.delay-status-item .delay-details {
    font-size: 12px;
    color: #666;
}

.delay-status-item .delay-icon {
    font-size: 24px;
    animation: pulse-icon 1s infinite;
}

@keyframes pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Mise à jour temps réel indicator */
.realtime-update-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #666;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 12px;
}

.realtime-update-indicator .pulse-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: realtime-pulse 2s infinite;
}

.realtime-update-indicator.has-delays .pulse-dot {
    background: #f44336;
}

@keyframes realtime-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

/* Section état du réseau */
.network-status-section {
    padding: 16px;
    background: white;
    border-radius: 12px;
    margin: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.network-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.network-status-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.network-status-title .status-icon {
    font-size: 20px;
}

.network-status-title.has-issues .status-icon {
    color: #f44336;
}

.network-status-title.all-good .status-icon {
    color: #4CAF50;
}

.no-delays-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: #e8f5e9;
    border-radius: 8px;
    color: #2e7d32;
    font-size: 14px;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    #alert-banner.delay-alert {
        background: linear-gradient(135deg, #b71c1c, #c62828);
    }

    .delay-status-item {
        background: #2d2020;
    }

    .itinerary-delay-badge {
        background: #3d2020;
        color: #ff8a80;
    }

    .schedule-time.delayed .delayed-time {
        color: #ff8a80;
    }

    .network-status-section {
        background: #1e1e1e;
    }

    .no-delays-message {
        background: #1b3d1b;
        color: #81c784;
    }
}

/* ============================================
   DELAY POPUP - Popup de retard sur la carte
   ============================================ */

.delay-popup {
    min-width: 220px;
    font-family: 'Manrope', sans-serif;
}

.delay-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px 8px 0 0;
    color: white;
    margin: -14px -14px 10px -14px;
}

.delay-popup-header .route-name {
    font-weight: bold;
    font-size: 16px;
}

.delay-popup-header .delay-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.delay-popup-body {
    padding: 0;
}

.delay-popup-body p {
    margin: 6px 0;
    font-size: 13px;
    color: #333;
}

.delay-popup-body .original-time {
    text-decoration: line-through;
    color: #999;
    margin-right: 8px;
}

.delay-popup-body .delayed-time {
    color: #f44336;
    font-weight: bold;
}

.delay-popup-body .delay-note {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

/* Icône wrapper pour Leaflet */
.delayed-bus-icon-wrapper {
    background: transparent !important;
    border: none !important;
}

/* Style pour les marqueurs majeurs */
.delayed-bus-marker.major-delay .bus-icon {
    border-color: #b71c1c;
    animation: major-delay-pulse 1s infinite;
}

.delayed-bus-marker.major-delay .delay-indicator {
    background: #b71c1c;
    font-size: 16px;
}

@keyframes major-delay-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 10px rgba(183, 28, 28, 0.5);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 4px 25px rgba(183, 28, 28, 0.8);
    }
}

/* ============================================
   GO MODE ACTIF - Styles
   ============================================ */

.go-active-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.go-duration {
    font-family: 'Roboto Mono', 'Courier New', monospace;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(76, 175, 80, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.go-points {
    color: #4CAF50;
    font-weight: 600;
}

/* Toast notifications */
.go-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: goToastIn 0.3s ease;
}

.go-toast-success {
    background: #4CAF50;
    color: white;
}

.go-toast-error {
    background: #f44336;
    color: white;
}

.go-toast-warning {
    background: #ff9800;
    color: white;
}

.go-toast-info {
    background: #333;
    color: white;
}

@keyframes goToastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Contribution button active state */
.go-contribution-button.active {
    background: linear-gradient(135deg, #f44336, #d32f2f) !important;
}

.go-contribution-button.active:hover {
    background: linear-gradient(135deg, #d32f2f, #c62828) !important;
}

/* Dark mode adjustments */
body.dark-theme .go-duration {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

body.dark-theme .go-toast-info {
    background: #424242;
}

