.league-map-wrapper {
    --marker-size: 40px;
    --marker-color: var(--theme-info, #3b82f6);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --popup-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-xl: 1rem;
    --border-radius-lg: 0.75rem;
    --border-radius-md: 0.5rem;
    --border-radius-sm: 0.25rem;
}

.league-map-container {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--theme-shadow, 0 4px 12px var(--shadow-color));
    background-color: var(--theme-surface-1, #ffffff);
    min-height: 300px;
    transition: box-shadow 0.3s var(--transition-smooth);
}

.league-map-container:hover {
    box-shadow: var(--theme-shadow-lg, 0 8px 24px var(--shadow-color));
}

/* Marker styling */
.league-marker-container {
    background: transparent;
    border: none;
    z-index: 500 !important;
}

.league-marker {
    width: var(--marker-size);
    height: var(--marker-size);
    border-radius: 50% 50% 50% 0;
    background: var(--marker-color);
    position: absolute;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-color), 0 0 0 6px rgba(255, 255, 255, 0.2);
    transition: all 0.3s var(--transition-smooth);
    cursor: pointer;
    overflow: hidden;
}

.league-marker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
    z-index: 0;
}

.league-marker::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    bottom: 10px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: -1;
    filter: blur(4px);
    transform: translateY(5px) scale(0.7);
    opacity: 0.7;
    transition: all 0.3s var(--transition-smooth);
}

/* Day abbreviation text */
.day-abbreviation {
    position: absolute;
    bottom: 8px;
    font-size: 11px;
    font-weight: bold;
    transform: rotate(45deg);
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

/* Marker hover effect */
.leaflet-marker-icon:hover .league-marker {
    transform: rotate(-45deg) scale(1.1);
    box-shadow: 0 8px 20px var(--shadow-color), 0 0 0 8px rgba(255, 255, 255, 0.3);
}

.leaflet-marker-icon:hover .league-marker::after {
    opacity: 0.9;
    transform: translateY(5px) scale(1);
}

/* Marker icon styling */
.league-marker i {
    transform: rotate(45deg);
    font-size: 18px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s var(--transition-bounce);
    margin-top: -6px; /* Move disc icon up to make room for day text */
}

.leaflet-marker-icon:hover .league-marker i {
    transform: rotate(45deg) scale(1.2);
}

/* Pulsing animation for markers */
@keyframes markerPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5), 0 0 0 6px rgba(255, 255, 255, 0.2);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0), 0 0 0 6px rgba(255, 255, 255, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0), 0 0 0 6px rgba(255, 255, 255, 0.2);
    }
}

.league-marker-pulse .league-marker {
    animation: markerPulse 2s infinite;
}

/* Bounce animation for marker click */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: rotate(-45deg) translateY(0);}
    40% {transform: rotate(-45deg) translateY(-15px);}
    60% {transform: rotate(-45deg) translateY(-7px);}
}

.league-marker.bounce {
    animation: bounce 0.8s;
}

/* Enhanced popup styling */
.league-popup-container {
    padding: 0 !important;
    border-radius: var(--border-radius-md) !important;
    overflow: hidden !important;
    box-shadow: var(--popup-shadow) !important;
    width: 250px !important;
}

.league-popup-container .leaflet-popup-content-wrapper {
    padding: 0 !important;
    border-radius: var(--border-radius-md) !important;
    background-color: var(--theme-surface-1, #ffffff) !important;
    color: var(--theme-text-primary, #2d3748) !important;
    overflow: hidden !important;
    box-shadow: none !important;
    width: 250px !important;
}

.league-popup-container .leaflet-popup-content {
    margin: 0 !important;
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
}

.league-popup-container .leaflet-popup-tip {
    background-color: var(--theme-surface-1, #ffffff) !important;
    box-shadow: var(--popup-shadow) !important;
}

.league-popup-container .leaflet-popup-close-button {
    color: var(--theme-text-primary, #2d3748) !important;
    font-size: 18px !important;
    top: 10px !important;
    right: 10px !important;
    height: 24px !important;
    width: 24px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    border-radius: 50% !important;
    background-color: var(--theme-surface-1, #ffffff) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
}

.league-popup-container .leaflet-popup-close-button:hover {
    background-color: var(--theme-surface-2, #f8f9fa) !important;
    transform: scale(1.1) !important;
}

/* Popup content styling */
.league-popup {
    width: 250px;
    display: flex;
    flex-direction: column;
    color: var(--theme-text-primary, #2d3748);
    overflow: hidden;
}

.league-popup-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    position: relative;
    background-color: var(--league-primary, var(--theme-info, #3b82f6));
}

.league-popup-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, var(--league-primary, var(--theme-info, #3b82f6)), transparent);
    z-index: 1;
}

.league-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s var(--transition-smooth);
    filter: brightness(1.05) contrast(1.05);
}

.league-popup-image:hover img {
    transform: scale(1.05);
}

.league-popup-content {
    padding: 14px;
    position: relative;
}

.league-popup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--league-primary, var(--theme-info, #3b82f6));
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.league-title {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--theme-text-primary, #2d3748);
    line-height: 1.3;
    padding-left: 6px;
}

.league-details {
    margin-bottom: 10px;
}

.league-location,
.league-date,
.league-ace-pot {
    display: flex;
    align-items: center;
    margin: 0 0 6px 0;
    color: var(--theme-text-secondary, #4a5568);
    font-size: 0.9rem;
    line-height: 1.3;
    padding-left: 6px;
}

.league-location i,
.league-date i,
.league-ace-pot i {
    margin-right: 6px;
    min-width: 16px;
    font-size: 0.9rem;
    color: var(--league-primary, var(--theme-info, #3b82f6));
    opacity: 0.8;
}

.league-ace-pot i {
    color: #10B981; /* Green color for ace pot */
}

.league-description {
    padding-left: 6px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--theme-text-secondary, #4a5568);
    border-left: 2px solid var(--league-primary, var(--theme-info, #3b82f6));
    padding-left: 8px;
    font-style: italic;
    opacity: 0.9;
}

/* Custom styled button */
.league-details-btn {
    width: 100%;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-color: var(--league-primary, var(--theme-info, #3b82f6));
    color: var(--league-primary, var(--theme-info, #3b82f6));
    transition: all 0.3s var(--transition-smooth);
    font-weight: 600;
    border-radius: var(--border-radius-md);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.league-details-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--league-primary, var(--theme-info, #3b82f6));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s var(--transition-smooth);
}

.league-details-btn:hover {
    color: var(--league-contrast, white);
}

.league-details-btn:hover::before {
    opacity: 1;
}

.league-details-btn i {
    transition: transform 0.3s var(--transition-bounce);
}

.league-details-btn:hover i {
    transform: translateX(-3px);
}

/* Map controls styling */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    margin: 15px !important;
}

.leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
    background-color: var(--theme-surface-1, white) !important;
    color: var(--theme-text-primary, #2d3748) !important;
    border: none !important;
    transition: all 0.2s ease !important;
}

.leaflet-control-zoom a:first-child {
    border-top-left-radius: var(--border-radius-md) !important;
    border-top-right-radius: var(--border-radius-md) !important;
    border-bottom: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.1)) !important;
}

.leaflet-control-zoom a:last-child {
    border-bottom-left-radius: var(--border-radius-md) !important;
    border-bottom-right-radius: var(--border-radius-md) !important;
}

.leaflet-control-zoom a:hover {
    background-color: var(--theme-surface-2, #f8f9fa) !important;
    color: var(--theme-info, #3b82f6) !important;
}

.leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.7) !important;
    padding: 4px 8px !important;
    border-radius: var(--border-radius-sm) 0 0 0 !important;
    font-size: 10px !important;
}

.leaflet-control-attribution a {
    color: var(--theme-info, #3b82f6) !important;
    text-decoration: none !important;
}

/* Fullscreen control styling */
.leaflet-control-fullscreen {
    border: none !important;
    border-radius: var(--border-radius-md) !important;
    overflow: hidden !important;
}

.leaflet-control-fullscreen a {
    background-color: var(--theme-surface-1, white) !important;
    color: var(--theme-text-primary, #2d3748) !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 16px !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
}

.leaflet-control-fullscreen a:hover {
    background-color: var(--theme-surface-2, #f8f9fa) !important;
    color: var(--theme-info, #3b82f6) !important;
}

/* Empty state styling */
.league-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--theme-surface-1, #ffffff);
    border-radius: var(--border-radius-lg);
    border: 2px dashed var(--theme-border-color, #e2e8f0);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--theme-info, #3b82f6);
    opacity: 0.3;
    margin-bottom: 1.5rem;
    animation: floatAnimation 3s ease-in-out infinite;
}

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

.empty-state-content {
    max-width: 500px;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-text-primary, #2d3748);
    margin: 0 0 1rem 0;
}

.empty-state-message {
    font-size: 1rem;
    color: var(--theme-text-secondary, #4a5568);
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

.empty-state-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.empty-state-actions .btn-theme-base {
    min-width: 200px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.empty-state-actions .btn-theme-primary {
    animation: pulseButton 2s infinite;
}

@keyframes pulseButton {
    0%, 100% { box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 4px 16px rgba(59, 130, 246, 0.5); }
}

.empty-state-actions .btn-theme-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.empty-state-actions .btn-theme-outline:hover {
    transform: translateY(-2px);
    background-color: var(--theme-info, #3b82f6);
    color: white;
    border-color: var(--theme-info, #3b82f6);
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .league-map-wrapper {
        --shadow-color: rgba(0, 0, 0, 0.4);
        --popup-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    }

    /* Popup styling */
    .league-popup-container .leaflet-popup-content-wrapper,
    .league-popup-container .leaflet-popup-tip {
        background-color: var(--theme-surface-1, #1e293b) !important;
        color: var(--theme-text-primary, #e2e8f0) !important;
    }

    .league-popup-container .leaflet-popup-close-button {
        background-color: var(--theme-surface-2, #334155) !important;
        color: var(--theme-text-primary, #e2e8f0) !important;
    }

    .league-popup-container .leaflet-popup-close-button:hover {
        background-color: var(--theme-surface-3, #475569) !important;
    }

    .league-title {
        color: var(--theme-text-primary, #e2e8f0);
    }

    .league-location,
    .league-date {
        color: var(--theme-text-secondary, #cbd5e1);
    }

    /* Map controls in dark mode */
    .leaflet-control-zoom a,
    .leaflet-control-fullscreen a {
        background-color: var(--theme-surface-2, #334155) !important;
        color: var(--theme-text-primary, #e2e8f0) !important;
        border-color: var(--theme-border-color, rgba(255, 255, 255, 0.1)) !important;
    }

    .leaflet-control-zoom a:hover,
    .leaflet-control-fullscreen a:hover {
        background-color: var(--theme-surface-3, #475569) !important;
        color: var(--theme-info, #60a5fa) !important;
    }

    .leaflet-control-attribution {
        background-color: rgba(0, 0, 0, 0.6) !important;
        color: var(--theme-text-secondary, #cbd5e1) !important;
    }

    .leaflet-control-attribution a {
        color: var(--theme-info, #60a5fa) !important;
    }

    /* Enhanced visibility for markers in dark mode */
    .league-marker {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(255, 255, 255, 0.1);
    }

    .leaflet-marker-icon:hover .league-marker {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(255, 255, 255, 0.2);
    }

    /* Dark mode empty state */
    .league-empty-state {
        background: var(--theme-surface-1, #1e293b);
        border-color: var(--theme-border-color, #334155);
    }

    .empty-state-icon {
        color: var(--theme-info, #60a5fa);
    }

    .empty-state-title {
        color: var(--theme-text-primary, #e2e8f0);
    }

    .empty-state-message {
        color: var(--theme-text-secondary, #cbd5e1);
    }

    .empty-state-actions .btn-theme-primary {
        animation: pulseButtonDark 2s infinite;
    }

    @keyframes pulseButtonDark {
        0%, 100% { box-shadow: 0 2px 8px rgba(96, 165, 250, 0.3); }
        50% { box-shadow: 0 4px 16px rgba(96, 165, 250, 0.5); }
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .league-marker,
    .league-marker i,
    .league-popup-image img,
    .league-details-btn,
    .league-details-btn i,
    .empty-state-icon {
        transition: none !important;
        animation: none !important;
    }

    .league-marker-pulse .league-marker {
        animation: none !important;
    }

    .league-marker.bounce {
        animation: none !important;
    }

    .empty-state-actions .btn-theme-primary {
        animation: none !important;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .league-popup-image {
        height: 120px;
    }

    .league-title {
        font-size: 1.1rem;
    }

    .league-location,
    .league-date {
        font-size: 0.9rem;
    }

    .leaflet-control-zoom a,
    .leaflet-control-fullscreen a {
        width: 32px !important;
        height: 32px !important;
        line-height: 32px !important;
        font-size: 14px !important;
    }
}

/* Small screen adjustments */
@media (max-width: 576px) {
    .league-title {
        font-size: 1rem;
    }

    .league-location,
    .league-date {
        font-size: 0.85rem;
    }

    .leaflet-control-zoom,
    .leaflet-control-fullscreen {
        margin: 10px !important;
    }

    .league-details-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    /* Empty state mobile adjustments */
    .league-empty-state {
        min-height: 350px;
        padding: 2rem 1.5rem;
    }

    .empty-state-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .empty-state-title {
        font-size: 1.25rem;
    }

    .empty-state-message {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .empty-state-actions {
        flex-direction: column;
        width: 100%;
    }

    .empty-state-actions .btn-theme-base {
        width: 100%;
        min-width: unset;
    }
}