/* ===== MARS GALLERY - MODERN STYLE ===== */

/* Container principale */
.mars-gallery {
    background: linear-gradient(135deg, #0c0d13 0%, #1a1b2e 50%, #0f0f1a 100%);
    padding: 40px 20px;
    min-height: 100vh;
}

/* Titolo sezione */
.mars-gallery h3 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
}

.mars-gallery h3::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #00d4ff, #7b2cbf, #ff006e);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Card container */
.mars-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.mars-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(123, 44, 191, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.mars-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 212, 255, 0.2),
        inset 0 0 30px rgba(0, 212, 255, 0.05);
}

.mars-card:hover::before {
    opacity: 1;
}

/* Immagine wrapper */
.mars-card .img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.mars-card .img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.mars-card:hover .img-wrapper img {
    transform: scale(1.1);
    filter: brightness(1.1) saturate(1.2);
}

/* Badge NASA */
.mars-card .badge-nasa {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #000;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

/* Overlay gradient su immagine */
.mars-card .img-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    pointer-events: none;
}

/* Icona zoom */
.mars-card .zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background: rgba(0, 212, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.mars-card .zoom-icon svg {
    width: 24px;
    height: 24px;
    fill: #000;
}

.mars-card:hover .zoom-icon {
    transform: translate(-50%, -50%) scale(1);
}

/* Card body */
.mars-card .card-body {
    padding: 20px;
    position: relative;
    z-index: 1;
}

.mars-card .card-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mars-card .card-date {
    color: #00d4ff;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mars-card .card-date::before {
    content: '📅';
    font-size: 0.9rem;
}

/* Modal moderno */
#myModal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    animation: fadeIn 0.3s ease;
}

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

#myModal .modal-content {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.3);
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

#myModal .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

#myModal .close:hover {
    background: #ff006e;
    transform: rotate(90deg);
}

/* Alert moderno */
.mars-alert {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    color: #ff6b6b;
}

/* Loading skeleton */
.mars-card.loading {
    animation: pulse 1.5s infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .mars-gallery h3 {
        font-size: 1.8rem;
    }
    
    .mars-card {
        border-radius: 15px;
    }
    
    .mars-card .card-body {
        padding: 15px;
    }
}

/* Animazione entrata cards */
.mars-card {
    animation: slideUp 0.6s ease backwards;
}

.mars-card:nth-child(1) { animation-delay: 0.1s; }
.mars-card:nth-child(2) { animation-delay: 0.2s; }
.mars-card:nth-child(3) { animation-delay: 0.3s; }
.mars-card:nth-child(4) { animation-delay: 0.4s; }
.mars-card:nth-child(5) { animation-delay: 0.5s; }
.mars-card:nth-child(6) { animation-delay: 0.6s; }
.mars-card:nth-child(7) { animation-delay: 0.7s; }
.mars-card:nth-child(8) { animation-delay: 0.8s; }

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