@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

p {
    margin: 0;
    font-family: 'Poppins';
}

body,
html {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

* {
    box-sizing: border-box;
    /* Include padding/border in element width */
}

body::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 100vw;
    /* Changed from 100% to 100vw */
    height: 30rem;
    background-color: rgb(142, 255, 255);
    transform-origin: 0;
    transform: skewY(-10deg);
    box-shadow: 0rem 0.3rem 1rem rgb(184, 184, 184);
    left: 0;
    /* Ensure it starts from the left edge */
}

body {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* ---------------------- HEADER SECTION ---------------------- */

.header {
    margin-top: 10vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5vh;
}

.photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.name {
    font-weight: 900;
    font-size: 2vw;
    color: #2c3e50;
    margin-top: 1rem;
    text-align: center;
    position: relative;
    letter-spacing: 0.5px;
    margin-right: 2vw;
}

.name::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, rgb(142, 255, 255), #00bcd4);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.name:hover::after {
    width: 100%;
}

.space {
    max-width: 20vw;
    max-height: 20vh;
    border-radius: 12px;
    box-shadow: 4px 4px 12px rgb(0, 0, 0);
    margin-right: 0.4vw;
}

.description {
    padding: 2.5vw;
    max-width: 18vw;
    background-color: white;
    border-radius: 12px;
    box-shadow: 1px 1px 2px rgb(189, 189, 189);
}

.description-title {
    text-align: center;
}

.icons {
    display: flex;
    align-items: center;
    justify-content: end;
    margin-top: 2vh;
    gap: 1vw;
}

.icon {
    width: 99%;
    height: 99%;
    transition: transform 0.5s;
}

.icon-container {
    max-width: 2vw;
    max-height: 3vh;
}

.icon-container:hover .icon {
    cursor: pointer;
    transform: rotateY(180deg);
}

/* ---------------------- BODY SECTION ---------------------- */

.body {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    grid-auto-rows: max-content;
}

.body-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    position: relative;
    grid-column: 1 / -1;
}

.body-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, rgb(101, 58, 255), #ff9100);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.body-title:hover::after {
    width: 100%;
}

.card {
    padding-bottom: 5px;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 400px;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.screenshot {
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
}

.card-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 200px;
    justify-content: space-between;
}

.card-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.card-icons {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.card-icons .icon {
    width: 1.8rem;
    height: 1.8rem;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.card-icons .icon:hover {
    transform: scale(1.15);
}

.card-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

/* ---------------------- FOOTER SECTION ---------------------- */

.footer {
    background-color: rgb(78, 235, 235);
    box-shadow: 0rem 0.3rem 1rem rgb(184, 184, 184);
    display: flex;
    justify-content: space-around;
    padding: 2vw;
}

.contact-info {
    color: rgb(255, 255, 255);
    font-weight: 900;
}

/* ==================== MEDIA QUERIES ==================== */

/* Mobile phones (320px - 480px) */
@media screen and (max-width: 480px) {
    body::before {
        height: 20rem;
        transform: skewY(-3deg);
        width: 100vw;
        left: 0;
    }

    .header {
        margin-top: 3vh;
        padding: 0 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    .name {
        font-size: 24px;
        /* Changed from vw to fixed px */
        letter-spacing: 0.2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .space {
        max-width: 120px;
        max-height: 100px;
        width: 120px;
        /* Fixed width */
        height: 100px;
        /* Fixed height */
    }

    .description {
        max-width: calc(100vw - 2rem);
        /* Ensure it fits within viewport */
        width: 100%;
        padding: 1rem;
        font-size: 0.9rem;
        margin: 0;
        box-sizing: border-box;
    }

    .icons {
        gap: 1rem;
        /* Changed from vw to fixed rem */
        justify-content: center;
        flex-wrap: wrap;
    }

    .icon-container {
        width: 24px;
        /* Fixed width instead of vw */
        height: 24px;
        /* Fixed height instead of vh */
        max-width: none;
        max-height: none;
        flex-shrink: 0;
    }

    .body {
        padding: 1rem;
        gap: 1rem;
        width: 100%;
        box-sizing: border-box;
        grid-template-columns: 1fr;
        /* Single column */
    }

    .body-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        word-wrap: break-word;
    }

    .card {
        margin: 0;
        min-height: 320px;
        width: 100%;
        box-sizing: border-box;
    }

    .card-info {
        padding: 1rem;
        height: auto;
        width: 100%;
        box-sizing: border-box;
    }

    .card-name {
        font-size: 1.1rem;
        word-wrap: break-word;
    }

    .card-description {
        font-size: 0.85rem;
        word-wrap: break-word;
    }

    .screenshot {
        height: 200px;
        width: 100%;
    }

    .footer {
        padding: 2rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        box-sizing: border-box;
    }
}