/* Fan Effects CSS for Service Section */

/* Fan blade rotation animation */
@keyframes fanRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes fanPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes fanWhoosh {
    0%, 100% {
        transform: translateX(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateX(10px) scale(1.1);
        opacity: 0.6;
    }
}

/* Fan container and blade structure */
.fan-container {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fan-base {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #374151;
    border-radius: 50%;
    z-index: 3;
}

.fan-blades {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: fanRotate 2s linear infinite;
}

.fan-blade {
    position: absolute;
    width: 25px;
    height: 8px;
    background: linear-gradient(45deg, #6b7280, #9ca3af);
    border-radius: 4px;
    transform-origin: 50% 50%;
}

.fan-blade:nth-child(1) {
    top: 10px;
    left: 17px;
    transform: rotate(0deg);
}

.fan-blade:nth-child(2) {
    top: 17px;
    right: 10px;
    transform: rotate(90deg);
}

.fan-blade:nth-child(3) {
    bottom: 10px;
    left: 17px;
    transform: rotate(180deg);
}

.fan-blade:nth-child(4) {
    top: 17px;
    left: 10px;
    transform: rotate(270deg);
}

/* Air flow effect */
.air-flow {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.3), transparent);
    border-radius: 2px;
    animation: fanWhoosh 1.5s ease-in-out infinite;
}

.air-flow:nth-child(2) {
    animation-delay: 0.3s;
    top: 40%;
}

.air-flow:nth-child(3) {
    animation-delay: 0.6s;
    top: 60%;
}

/* HVAC Component Cards - Clean Design */
.single-feature.fan-enhanced {
    position: relative;
    overflow: visible;
    border: 2px solid #e5e7eb;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform: translateY(0) scale(1);
    filter: blur(0px) brightness(1);
}

/* Card 1 - Air Handler Unit (AHU) */
.single-feature.fan-enhanced:nth-child(1) {
    background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e1;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
}

.single-feature.fan-enhanced:nth-child(1)::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 8px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8, #7c3aed, #3b82f6);
    background-size: 300% 100%;
    border-radius: 1.5rem 1.5rem 0 0;
    z-index: 1;
    animation: colorShift1 4s ease-in-out infinite;
}

@keyframes colorShift1 {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Card 2 - Centrifugal Fan Unit */
.single-feature.fan-enhanced:nth-child(2) {
    background: linear-gradient(145deg, #fef3c7 0%, #fbbf24 20%, #f59e0b 100%);
    border: 2px solid #d97706;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
    position: relative;
}

.single-feature.fan-enhanced:nth-child(2)::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 8px;
    background: linear-gradient(90deg, #f59e0b, #d97706, #ec4899, #f59e0b);
    background-size: 300% 100%;
    border-radius: 1.5rem 1.5rem 0 0;
    z-index: 1;
    animation: colorShift2 3.5s ease-in-out infinite;
}

@keyframes colorShift2 {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Card 3 - Digital Control System */
.single-feature.fan-enhanced:nth-child(3) {
    background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%);
    border: 2px solid #10b981;
    position: relative;
}

.single-feature.fan-enhanced:nth-child(3)::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 8px;
    background: linear-gradient(90deg, #10b981, #059669, #06b6d4, #10b981);
    background-size: 300% 100%;
    border-radius: 1.5rem 1.5rem 0 0;
    z-index: 1;
    animation: colorShift3 4.5s ease-in-out infinite;
}

@keyframes colorShift3 {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Card 4 - Ductwork System */
.single-feature.fan-enhanced:nth-child(4) {
    background: linear-gradient(145deg, #fef2e2 0%, #fed7aa 50%, #fdba74 100%);
    border: 2px solid #ea580c;
    position: relative;
}

.single-feature.fan-enhanced:nth-child(4)::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 8px;
    background: linear-gradient(90deg, #ea580c, #c2410c, #7c2d12, #ea580c);
    background-size: 300% 100%;
    border-radius: 1.5rem 1.5rem 0 0;
    z-index: 1;
    animation: colorShift4 3.8s ease-in-out infinite;
}

@keyframes colorShift4 {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Enhanced hover effects for HVAC components */
.single-feature.fan-enhanced:hover {
    transform: translateY(-18px) scale(1.12) !important;
    filter: blur(0px) brightness(1.1) !important;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3) !important;
    z-index: 20 !important;
    opacity: 1 !important;
}

/* Blur effect for non-hovered cards */
.single-feature.fan-enhanced.blur-others {
    filter: blur(0.8px) brightness(0.85) !important;
    transform: translateY(0) scale(0.98) !important;
    opacity: 0.75 !important;
}

/* Individual card hover enhancements */
.single-feature.fan-enhanced:nth-child(1):hover {
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

.single-feature.fan-enhanced:nth-child(2):hover {
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.4);
    border-color: #f59e0b;
}

.single-feature.fan-enhanced:nth-child(3):hover {
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.3);
    border-color: #10b981;
}

.single-feature.fan-enhanced:nth-child(4):hover {
    box-shadow: 0 20px 40px rgba(234, 88, 12, 0.3);
    border-color: #ea580c;
}

/* Icon badge enhancement for HVAC components */
.icon-badge.fan-icon {
    position: relative;
    overflow: visible;
    border: none !important;
    background: transparent !important;
    padding: 8px !important;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1) !important;
}

.icon-badge.fan-icon::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: inherit;
    opacity: 0;
    animation: componentGlow 3s ease-in-out infinite;
}

@keyframes componentGlow {
    0%, 100% {
        opacity: 0.1;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.05);
    }
}

/* Services Section Background */
#services {
    background: linear-gradient(135deg, 
        #f8fafc 0%, 
        #e2e8f0 25%, 
        #f1f5f9 50%, 
        #e5e7eb 75%, 
        #f9fafb 100%
    );
    position: relative;
}

/* Section title area styling to match cards */
#services .about-content-wrapper {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e5e7eb;
    border-radius: 1.5rem;
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#services .about-content-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-color: #cbd5e1;
}

#services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.02) 0%, transparent 60%);
    z-index: 0;
}

#services .container {
    position: relative;
    z-index: 2;
}

/* HVAC Air Circulation System */
.hvac-system {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: all;
    z-index: 1;
    overflow: hidden;
}

/* Supply Air Flow */
.supply-air {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Return Air Flow */
.return-air {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Air Molecules - Clean and Professional */
.air-molecule {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(59, 130, 246, 0.7);
    border-radius: 50%;
    opacity: 0;
    animation: hvacFlow 12s linear infinite;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

/* Supply Air Flow Animation - Simulates fresh air distribution */
@keyframes hvacFlow {
    0% {
        left: -20px;
        opacity: 0;
        transform: translateY(0);
    }
    10% {
        opacity: 0.8;
    }
    25% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(5px);
    }
    75% {
        transform: translateY(-5px);
    }
    90% {
        opacity: 0.8;
    }
    100% {
        left: calc(100% + 20px);
        opacity: 0;
        transform: translateY(0);
    }
}

/* Return Air Flow Animation - Simulates return air circulation */
@keyframes returnFlow {
    0% {
        right: -20px;
        opacity: 0;
        transform: translateY(0);
    }
    10% {
        opacity: 0.6;
    }
    25% {
        transform: translateY(8px);
    }
    50% {
        transform: translateY(-8px);
    }
    75% {
        transform: translateY(3px);
    }
    90% {
        opacity: 0.6;
    }
    100% {
        right: calc(100% + 20px);
        opacity: 0;
        transform: translateY(0);
    }
}

/* Supply Air Molecules Positioning */
.supply-air .air-molecule:nth-child(1) {
    top: 15%;
    animation-delay: 0s;
    background: rgba(59, 130, 246, 0.8);
}

.supply-air .air-molecule:nth-child(2) {
    top: 25%;
    animation-delay: 2s;
    background: rgba(16, 185, 129, 0.7);
}

.supply-air .air-molecule:nth-child(3) {
    top: 35%;
    animation-delay: 4s;
    background: rgba(139, 92, 246, 0.6);
}

.supply-air .air-molecule:nth-child(4) {
    top: 45%;
    animation-delay: 6s;
    background: rgba(6, 182, 212, 0.8);
}

.supply-air .air-molecule:nth-child(5) {
    top: 55%;
    animation-delay: 8s;
    background: rgba(59, 130, 246, 0.7);
}

.supply-air .air-molecule:nth-child(6) {
    top: 65%;
    animation-delay: 1s;
    background: rgba(16, 185, 129, 0.6);
}

.supply-air .air-molecule:nth-child(7) {
    top: 75%;
    animation-delay: 3s;
    background: rgba(139, 92, 246, 0.8);
}

.supply-air .air-molecule:nth-child(8) {
    top: 85%;
    animation-delay: 5s;
    background: rgba(6, 182, 212, 0.7);
}

.supply-air .air-molecule:nth-child(9) {
    top: 20%;
    animation-delay: 7s;
    background: rgba(59, 130, 246, 0.6);
}

.supply-air .air-molecule:nth-child(10) {
    top: 70%;
    animation-delay: 9s;
    background: rgba(16, 185, 129, 0.8);
}

/* Return Air Molecules */
.return-air .air-molecule {
    animation: returnFlow 15s linear infinite;
    background: rgba(107, 114, 128, 0.5);
    box-shadow: 0 0 4px rgba(107, 114, 128, 0.3);
}

.return-air .air-molecule:nth-child(1) {
    top: 30%;
    animation-delay: 0s;
}

.return-air .air-molecule:nth-child(2) {
    top: 50%;
    animation-delay: 3s;
}

.return-air .air-molecule:nth-child(3) {
    top: 70%;
    animation-delay: 6s;
}

.return-air .air-molecule:nth-child(4) {
    top: 40%;
    animation-delay: 9s;
}

.return-air .air-molecule:nth-child(5) {
    top: 60%;
    animation-delay: 12s;
}

/* Air Vents - Invisible but functional for mouse interaction */
.air-vent {
    position: absolute;
    width: 80px;
    height: 40px;
    opacity: 0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.supply-vent-1 {
    top: 10%;
    left: 5%;
}

.supply-vent-2 {
    bottom: 20%;
    left: 10%;
}

.return-vent {
    top: 50%;
    right: 8%;
}

/* Mouse interaction effects */
.air-molecule.enhanced {
    width: 6px;
    height: 6px;
    animation-duration: 6s;
    box-shadow: 0 0 12px currentColor;
    filter: brightness(1.5);
}

/* Mouse-accelerated particle effects */
.air-molecule.mouse-accelerated {
    transition: all 0.2s ease-out;
    z-index: 10;
}

.air-molecule.mouse-accelerated::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: inherit;
    border-radius: 50%;
    opacity: 0.5;
    animation: particleTrail 0.5s ease-out infinite;
}

@keyframes particleTrail {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Enhanced air vent interaction */
.air-vent:hover {
    opacity: 0.2;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1), transparent);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* Cursor effect in HVAC system */
.hvac-system {
    cursor: none;
}

.hvac-system::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(59, 130, 246, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    transition: all 0.1s ease;
    opacity: 0;
}

.hvac-system:hover::before {
    opacity: 1;
    animation: cursorPulse 1s ease-in-out infinite;
}

@keyframes cursorPulse {
    0%, 100% {
        transform: scale(1);
        border-color: rgba(59, 130, 246, 0.6);
    }
    50% {
        transform: scale(1.2);
        border-color: rgba(16, 185, 129, 0.8);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fan-container {
        width: 50px;
        height: 50px;
    }
    
    .fan-blade {
        width: 20px;
        height: 6px;
    }
    
    .air-flow {
        right: -25px;
        width: 25px;
        height: 2px;
    }
}

/* Additional fan-themed hover effects */
.single-feature.fan-enhanced:hover .icon-badge {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* External card titles styling - matching internal card title appearance */
.card-title-external {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    color: #1f2937;
    line-height: 1.4;
    direction: rtl;
    text-align: right;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Typewriter blinking cursor for external titles */
.card-title-external::after {
    content: '|';
    animation: blink 1s infinite;
    color: #2563eb;
    font-weight: normal;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Typewriter effect for card titles (legacy) */
.single-feature.fan-enhanced h5 {
    position: relative;
    overflow: hidden;
}

.single-feature.fan-enhanced h5::after {
    content: '|';
    position: absolute;
    color: currentColor;
    margin-left: 2px;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.single-feature.fan-enhanced:hover h5::after {
    opacity: 1;
    animation: typewriterCursor 1s infinite;
}

@keyframes typewriterCursor {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Wind effect on text (backup) */
.single-feature.fan-enhanced h5.wind-effect {
    animation: textWind 0.5s ease-in-out;
}

@keyframes textWind {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(2px);
    }
    75% {
        transform: translateX(-2px);
    }
}

/* Fan rotation - only for actual fans */
.fan-rotate-icon {
    animation: fanRotate 3s linear infinite;
    transform-origin: center;
}

/* Speed up fan rotation on hover */
.single-feature.fan-enhanced:hover .fan-rotate-icon {
    animation-duration: 1s;
}

/* Single gear rotation animation */
.gear-rotate-icon {
    animation: gearRotateClockwise 3s steps(12, end) infinite;
    transform-origin: center;
}

@keyframes gearRotateClockwise {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Speed up gear rotation on hover */
.single-feature.fan-enhanced:hover .gear-rotate-icon {
    animation-duration: 1s;
}

/* Education bounce animation */
.education-bounce-icon {
    animation: educationBounce 2s ease-in-out infinite;
    transform-origin: center;
}

@keyframes educationBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
}

.single-feature.fan-enhanced:hover .education-bounce-icon {
    animation-duration: 0.8s;
}

/* Tools shake animation */
.tools-shake-icon {
    animation: toolsShake 3s ease-in-out infinite;
    transform-origin: center;
}

@keyframes toolsShake {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-5deg) scale(1.02);
    }
    75% {
        transform: rotate(5deg) scale(1.02);
    }
}

.single-feature.fan-enhanced:hover .tools-shake-icon {
    animation-duration: 1s;
}

/* Enhanced Section Header Styles */
.section-header-container {
    position: relative;
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 3rem;
}

.enhanced-section-title {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1.3;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    direction: rtl;
    text-align: center;
}

.title-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #059669 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
    display: inline-block;
    margin-left: 0.5rem;
}

.title-highlight {
    color: #1f2937;
    font-weight: 600;
    display: inline-block;
    position: relative;
}

.title-highlight::before {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    border-radius: 2px;
    animation: underlineExpand 2s ease-out 1s forwards;
}

/* Title underline removed */

.enhanced-description-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(248,250,252,0.8) 100%);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(229,231,235,0.6);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.enhanced-description-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border-color: rgba(37,99,235,0.2);
}

.description-icon-wrapper {
    position: absolute;
    top: -15px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
    animation: iconFloat 3s ease-in-out infinite;
}

.description-icon {
    color: white;
    font-size: 18px;
    animation: iconGlow 2s ease-in-out infinite alternate;
}

.enhanced-description {
    color: #6b7280;
    font-size: 0.97rem;
    line-height: 1.8;
    text-align: center;
    margin: 0;
    font-weight: 400;
    direction: rtl;
    text-indent: 0;
    position: relative;
    padding-top: 0.5rem;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
}

/* First letter styling removed */

/* Animation keyframes */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes underlineExpand {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

@keyframes titleUnderlineGrow {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(10deg);
    }
}

@keyframes iconGlow {
    0% {
        filter: brightness(1);
    }
    100% {
        filter: brightness(1.3);
    }
}

/* Responsive adjustments for enhanced header */
@media (max-width: 768px) {
    .section-header-container {
        padding: 1.5rem 0;
        margin-bottom: 2rem;
    }
    
    .enhanced-description-container {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .enhanced-description {
        font-size: 1rem;
        text-indent: 1rem;
    }
    
    .description-icon-wrapper {
        right: 20px;
        width: 35px;
        height: 35px;
    }
    
    .description-icon {
        font-size: 16px;
    }
}
