/* PULSAR Interactive Maps System - Styles */

.pulsar-maps-system {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, 
        rgba(10, 10, 10, 0.98) 0%, 
        rgba(26, 26, 46, 0.95) 50%, 
        rgba(16, 21, 62, 0.98) 100%);
    backdrop-filter: blur(20px);
    color: white;
    user-select: none;
    overflow: hidden;
}

.maps-container {
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-areas: 
        "controls controls"
        "map info"
        "ar ar";
    grid-template-columns: 1fr 350px;
    grid-template-rows: auto 1fr auto;
    gap: 0;
}

/* Map Controls */
.map-controls {
    grid-area: controls;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(142, 45, 226, 0.1);
    border-bottom: 1px solid rgba(142, 45, 226, 0.3);
}

.map-control-btn {
    width: 50px;
    height: 50px;
    border: 1px solid rgba(142, 45, 226, 0.3);
    border-radius: 12px;
    background: rgba(142, 45, 226, 0.2);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.map-control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s ease;
}

.map-control-btn:hover::before {
    left: 100%;
}

.map-control-btn:hover {
    background: rgba(142, 45, 226, 0.4);
    border-color: rgba(142, 45, 226, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(142, 45, 226, 0.3);
}

.map-control-btn:active {
    transform: translateY(0);
}

.map-control-btn.active {
    background: #8E2DE2;
    border-color: #8E2DE2;
    box-shadow: 0 0 20px rgba(142, 45, 226, 0.5);
}

.close-btn {
    background: rgba(255, 7, 58, 0.2);
    border-color: rgba(255, 7, 58, 0.3);
}

.close-btn:hover {
    background: #FF073A;
    border-color: #FF073A;
    box-shadow: 0 5px 15px rgba(255, 7, 58, 0.3);
}

/* Map Display */
.map-display {
    grid-area: map;
    background: #0a0a0a;
    border: 1px solid rgba(142, 45, 226, 0.2);
    position: relative;
    overflow: hidden;
}

.map-display canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
}

.map-display canvas:active {
    cursor: grabbing;
}

/* Info Panel */
.map-info-panel {
    grid-area: info;
    background: rgba(26, 26, 46, 0.9);
    border-left: 1px solid rgba(142, 45, 226, 0.3);
    overflow-y: auto;
    padding: 20px;
}

.map-info-panel::-webkit-scrollbar {
    width: 6px;
}

.map-info-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.map-info-panel::-webkit-scrollbar-thumb {
    background: #8E2DE2;
    border-radius: 3px;
}

.info-section {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(142, 45, 226, 0.2);
    border-radius: 8px;
}

.info-section h3 {
    color: #8E2DE2;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #8E2DE2, #4A00E0);
    border-radius: 2px;
}

/* Crowd Density */
.density-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.density-item {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    align-items: center;
    gap: 10px;
}

.area-name {
    font-size: 0.9rem;
    color: #b3b3b3;
    font-weight: 500;
}

.density-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.density-fill {
    height: 100%;
    background: linear-gradient(90deg, #8E2DE2, #4A00E0);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
    position: relative;
}

.density-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: densityShimmer 2s ease-in-out infinite;
}

@keyframes densityShimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.density-value {
    font-size: 0.8rem;
    color: #00FFFF;
    font-weight: 600;
    min-width: 35px;
    text-align: right;
}

/* Parking Status */
.parking-status {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.parking-spot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.spot-icon {
    font-size: 1.2rem;
}

.spot-info {
    color: #b3b3b3;
    font-size: 0.9rem;
}

.spot-info strong {
    color: white;
    font-weight: 600;
}

.reserve-parking-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #00FF7F, #00FFFF);
    border: none;
    border-radius: 6px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.reserve-parking-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 127, 0.3);
}

.reserve-parking-btn:active {
    transform: translateY(0);
}

/* Events Info */
.active-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.no-events {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(142, 45, 226, 0.1);
    border: 1px solid rgba(142, 45, 226, 0.2);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.event-item:hover {
    background: rgba(142, 45, 226, 0.2);
    border-color: rgba(142, 45, 226, 0.4);
    transform: translateX(5px);
}

.event-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.event-details {
    flex: 1;
}

.event-name {
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

.event-status {
    font-size: 0.8rem;
    color: #00FFFF;
}

.event-navigate {
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    color: #00FFFF;
    padding: 5px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.event-navigate:hover {
    background: #00FFFF;
    color: #000;
}

/* Navigation */
.nav-destination {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.destination-select {
    flex: 1;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(142, 45, 226, 0.3);
    border-radius: 4px;
    color: white;
    font-size: 0.9rem;
}

.destination-select:focus {
    outline: none;
    border-color: #8E2DE2;
    box-shadow: 0 0 8px rgba(142, 45, 226, 0.3);
}

.navigate-btn {
    padding: 8px 15px;
    background: linear-gradient(135deg, #8E2DE2, #4A00E0);
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.navigate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(142, 45, 226, 0.3);
}

.nav-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-distance,
.nav-time {
    font-size: 0.9rem;
    color: #b3b3b3;
}

.nav-distance strong,
.nav-time strong {
    color: #00FFFF;
}

.nav-directions {
    margin-top: 10px;
}

.direction-step {
    padding: 5px 0;
    font-size: 0.8rem;
    color: #b3b3b3;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.direction-step:last-child {
    border-bottom: none;
}

/* AR Overlay */
.ar-overlay {
    grid-area: ar;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    z-index: 10002;
}

.ar-info {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    z-index: 10003;
}

.ar-info h3 {
    color: #8E2DE2;
    margin-bottom: 10px;
}

.ar-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10001;
}

/* Parking Confirmation */
.parking-confirmation {
    animation: confirmationSlide 0.5s ease-out;
}

.confirmation-content {
    background: linear-gradient(135deg, 
        rgba(26, 26, 46, 0.98) 0%, 
        rgba(16, 21, 62, 0.98) 100%);
    border: 2px solid #8E2DE2;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.confirmation-content h3 {
    color: #8E2DE2;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.confirmation-content p {
    margin: 10px 0;
    color: #b3b3b3;
}

.confirmation-content strong {
    color: #00FFFF;
}

.confirmation-content button {
    margin-top: 20px;
    padding: 10px 30px;
    background: linear-gradient(135deg, #8E2DE2, #4A00E0);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirmation-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(142, 45, 226, 0.3);
}

@keyframes confirmationSlide {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .maps-container {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "controls"
            "map"
            "info"
            "ar";
        grid-template-rows: auto 60vh auto auto;
    }
    
    .map-info-panel {
        border-left: none;
        border-top: 1px solid rgba(142, 45, 226, 0.3);
        max-height: 40vh;
    }
}

@media (max-width: 768px) {
    .map-controls {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .map-control-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .map-info-panel {
        padding: 15px;
    }
    
    .info-section {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .density-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .nav-destination {
        flex-direction: column;
    }
    
    .confirmation-content {
        margin: 20px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .maps-container {
        grid-template-rows: auto 50vh auto auto;
    }
    
    .map-controls {
        padding: 8px 10px;
    }
    
    .map-control-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .map-info-panel {
        padding: 12px;
        max-height: 35vh;
    }
    
    .info-section h3 {
        font-size: 1rem;
    }
    
    .confirmation-content {
        padding: 15px;
    }
}

/* Animations */
.map-slide-in {
    animation: mapSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.map-slide-out {
    animation: mapSlideOut 0.3s ease-in;
}

@keyframes mapSlideIn {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

@keyframes mapSlideOut {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Loading States */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: white;
}

.map-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(142, 45, 226, 0.3);
    border-top: 3px solid #8E2DE2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.map-control-btn:focus,
.navigate-btn:focus,
.reserve-parking-btn:focus {
    outline: 2px solid #8E2DE2;
    outline-offset: 2px;
}

.destination-select:focus {
    outline: 2px solid #8E2DE2;
    outline-offset: 1px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .pulsar-maps-system {
        background: black;
        border: 3px solid white;
    }
    
    .map-control-btn {
        background: white;
        color: black;
        border: 2px solid black;
    }
    
    .info-section {
        background: black;
        border: 2px solid white;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
    
    .ar-overlay {
        display: none !important;
    }
}