/*
 * Projekt: Memora - Your journeys remembered
 * Zweck: Multimediaprojekt 1 (MMP1)
 * Studiengang: MultiMediaTechnology | FH Salzburg
 * Autorin: Helena Meindl
 * Jahr: 2026
*/

/* BUTTON */
.btn {
    border-radius: 20px;
    padding: var(--padding-small);
    padding-left: var(--padding-medium);
    padding-right: var(--padding-medium);
    background-color: var(--primary-color);
    border: none;
    font-size: var(--font-size);
    color: white;
    text-decoration: none;
}

.btn:hover {
    color: white;
    transform: scale(1.05);
    letter-spacing: 0;
}

/* HINTERGRUND */
.top {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('../images/mallorca_11.JPG');
    background-repeat: no-repeat;
    background-size: cover; 
    background-position: center;
    padding: 10rem 2rem;
    color: white;
    text-align: center;
}

.top h1, .top h2 {
    position: relative;
    z-index: 2;
}

/* INFO BOX */
.info {
    background-color: var(--primary-color-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px;
    margin: -50px auto 40px;
    max-width: 1020px;
    padding: var(--padding-medium);
}

/* SECTIONS */
section {
    max-width: 1500px;
    margin: 60px auto; 
    padding: 0 20px;
}

.section-title {
    margin-bottom: 20px;
}

/* GRID */
.trip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.trip-rand-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* CARD */
.trip-card,
.trip-rand-card {
    background-color: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    position: relative;
}

.trip-card:hover {
    transform: translateY(-6px) rotate(-0.5deg);
}

.trip-rand-card:hover {
    transform: scale(1.05);
}

/* OVERLAY */
.trip-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: 0.3s ease;
}

.trip-rand-card:hover .trip-overlay {
    opacity: 1;
}

/* EXPAND */
.trip-expand {
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    padding: 0 var(--padding-medium);
    transition: all 0.4s ease;
}

.trip-card:hover .trip-expand {
    max-height: 1000px;
    padding: var(--padding-medium);
}

/* IMAGE */
.trip-image {
    position: relative;
    aspect-ratio: 16/10;
}

.trip-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trip-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.35), transparent);
}

/* DATE */
.trip-date {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color-2);
    padding: 0.3rem 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* LOCATION */
.trip-location {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
}

/* CONTENT */
.trip-content {
    padding: var(--padding-medium);
}

.trip-content h4 {
    font-family: 'Reenie Beanie';
    font-size: 1.5rem;
    margin-bottom: var(--margin-medium);
}

.trip-content p {
    margin-top: 0;
}

.trip-user {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary-color);
}

.user-icon {
    width: 18px;
    height: 18px;
}

/* POPUP */
.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: white;
    border-radius: 20px;
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: popupFade 0.3s ease;
    position: relative;
}

.popup-image img {
    width: 100%;
    height: 260px;
    object-fit: cover;
}

.popup-text {
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.popup-text h3 {
    margin-top: 0;
    font-size: 1.6rem;
    line-height: 1.2;
}

.popup-user {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin: 0;
}

.popup-location, .popup-date, .popup-rating {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.popup-teaser {
    margin: 0.2rem 0;
    line-height: 1.5;
    color: var(--text-color);
    font-weight: bold;
}

.popup-description {
    font-weight: 500;
    margin-top: 0.2;
    color: var(--text-color); 
}

.close {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    background-color: rgba(0,0,0,0.4);
    border-radius: 50%;
    padding: 4px 10px;
    z-index: 10;
}

.close:hover {
    background-color: rgba(0,0,0,0.7);
}

/* POPUP BUTTON */
.open-popup {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
}

/* ANIMATION */
@keyframes popupFade {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* RESPONSIVE */
@media screen and (max-width: 900px) {
    .top {
        padding: 6rem 2rem;
    }

    .info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        margin: -30px 20px 30px;
    }

    .trip-rand-card {
        grid-template-columns: 1fr 1fr;
    }

    section {
        margin: 40px auto;
    }
}

@media screen and (max-width: 600px) {
    .top {
        padding: 4em 1rem;
    }

    .top h1 {
        font-size: 2.5rem;
    }

    .top h2 {
        font-size: 1.5rem;
    }

    .info {
        margin: -20px 10px 20px;
        padding: 1rem;
    }

    .info p {
        font-size: 0.95rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .trip-rand-grid {
        grid-template-columns: 1fr;
    }

    .trip-grid {
        grid-template-columns: 1fr;
    }

    .trip-card, .trip-rand-card {
        border-radius: 16px;
    }

    .trip-content h4 {
        font-size: 1.3rem;
    }

    .trip-expand p {
        font-size: 0.9rem;
    }

    .trip-location {
        font-size: 0.8rem;
    }

    .trip-date {
        font-size: 0.7rem;
    }

    .popup-content {
        max-width: 95%;
        border-radius: 16px;
    }

    .popup-image img {
        height: 180px;
    }

    .popup-text {
        padding: 1rem;
    }
}