/**
 * Location Card Component Styles
 * Beautiful, modern design with smooth animations and skeleton loading states
 */

/* Main Location Card Container */
.location-card {
    position: relative;
    width: 320px;
    background: var(--info-bg);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.location-card.location-card-visible {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* State when a site marker has been placed */
.location-card.committed {
    transform: scale(1) translateY(-80px); /* Slide up to reveal marker */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* Enhance shadow for depth */
    z-index: 1001; /* Ensure it's above the marker */
}

/* Location Card Content */
.location-card-content {
    position: relative;
}

/* Banner Section */
.location-card-banner {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

.banner-image.fade-in {
    opacity: 1;
}

.fallback-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.fallback-banner .material-symbols-outlined {
    font-size: 48px;
    opacity: 0.8;
}

/* Skeleton Loading States */
.banner-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    overflow: hidden;
}

.skeleton-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.text-skeleton {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #f0f0f0;
    transition: opacity 0.3s ease;
}

.name-skeleton {
    height: 24px;
    width: 80%;
    margin-bottom: 8px;
}

.country-skeleton {
    height: 16px;
    width: 60%;
}

/* Card Body */
.location-card-body {
    padding: 20px;
}

.location-info {
    margin-bottom: 20px;
}

.location-name {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    min-height: 24px;
}

.location-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.location-country {
    font-size: 14px;
    color: var(--text-weak);
    font-weight: 500;
    min-height: 16px;
}

.location-coordinates {
    font-size: 12px;
    color: var(--text-weak2);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.coordinates-label {
    margin-right: 8px;
}

.coordinates-value {
    font-weight: 500;
    color: var(--text-weak);
}

/* Actions Section */
.location-actions {
    display: flex;
    justify-content: center;
}

.place-origin-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 160px;
    justify-content: center;
}

.place-origin-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.place-origin-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.place-origin-btn.btn-ready {
    background: var(--primary);
    color: white;
}

.place-origin-btn .material-symbols-outlined {
    font-size: 18px;
}

.btn-text {
    display: none;
}

.btn-loading {
    display: inline-block;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Satellite View Indicator */
.satellite-indicator {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    opacity: 0;
    animation: fadeInUp 0.4s ease 0.2s forwards;
}

.satellite-indicator .material-symbols-outlined {
    font-size: 14px;
}

.satellite-indicator .indicator-text {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Photo Attribution Overlay - Enhanced for Unsplash Compliance */
.photo-attribution {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 400;
    backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    max-width: 200px;
    text-align: right;
    line-height: 1.3;
    letter-spacing: 0.1px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.photo-attribution.attribution-visible {
    opacity: 1;
    transform: translateY(0);
}

.photo-attribution .attribution-text {
    display: block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.attribution-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.attribution-link:hover {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.2);
}

.attribution-link:focus {
    outline: 1px solid rgba(255, 255, 255, 0.6);
    outline-offset: 1px;
    border-radius: 2px;
}

/* Platform-specific styling */
.platform-link {
    font-weight: 500;
}

.photographer-link {
    font-style: normal;
}

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

/* Close Button */
.location-card-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.location-card-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.location-card-close .material-symbols-outlined {
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .location-card {
        width: 280px;
        margin: 0 20px;
    }
    
    .location-card-body {
        padding: 16px;
    }
    
    .location-name {
        font-size: 18px;
    }
    
    .place-origin-btn {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 140px;
    }
    
    /* Mobile attribution adjustments */
    .photo-attribution {
        font-size: 9px;
        padding: 3px 6px;
        max-width: 160px;
        bottom: 4px;
        right: 4px;
    }
    
    .satellite-indicator {
        font-size: 10px;
        padding: 3px 6px;
        bottom: 6px;
        left: 6px;
    }
    
    .satellite-indicator .material-symbols-outlined {
        font-size: 12px;
    }
    
    .satellite-indicator .indicator-text {
        font-size: 9px;
    }
}

/* Focus Management for Accessibility */
.location-card:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.location-card-close:focus,
.place-origin-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .location-card {
        border: 2px solid var(--text);
    }
    
    .banner-skeleton {
        background: #d0d0d0;
    }
    
    .text-skeleton {
        background: #d0d0d0;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .location-card,
    .banner-image,
    .place-origin-btn,
    .location-card-close,
    .photo-attribution {
        transition: none;
    }
    
    .skeleton-shimmer {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
    
    .satellite-indicator {
        animation: none;
        opacity: 1;
        transform: translateY(0);
    }
    
    .photo-attribution {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark Mode Support (if implemented) */
@media (prefers-color-scheme: dark) {
    .banner-skeleton {
        background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    }
    
    .text-skeleton {
        background: #2a2a2a;
    }
    
    .skeleton-shimmer {
        background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent
        );
    }
}
