/* Enhanced Sample Card Styling */
.sample-card {
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(89, 169, 106, 0.1);
    will-change: transform, box-shadow;
}

.sample-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(89, 169, 106, 0.2);
    border-color: rgba(89, 169, 106, 0.3);
}

.sample-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
}

.sample-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    will-change: transform;
}

.sample-card:hover .sample-image img {
    transform: scale(1.08) rotate(0.5deg);
}

.sample-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(89, 169, 106, 0) 0%, rgba(89, 169, 106, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    will-change: opacity;
}

.sample-card:hover .sample-image::before {
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    z-index: 1001;
    padding: 5px;
    line-height: 1;
}

.modal-close:hover {
    color: #ccc;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: white;
    cursor: pointer;
    padding: 10px 15px;
    user-select: none;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, color 0.2s ease;
}

.modal-nav:hover {
    color: #ccc;
    background: rgba(0, 0, 0, 0.5);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

/* Responsive Design */
/* Tablets and Large Phones */
@media (max-width: 1024px) {
    .sample-card {
        transition: transform 0.25s ease, box-shadow 0.25s ease !important;
    }
    
    .sample-image {
        height: 250px;
    }
    
    .sample-card:hover {
        transform: translateY(-6px);
    }
}

/* Medium Phones */
@media (max-width: 768px) {
    .sample-image {
        height: 220px;
    }
    
    .sample-card:hover .sample-image img {
        transform: scale(1.05) rotate(0.3deg);
    }
    
    .modal-close {
        font-size: 2rem;
        top: 15px;
        right: 15px;
    }
    
    .modal-nav {
        font-size: 1.5rem;
        padding: 8px 12px;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
}

/* Small Phones */
@media (max-width: 480px) {
    .sample-image {
        height: 180px;
    }
    
    .sample-card {
        border-radius: 8px !important;
    }
    
    .sample-card:hover {
        transform: translateY(-4px);
    }
    
    .sample-card:hover .sample-image img {
        transform: scale(1.03);
    }
    
    .modal-close {
        font-size: 1.5rem;
        top: 10px;
        right: 10px;
    }
    
    .modal-nav {
        font-size: 1.2rem;
        padding: 6px 10px;
    }
    
    .modal-prev {
        left: 5px;
    }
    
    .modal-next {
        right: 5px;
    }
}

/* Performance: Disable animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    .sample-card,
    .sample-image img,
    .sample-image::before,
    .modal-nav {
        transition: none !important;
        will-change: auto;
    }
    
    .sample-card:hover {
        transform: none;
    }
    
    .sample-card:hover .sample-image img {
        transform: none;
    }
}