/* ===== SERVICES PAGE STYLES ===== */

/* Services Section */
.services-section {
    min-height: 100vh;
    padding: 120px 20px 80px;
}

.section-subtitle {
    text-align: center;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--text-light);
    margin-top: -40px;
    margin-bottom: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 600;
    line-height: 1.6;
    text-shadow: 0 0 4px rgba(0, 0, 0, 1),
        0 0 8px rgba(0, 0, 0, 1),
        0 0 12px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(0, 0, 0, 0.6),
        0 2px 6px rgba(0, 0, 0, 0.9);
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.4);
}

/* Services Grid Layout */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Service Card Styling */
.service-card {
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color-light);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Hover Effect with 3D Transform */
.service-card:hover {
    transform: translateY(-10px) scale(1.02) translateZ(0);
    border-color: var(--border-color-strong);
    box-shadow: 0 20px 60px var(--shadow-color-hover);
    background: rgba(10, 10, 10, 0.85);
}

.service-card:hover,
.service-card:active {
    will-change: transform, box-shadow, border-color;
}

.service-card:not(:hover):not(:active) {
    will-change: auto;
}

/* Clickability Hint */
.service-card::before {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.85rem;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

/* Service Image */
.service-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
    transition: transform 0.4s ease;
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.service-card:hover img {
    transform: scale(1.05) translateZ(0);
}

.service-card img:hover {
    will-change: transform;
}

.service-card img:not(:hover) {
    will-change: auto;
}

/* Service Title */
.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-weight: 600;
}

/* Service Description */
.service-card p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 3px rgba(0, 0, 0, 0.9);
    -webkit-text-stroke: 0.2px rgba(0, 0, 0, 0.3);
}

/* ===== IMAGE MODAL STYLES ===== */

/* Modal Container */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.image-modal.active {
    display: block;
}

/* Modal Backdrop */
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

/* Modal Content Container */
.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(0);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    /* GPU acceleration */
    backface-visibility: hidden;
    perspective: 1000px;
}

.image-modal.active .modal-container {
    will-change: transform, opacity;
}

.image-modal:not(.active) .modal-container {
    will-change: auto;
}

/* Modal Image */
#modal-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(135, 206, 235, 0.3);
    border: 2px solid var(--border-color-medium);
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Modal Title */
.modal-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Close Hint */
.close-hint {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
    opacity: 0.8;
}

/* ===== ANIMATIONS ===== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .services-section {
        opacity: 1 !important;
        transform: none !important;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-card {
        padding: 25px;
        /* Touch-friendly tap target */
        min-height: 300px;
    }

    .service-card img {
        height: 200px;
    }

    .service-card h3 {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }

    .service-card p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .service-card::before {
        font-size: 0.8rem;
        top: 12px;
        right: 12px;
    }

    .modal-container {
        max-width: 95vw;
        max-height: 95vh;
        gap: 15px;
    }

    #modal-image {
        max-height: 70vh;
        border-radius: 10px;
    }

    .modal-title {
        font-size: 1.3rem;
        padding: 0 15px;
    }

    .close-hint {
        font-size: 0.9rem;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .services-section {
        padding: 100px 15px 60px;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-top: -30px;
        margin-bottom: 40px;
        line-height: 1.5;
    }

    .services-grid {
        gap: 15px;
    }

    .service-card {
        padding: 20px;
    }

    .service-card img {
        height: 180px;
    }

    .service-card h3 {
        font-size: 1.25rem;
    }

    .service-card p {
        font-size: 0.95rem;
    }

    #modal-image {
        max-height: 65vh;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .close-hint {
        font-size: 0.85rem;
    }
}