* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    background: linear-gradient(to right, #283048, #859398);
}

/* Glavni wrapper */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    min-height: 100vh;
}

/* Flex raspored kartica */
main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    max-width: 1200px;
    width: 100%;
}

/* Kartica */
.box {
    position: relative;
    flex: 1 1 250px;   /* responzivna širina */
    max-width: 320px;
    height: 280px;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover efekt */
.box:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* Slike */
.box img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Druga slika */
.box .hover_img {
    opacity: 0;
}

/* Hover promjena */
.box:hover .hover_img {
    opacity: 1;
}

.box:hover img {
    transform: scale(1.1);
}

/* Dodatna responzivnost */
@media (max-width: 768px) {
    main {
        gap: 15px;
    }

    .box {
        flex: 1 1 45%;
        height: 240px;
    }
}

@media (max-width: 480px) {
    .box {
        flex: 1 1 100%;
        height: 220px;
    }
}
