/**
 * Travel Plan Map Selection CSS
 * 
 * CSS styles for museum map travel plan selection functionality
 * including markers, buttons, floating indicator, and interactions.
 * 
 * @package AutomuseumsCore
 * @version 1.0.0
 * @author  Synergy Marketing info@synergymarketing.mk
 */

/* ==========================================================================
   Museum Hover Cards
   ========================================================================== */

.museum-hover-card {
    position: absolute;
    z-index: 10001;
    background: #ffffff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 320px;
    min-width: 280px;
    font-family: inherit;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: auto;
}

/* Create invisible bridge area to prevent gaps */
.museum-hover-card::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    z-index: -1;
    pointer-events: auto;
}

.museum-hover-card-visible {
    opacity: 1;
    transform: translateY(0);
}

.museum-card-header {
    background: linear-gradient(135deg, #0073aa, #005177);
    color: white;
    padding: 12px 15px;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.museum-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    flex: 1;
    padding-right: 10px;
}

.museum-card-close {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.museum-card-close:hover {
    background: rgba(255,255,255,0.3);
}

.museum-card-content {
    padding: 15px;
}

.museum-card-image {
    margin: 0 0 12px 0;
    border-radius: 4px;
    overflow: hidden;
}

.museum-card-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.museum-card-address,
.museum-card-types {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.museum-card-address:last-child,
.museum-card-types:last-child {
    margin-bottom: 0;
}

.museum-card-actions {
    padding: 12px 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.museum-card-btn {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
    white-space: nowrap;
}

.museum-card-btn-view {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.museum-card-btn-view:hover {
    background: #e9ecef;
    color: #333;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.museum-card-btn-add {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.museum-card-btn-add:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40,167,69,0.2);
}

.museum-card-btn-selected {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.museum-card-btn-selected:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220,53,69,0.2);
}

.museum-card-btn-icon {
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
}

.museum-card-btn:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Popup hint styling */
.museum-popup-hint {
    text-align: center;
    margin: 10px 0 0 0;
    padding: 8px 12px;
    background: #e8f4f8;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

.museum-popup-hint small {
    color: #0073aa;
    font-style: italic;
}

/* ==========================================================================
   Travel Plan Button Styles
   ========================================================================== */

.travel-plan-btn {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: center;
}

.travel-plan-btn:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.travel-plan-btn-selected {
    background: #dc3545;
    border-color: #dc3545;
}

.travel-plan-btn-selected:hover {
    background: #c82333;
    border-color: #c82333;
}

.travel-plan-btn-icon {
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
}

.travel-plan-btn:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   Floating Travel Plan Indicator
   ========================================================================== */

.travel-plan-floating-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10000;
    max-width: 280px;
    transition: all 0.3s ease;
    display: none;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.travel-plan-indicator-content {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.travel-plan-icon {
    font-size: 20px;
}

.travel-plan-count {
    background: #0073aa;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.travel-plan-label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.travel-plan-indicator-actions {
    padding: 10px 15px;
    display: flex;
    gap: 8px;
}

.travel-plan-view-btn,
.travel-plan-clear-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    flex: 1;
    text-align: center;
}

.travel-plan-view-btn {
    background: #0073aa;
    color: white;
}

.travel-plan-view-btn:hover {
    background: #005177;
    transform: translateY(-1px);
}

.travel-plan-clear-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
}

.travel-plan-clear-btn:hover {
    background: #e9ecef;
    color: #333;
    transform: translateY(-1px);
}

/* ==========================================================================
   Selected Marker Styling
   ========================================================================== */

/* Primary selected marker styling - Blue to Green conversion */
.travel-plan-selected-marker {
    filter: 
        sepia(100%) 
        hue-rotate(90deg) 
        saturate(2) 
        brightness(1.2);
    transform: scale(1.1);
    border: 3px solid #28a745;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
    z-index: 1001;
    transition: all 0.3s ease;
}

/* Ensure Leaflet marker icons get styled */
.leaflet-marker-icon.travel-plan-selected-marker {
    filter: 
        sepia(100%) 
        hue-rotate(90deg) 
        saturate(2) 
        brightness(1.2);
    transform: scale(1.1);
    border: 3px solid #28a745;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
}

/* Target marker cluster icons when selected */
.marker-cluster.travel-plan-selected-marker {
    background: rgba(40, 167, 69, 0.8) !important;
    border: 2px solid #28a745 !important;
}

.marker-cluster.travel-plan-selected-marker div {
    background: rgba(40, 167, 69, 0.9) !important;
}

@keyframes selectedMarkerPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.5);
        transform: scale(1.1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(40, 167, 69, 0.3);
        transform: scale(1.15);
    }
}

/* Selected marker cluster styling */
.travel-plan-selected-marker .marker-cluster {
    background-color: rgba(40, 167, 69, 0.8);
    border-color: rgba(40, 167, 69, 1);
}

.travel-plan-selected-marker .marker-cluster div {
    background-color: rgba(40, 167, 69, 0.9);
}

/* ==========================================================================
   Travel Plan Selection Mode
   ========================================================================== */

.travel-plan-selection-mode .museum-map-container {
    cursor: crosshair;
}

.travel-plan-selection-mode .leaflet-marker-icon:not(.travel-plan-selected-marker) {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.travel-plan-selection-mode .leaflet-marker-icon:not(.travel-plan-selected-marker):hover {
    opacity: 1;
    transform: scale(1.05);
}

.travel-plan-selection-mode .museum-popup-actions {
    border-top: 2px dashed #28a745;
    padding-top: 12px;
    margin-top: 12px;
}

/* ==========================================================================
   Enhanced Popup Styling for Selected Museums
   ========================================================================== */

.leaflet-popup-content .museum-popup:has(.travel-plan-btn-selected) {
    border-left: 4px solid #28a745;
    padding-left: 12px;
}

.leaflet-popup-content .museum-popup:has(.travel-plan-btn-selected) .museum-popup-title {
    color: #28a745 !important;
}

/* ==========================================================================
   Mobile Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    /* Museum Hover Cards Mobile */
    .museum-hover-card {
        max-width: 300px;
        min-width: 260px;
        font-size: 14px;
    }
    
    .museum-card-header {
        padding: 10px 12px;
    }
    
    .museum-card-title {
        font-size: 15px;
    }
    
    .museum-card-content {
        padding: 12px;
    }
    
    .museum-card-image img {
        height: 100px;
    }
    
    .museum-card-actions {
        padding: 10px 12px;
        flex-direction: column;
        gap: 6px;
    }
    
    .museum-card-btn {
        width: 100%;
        font-size: 12px;
        padding: 10px 12px;
    }
    
    /* Travel Plan Components Mobile */
    .travel-plan-floating-indicator {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .travel-plan-indicator-content {
        padding: 12px;
    }
    
    .travel-plan-indicator-actions {
        padding: 8px 12px;
    }
    
    .travel-plan-btn {
        padding: 10px 8px;
        font-size: 12px;
        min-width: 100px;
        margin-left: 0;
        margin-top: 5px;
        width: 100%;
    }
    
    .museum-popup-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .museum-popup-actions .button-primary {
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .travel-plan-floating-indicator {
        bottom: 5px;
        right: 5px;
        left: 5px;
    }
    
    .travel-plan-indicator-content {
        padding: 10px;
        font-size: 13px;
    }
    
    .travel-plan-label {
        font-size: 12px;
    }
    
    .travel-plan-view-btn,
    .travel-plan-clear-btn {
        font-size: 11px;
        padding: 5px 8px;
    }
}

/* ==========================================================================
   Animation States
   ========================================================================== */

.travel-plan-btn.adding {
    animation: buttonSuccess 0.3s ease;
}

.travel-plan-btn.removing {
    animation: buttonRemove 0.3s ease;
}

@keyframes buttonSuccess {
    0% { background: #28a745; transform: scale(1); }
    50% { background: #20c997; transform: scale(1.05); }
    100% { background: #dc3545; transform: scale(1); }
}

@keyframes buttonRemove {
    0% { background: #dc3545; transform: scale(1); }
    50% { background: #fd7e14; transform: scale(1.05); }
    100% { background: #28a745; transform: scale(1); }
}

.travel-plan-floating-indicator.updating {
    animation: indicatorPulse 0.2s ease;
}

@keyframes indicatorPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    .travel-plan-btn {
        border-width: 2px;
        font-weight: bold;
    }
    
    .travel-plan-floating-indicator {
        border-width: 3px;
    }
    
    .travel-plan-selected-marker {
        filter: contrast(2) saturate(2);
        border: 3px solid #000;
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .travel-plan-selected-marker,
    .travel-plan-floating-indicator,
    .travel-plan-btn {
        animation: none;
        transition: none;
    }
    
    .travel-plan-btn:hover,
    .travel-plan-view-btn:hover,
    .travel-plan-clear-btn:hover {
        transform: none;
    }
    
    .travel-plan-floating-indicator {
        animation: none;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .travel-plan-floating-indicator,
    .travel-plan-btn {
        display: none;
    }
    
    .travel-plan-selected-marker {
        filter: none;
        transform: none;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .travel-plan-floating-indicator {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .travel-plan-label {
        color: #e2e8f0;
    }
    
    .travel-plan-clear-btn {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
    
    .travel-plan-clear-btn:hover {
        background: #718096;
        color: #f7fafc;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

.travel-plan-btn:focus,
.travel-plan-view-btn:focus,
.travel-plan-clear-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.travel-plan-floating-indicator[aria-hidden="true"] {
    display: none;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}