/* Custom Styles for YEG Technologies */

/* Logo Glow Effect */
.logo-glow {
    filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.3));
}

/* Grid Pattern Backgrounds */
.grid-pattern {
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 1px, #DC2626 1px, #DC2626 2px),
        repeating-linear-gradient(-90deg, transparent, transparent 1px, #DC2626 1px, #DC2626 2px);
    background-size: 80px 80px;
}

.grid-pattern-small {
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 1px, #DC2626 1px, #DC2626 2px),
        repeating-linear-gradient(-90deg, transparent, transparent 1px, #DC2626 1px, #DC2626 2px);
    background-size: 50px 50px;
}

.grid-pattern-diagonal {
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 1px, #DC2626 1px, #DC2626 2px),
        repeating-linear-gradient(-45deg, transparent, transparent 1px, #DC2626 1px, #DC2626 2px);
    background-size: 40px 40px;
}

.grid-pattern-footer {
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 1px, #DC2626 1px, #DC2626 2px),
        repeating-linear-gradient(-90deg, transparent, transparent 1px, #DC2626 1px, #DC2626 2px);
    background-size: 60px 60px;
}

/* Header Scroll Effect */
#header.scrolled {
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

/* Tech Category Styles */
.tech-category {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

.tech-category:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
}

.tech-category.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #DC2626;
    color: white;
}

.tech-category .category-icon {
    color: rgba(255, 255, 255, 0.5);
}

.tech-category.active .category-icon {
    color: #DC2626;
}

.tech-category .category-chevron {
    color: rgba(255, 255, 255, 0.3);
    transform: rotate(0deg);
    transition: transform 0.3s, color 0.3s;
}

.tech-category.active .category-chevron {
    color: #DC2626;
    transform: rotate(90deg);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #DC2626;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #B91C1C;
}

/* Form Input Focus States */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #DC2626 !important;
}

/* Animations */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Spline Viewer */
spline-viewer {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Button Hover Effects */
button {
    cursor: pointer;
    outline: none;
}

/* Mobile Menu Animation */
#mobileMenu {
    transition: all 0.3s ease-in-out;
}

/* Responsive Typography */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
}

/* Prevent text selection on buttons */
button {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* 3D Sphere Animation */
.sphere-container {
    width: 500px;
    height: 500px;
    perspective: 1000px;
    position: relative;
}

.sphere {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: sphereRotate 20s linear infinite;
}

.sphere-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, 
        rgba(220, 38, 38, 0.4) 0%, 
        rgba(220, 38, 38, 0.2) 25%, 
        rgba(0, 0, 0, 0.8) 60%, 
        rgba(0, 0, 0, 0.95) 100%);
    box-shadow: 
        inset -25px -25px 40px rgba(0, 0, 0, 0.5),
        inset 5px 5px 20px rgba(220, 38, 38, 0.3),
        0 0 50px rgba(220, 38, 38, 0.4),
        0 0 100px rgba(220, 38, 38, 0.2);
    animation: spherePulse 3s ease-in-out infinite;
}

.sphere-glow {
    position: absolute;
    width: 110%;
    height: 110%;
    top: -5%;
    left: -5%;
    border-radius: 50%;
    background: radial-gradient(circle, 
        rgba(220, 38, 38, 0.3) 0%, 
        rgba(220, 38, 38, 0.1) 40%, 
        transparent 70%);
    filter: blur(20px);
    animation: glowPulse 3s ease-in-out infinite;
}

.sphere-rings {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.ring {
    position: absolute;
    border: 2px solid rgba(220, 38, 38, 0.4);
    border-radius: 50%;
    animation: ringRotate 8s linear infinite;
}

.ring-1 {
    width: 120%;
    height: 120%;
    top: -10%;
    left: -10%;
    animation-duration: 6s;
    border-color: rgba(220, 38, 38, 0.5);
}

.ring-2 {
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    animation-duration: 9s;
    animation-direction: reverse;
    border-color: rgba(220, 38, 38, 0.3);
}

.ring-3 {
    width: 160%;
    height: 160%;
    top: -30%;
    left: -30%;
    animation-duration: 12s;
    border-color: rgba(220, 38, 38, 0.2);
}

/* Grid overlay on sphere */
.sphere::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-image: 
        repeating-linear-gradient(0deg, 
            transparent, 
            transparent 19px, 
            rgba(220, 38, 38, 0.1) 19px, 
            rgba(220, 38, 38, 0.1) 20px),
        repeating-linear-gradient(90deg, 
            transparent, 
            transparent 19px, 
            rgba(220, 38, 38, 0.1) 19px, 
            rgba(220, 38, 38, 0.1) 20px);
    opacity: 0.3;
    animation: gridRotate 15s linear infinite;
}

/* Animations */
@keyframes sphereRotate {
    0% { transform: rotateY(0deg) rotateX(0deg); }
    100% { transform: rotateY(360deg) rotateX(360deg); }
}

@keyframes spherePulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 
            inset -25px -25px 40px rgba(0, 0, 0, 0.5),
            inset 5px 5px 20px rgba(220, 38, 38, 0.3),
            0 0 50px rgba(220, 38, 38, 0.4),
            0 0 100px rgba(220, 38, 38, 0.2);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 
            inset -25px -25px 40px rgba(0, 0, 0, 0.5),
            inset 5px 5px 20px rgba(220, 38, 38, 0.4),
            0 0 70px rgba(220, 38, 38, 0.6),
            0 0 140px rgba(220, 38, 38, 0.3);
    }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes ringRotate {
    0% { transform: rotateZ(0deg) rotateY(0deg); }
    100% { transform: rotateZ(360deg) rotateY(360deg); }
}

@keyframes gridRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sphere-container {
        width: 300px;
        height: 300px;
    }
}
