/* Mobile Cards Optimization */

/* Cards base styles - Mobile First */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Mobile-specific card styles */
@media (max-width: 768px) {
    .card-hover {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: 1rem;
        background: rgba(31, 41, 55, 0.8);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    /* Card images mobile optimization */
    .card-hover .h-40,
    .card-hover .h-48 {
        height: 200px;
        border-radius: 0.75rem;
        overflow: hidden;
    }
    
    .card-hover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    /* Card content spacing */
    .card-hover h3 {
        font-size: 1.125rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }
    
    .card-hover p {
        font-size: 0.875rem;
        line-height: 1.5;
        margin-bottom: 1rem;
        color: #d1d5db;
    }
    
    /* Button groups in cards */
    .card-hover .flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .card-hover .flex a {
        text-align: center;
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
        font-size: 0.875rem;
        font-weight: 600;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    
    /* Card hover effects for touch devices */
    .card-hover:active {
        transform: scale(0.98);
    }
    
    /* Gradient overlays */
    .card-hover .absolute.inset-0 {
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.4) 50%,
            transparent 100%
        );
    }
    
    /* Technology tags */
    .card-hover .text-xs,
    .card-hover .text-sm {
        font-size: 0.75rem;
        opacity: 0.9;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .card-hover {
        padding: 1.25rem;
    }
    
    .card-hover .h-48 {
        height: 220px;
    }
    
    .card-hover .flex {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .card-hover .flex a {
        flex: 1;
        min-width: 0;
    }
}

/* Desktop hover effects */
@media (min-width: 1025px) and (hover: hover) {
    .card-hover:hover {
        transform: translateY(-8px);
        box-shadow: 
            0 20px 25px -5px rgba(0, 247, 255, 0.1),
            0 10px 10px -5px rgba(0, 247, 255, 0.04);
    }
    
    .card-hover:hover img {
        transform: scale(1.05);
    }
    
    .card-hover .flex {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .card-hover .flex a {
        flex: 1;
    }
}

/* Grid improvements for cards */
@media (max-width: 768px) {
    .grid.grid-cols-1 {
        gap: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid.md\\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1025px) {
    .grid.lg\\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Loading states for cards */
.card-loading {
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.6s ease-out forwards;
}

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for multiple cards */
.card-hover:nth-child(1) { animation-delay: 0.1s; }
.card-hover:nth-child(2) { animation-delay: 0.2s; }
.card-hover:nth-child(3) { animation-delay: 0.3s; }
.card-hover:nth-child(4) { animation-delay: 0.4s; }
.card-hover:nth-child(5) { animation-delay: 0.5s; }
.card-hover:nth-child(6) { animation-delay: 0.6s; }

/* Accessibility improvements */
.card-hover:focus-within {
    outline: 2px solid #00f7ff;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .card-hover {
        transition: none;
    }
    
    .card-hover:hover {
        transform: none;
    }
    
    .card-loading {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card-hover {
        border: 2px solid #00f7ff;
        background: rgba(15, 15, 26, 0.95);
    }
    
    .card-hover .absolute.inset-0 {
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.9) 0%,
            rgba(0, 0, 0, 0.6) 50%,
            transparent 100%
        );
    }
}