.technologies {
    padding: 8rem 0;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.technologies::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.technologies .container {
    position: relative;
    z-index: 1;
}

.technologies .section-header h2 {
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.technologies .section-header p {
    color: #94a3b8;
}

.tech-grid {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding: 2rem 5%;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar for premium look */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.tech-grid::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Opera */
}

/* Ensure first and last items have proper spacing */
.tech-grid::after {
    content: '';
    min-width: 5%;
    height: 1px;
    display: block;
}

.tech-item {
    width: 320px;
    min-width: 320px;
    max-width: 350px;
    flex: 0 0 auto;
    scroll-snap-align: center;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tech-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 2px;
    background: linear-gradient(45deg, transparent, rgba(59, 130, 246, 0.3), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

.tech-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(59, 130, 246, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(30, 41, 59, 0.6);
}

.tech-item:hover::before {
    opacity: 1;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

.tech-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.tech-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.95);
}

.tech-item:hover .tech-image img {
    filter: brightness(1);
    transform: scale(1.2);
}

.tech-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 195, 74, 0.85) 0%, rgba(124, 179, 66, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(2px);
}

.tech-item:hover .tech-overlay {
    opacity: 1;
}

.tech-animation {
    width: 4.5rem;
    height: 4.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--primary-color);
    animation: techPulse 2s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes techPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.tech-animation {
    animation: techPulse 2s ease-in-out infinite;
}

.tech-item:hover .tech-animation {
    animation: techPulse 1s ease-in-out infinite;
    transform: scale(1.1);
}

.tech-logo {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -2rem auto 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-item:hover .tech-logo {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    border-color: var(--primary-color);
    color: white;
    background: var(--primary-color);
}

.tech-item h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0.75rem;
    padding: 0 1rem;
    line-height: 1.3;
    transition: color 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tech-tagline {
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    padding: 0 1rem;
    opacity: 0.9;
}

.tech-item:hover h3 {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.tech-item p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 0 1.5rem 1.75rem;
    margin: 0;
}

