/* Flip Card Styles */
.flip-card {
    z-index: 10;
    background-color: transparent;
    width: 320px;
    height: 320px;
    margin: 20px;
    perspective: 1000px;
    border-radius: 10px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.45s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    box-shadow: var(--shadow);
}

.flip-card-front {
    border-radius: 10px;
    overflow: hidden;
    color: white;
    background-color: white;

}

.flip-card-front .title {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: var(--navy-gradient);
    color: white;
    padding: 12px 0;
    margin: 0;
    z-index: 2;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
}

/* Basic offer cards - original styles */
.flip-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.5s ease;
    background-color: white;
}

.flip-card:hover .flip-card-front img {
    filter: brightness(1.05);
}

/* Styles for back of card */
.flip-card-back {
    border-radius: 10px;
    overflow: hidden;
    color: var(--text);
    background: var(--light);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px;
    border: none;
    background-color: white;
}

.flip-card-back h3.title {
    color: var(--navy);
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 12px;
    font-size: 20px;
    width: 100%;
    text-align: center;
}

.flip-card-back h3.title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--orange-gradient);
    border-radius: 2px;
}

.flip-card-back p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    padding: 0 10px;
    color: var(--text);
}

/* Tech link specific styles */
.tech-link {
    text-decoration: none;
    display: block;
    margin: 0;
    padding: 0;
}

.tech-link:hover {
    text-decoration: none;
}

.tech-link .flip-card {
    margin: 20px;
}

/* Styles for technology cards (advanced services) */
.tech-link .flip-card-front img[alt="Cloud Flare"],
.tech-link .flip-card-front img[alt="Google Workspace"],
.tech-link .flip-card-front img[alt="Automatyzacja z AI"],
.tech-link .flip-card-front img[alt="Integracja Systemów"],
.tech-link .flip-card-front img[alt="Rozwiązania Sieciowe"],
.tech-link .flip-card-front img[alt="Automatyzacja z Python"],
.tech-link .flip-card-front img[alt="Google Cloud Platform"],
.tech-link .flip-card-front img[alt="Analityka Internetowa"],
.tech-link .flip-card-front img[alt="Google Analytics"] {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: all 0.5s ease;
    padding: 20px;
    max-height: 260px;
}

/* Special styles for images that need white background */
.tech-link .flip-card-front img[alt="Integracja Systemów"],
.tech-link .flip-card-front img[alt="Rozwiązania Sieciowe"],
.tech-link .flip-card-front img[alt="Automatyzacja z Python"] {
    background-color: white;
    mix-blend-mode: multiply;
    padding: 30px;
}

/* Special styles for images that don't need white background */
.tech-link .flip-card-front img[alt="Cloud Flare"],
.tech-link .flip-card-front img[alt="Google Workspace"],
.tech-link .flip-card-front img[alt="Automatyzacja z AI"],
.tech-link .flip-card-front img[alt="Google Cloud Platform"],
.tech-link .flip-card-front img[alt="Google Analytics"],
.tech-link .flip-card-front img[alt="Analityka Internetowa"] {
    background: none;
    mix-blend-mode: normal;
    padding: 0;
}

/* Basic services cards should maintain their original styling */
.tech-link .flip-card-front img[alt="Zdalny dostęp VPN"],
.tech-link .flip-card-front img[alt="Upgrade komputerów"],
.tech-link .flip-card-front img[alt="Automatyzacja pracy"],
.tech-link .flip-card-front img[alt="Serwer terminalowy"],
.tech-link .flip-card-front img[alt="Upgrade systemów"],
.tech-link .flip-card-front img[alt="Szkolenie IT BHP"],
.tech-link .flip-card-front img[alt="Monitoring"] {
    object-fit: cover;
    padding: 0;
    max-height: none;
    background: none;
    mix-blend-mode: normal;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* max 3 cards per row */
    justify-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
}

/* Responsive styles */
@media (max-width: 992px) {
    .flip-card {
        width: 300px;
        height: 300px;
        margin: 15px;
    }
    
    .tech-link .flip-card {
        margin: 10px;
    }
}

@media (max-width: 768px) {
    .flip-card {
        width: 280px;
        height: 280px;
        margin: 10px;
    }
    
    .flip-card-back {
        padding: 20px;
    }
    
    .flip-card-back h3.title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .flip-card-back p {
        font-size: 15px;
    }
    
    .cards { gap: 15px; grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .flip-card {
        width: 260px;
        height: 260px;
        margin: 8px auto;
        max-width: 100%;
    }
    
    .cards { gap: 10px; grid-template-columns: 1fr; max-width: 320px; margin-left: auto; margin-right: auto; }
    
    .flip-card-front .title {
        padding: 10px 0;
        font-size: 15px;
    }
    
    .flip-card-back {
        padding: 15px;
    }
    
    .flip-card-back h3.title {
        font-size: 16px;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    
    .flip-card-back h3.title::after {
        height: 2px;
        width: 40px;
    }
    
    .flip-card-back p {
        font-size: 14px;
        line-height: 1.4;
        padding: 0 5px;
    }
    
    /* Adjust image container sizes for small screens */
    .tech-link .flip-card-front img[alt="Cloud Flare"],
    .tech-link .flip-card-front img[alt="Google Workspace"],
    .tech-link .flip-card-front img[alt="Automatyzacja z AI"],
    .tech-link .flip-card-front img[alt="Integracja Systemów"],
    .tech-link .flip-card-front img[alt="Rozwiązania Sieciowe"],
    .tech-link .flip-card-front img[alt="Automatyzacja z Python"],
    .tech-link .flip-card-front img[alt="Google Cloud Platform"],
    .tech-link .flip-card-front img[alt="Analityka Internetowa"],
    .tech-link .flip-card-front img[alt="Google Analytics"] {
        padding: 15px;
        max-height: 220px;
    }

    .tech-link .flip-card-front img[alt="Integracja Systemów"],
    .tech-link .flip-card-front img[alt="Rozwiązania Sieciowe"],
    .tech-link .flip-card-front img[alt="Automatyzacja z Python"] {
        padding: 20px;
    }
}

@media (max-width: 360px) {
    .flip-card {
        width: 240px;
        height: 240px;
    }
    
    .cards {
        max-width: 280px;
    }
    
    .flip-card-back p {
        font-size: 13px;
        line-height: 1.3;
    }
}
