/* 
* Animations CSS for Fajer Al-Sama Contracting Company Website
* Advanced animations and effects
*/

/* Reveal Animation */
.reveal {
    position: relative;
    opacity: 0;
    transition: all 1s ease;
}

.reveal.revealed {
    opacity: 1;
}

.reveal.active {
    opacity: 1;
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 1.5s ease forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Fade In Up Animation */
.fade-in-up {
    animation: fadeInUp 1.5s ease forwards;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down Animation */
.fade-in-down {
    animation: fadeInDown 1.5s ease forwards;
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left Animation */
.fade-in-left {
    animation: fadeInLeft 1.5s ease forwards;
}

@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right Animation */
.fade-in-right {
    animation: fadeInRight 1.5s ease forwards;
}

@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom In Animation */
.zoom-in {
    animation: zoomIn 1.5s ease forwards;
}

@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Zoom Out Animation */
.zoom-out {
    animation: zoomOut 1.5s ease forwards;
}

@keyframes zoomOut {
    0% {
        opacity: 0;
        transform: scale(1.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease infinite;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Floating Animation */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Typing Animation */
.typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #f39c12;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #f39c12;
    }
}

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(45deg, #f39c12, #e67e22, #d35400, #f39c12);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 5s ease infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Shine Effect */
.shine {
    position: relative;
    overflow: hidden;
}

.shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 100%);
    transform: skewX(-25deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    20% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }
    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

/* 3D Flip Animation */
.flip-3d {
    perspective: 1000px;
}

.flip-3d-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-3d:hover .flip-3d-inner {
    transform: rotateY(180deg);
}

.flip-3d-front, .flip-3d-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-3d-back {
    transform: rotateY(180deg);
}

/* Slide In Animation */
.slide-in {
    animation: slideIn 1.5s ease forwards;
}

@keyframes slideIn {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Slide Out Animation */
.slide-out {
    animation: slideOut 1.5s ease forwards;
}

@keyframes slideOut {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Rotate Animation */
.rotate {
    animation: rotate 2s linear infinite;
}

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

/* Scale Animation */
.scale {
    animation: scale 2s ease infinite;
}

@keyframes scale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Blur In Animation */
.blur-in {
    animation: blurIn 1.5s ease forwards;
}

@keyframes blurIn {
    0% {
        opacity: 0;
        filter: blur(20px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
    }
}

/* Blur Out Animation */
.blur-out {
    animation: blurOut 1.5s ease forwards;
}

@keyframes blurOut {
    0% {
        opacity: 1;
        filter: blur(0);
    }
    100% {
        opacity: 0;
        filter: blur(20px);
    }
}

/* Swing Animation */
.swing {
    animation: swing 2s ease infinite;
    transform-origin: top center;
}

@keyframes swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
}

/* Tada Animation */
.tada {
    animation: tada 2s ease infinite;
}

@keyframes tada {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    10%, 20% {
        transform: scale(0.9) rotate(-3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale(1.1) rotate(3deg);
    }
    40%, 60%, 80% {
        transform: scale(1.1) rotate(-3deg);
    }
}

/* Wobble Animation */
.wobble {
    animation: wobble 2s ease infinite;
}

@keyframes wobble {
    0%, 100% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25%) rotate(-5deg);
    }
    30% {
        transform: translateX(20%) rotate(3deg);
    }
    45% {
        transform: translateX(-15%) rotate(-3deg);
    }
    60% {
        transform: translateX(10%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
}

/* Heartbeat Animation */
.heartbeat {
    animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

/* Jello Animation */
.jello {
    animation: jello 2s ease infinite;
}

@keyframes jello {
    0%, 11.1%, 100% {
        transform: none;
    }
    22.2% {
        transform: skewX(-12.5deg) skewY(-12.5deg);
    }
    33.3% {
        transform: skewX(6.25deg) skewY(6.25deg);
    }
    44.4% {
        transform: skewX(-3.125deg) skewY(-3.125deg);
    }
    55.5% {
        transform: skewX(1.5625deg) skewY(1.5625deg);
    }
    66.6% {
        transform: skewX(-0.78125deg) skewY(-0.78125deg);
    }
    77.7% {
        transform: skewX(0.390625deg) skewY(0.390625deg);
    }
    88.8% {
        transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
    }
}

/* Rubber Band Animation */
.rubber-band {
    animation: rubberBand 2s ease infinite;
}

@keyframes rubberBand {
    0%, 100% {
        transform: scale(1, 1);
    }
    30% {
        transform: scale(1.25, 0.75);
    }
    40% {
        transform: scale(0.75, 1.25);
    }
    50% {
        transform: scale(1.15, 0.85);
    }
    65% {
        transform: scale(0.95, 1.05);
    }
    75% {
        transform: scale(1.05, 0.95);
    }
}

/* Hinge Animation */
.hinge {
    animation: hinge 2s ease infinite;
    transform-origin: top left;
}

@keyframes hinge {
    0% {
        transform: rotate(0);
    }
    20%, 60% {
        transform: rotate(80deg);
    }
    40%, 80% {
        transform: rotate(60deg);
    }
    100% {
        transform: rotate(0);
    }
}

/* Roll In Animation */
.roll-in {
    animation: rollIn 1.5s ease forwards;
}

@keyframes rollIn {
    0% {
        opacity: 0;
        transform: translateX(-100%) rotate(-120deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotate(0);
    }
}

/* Roll Out Animation */
.roll-out {
    animation: rollOut 1.5s ease forwards;
}

@keyframes rollOut {
    0% {
        opacity: 1;
        transform: translateX(0) rotate(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%) rotate(120deg);
    }
}

/* Light Speed In Animation */
.light-speed-in {
    animation: lightSpeedIn 1.5s ease forwards;
}

@keyframes lightSpeedIn {
    0% {
        opacity: 0;
        transform: translateX(100%) skewX(-30deg);
    }
    60% {
        opacity: 1;
        transform: translateX(-20%) skewX(30deg);
    }
    80% {
        transform: translateX(0) skewX(-15deg);
    }
    100% {
        transform: translateX(0) skewX(0);
    }
}

/* Light Speed Out Animation */
.light-speed-out {
    animation: lightSpeedOut 1.5s ease forwards;
}

@keyframes lightSpeedOut {
    0% {
        opacity: 1;
        transform: translateX(0) skewX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%) skewX(30deg);
    }
}

/* Flip In X Animation */
.flip-in-x {
    animation: flipInX 1.5s ease forwards;
}

@keyframes flipInX {
    0% {
        opacity: 0;
        transform: rotateX(90deg);
    }
    40% {
        transform: rotateX(-20deg);
    }
    60% {
        transform: rotateX(10deg);
    }
    80% {
        transform: rotateX(-5deg);
    }
    100% {
        opacity: 1;
        transform: rotateX(0);
    }
}

/* Flip In Y Animation */
.flip-in-y {
    animation: flipInY 1.5s ease forwards;
}

@keyframes flipInY {
    0% {
        opacity: 0;
        transform: rotateY(90deg);
    }
    40% {
        transform: rotateY(-20deg);
    }
    60% {
        transform: rotateY(10deg);
    }
    80% {
        transform: rotateY(-5deg);
    }
    100% {
        opacity: 1;
        transform: rotateY(0);
    }
}

/* Flip Out X Animation */
.flip-out-x {
    animation: flipOutX 1.5s ease forwards;
}

@keyframes flipOutX {
    0% {
        opacity: 1;
        transform: rotateX(0);
    }
    100% {
        opacity: 0;
        transform: rotateX(90deg);
    }
}

/* Flip Out Y Animation */
.flip-out-y {
    animation: flipOutY 1.5s ease forwards;
}

@keyframes flipOutY {
    0% {
        opacity: 1;
        transform: rotateY(0);
    }
    100% {
        opacity: 0;
        transform: rotateY(90deg);
    }
}

/* Rotate In Animation */
.rotate-in {
    animation: rotateIn 1.5s ease forwards;
}

@keyframes rotateIn {
    0% {
        opacity: 0;
        transform: rotate(-200deg);
    }
    100% {
        opacity: 1;
        transform: rotate(0);
    }
}

/* Rotate Out Animation */
.rotate-out {
    animation: rotateOut 1.5s ease forwards;
}

@keyframes rotateOut {
    0% {
        opacity: 1;
        transform: rotate(0);
    }
    100% {
        opacity: 0;
        transform: rotate(200deg);
    }
}

/* Jump Animation */
.jump {
    animation: jump 1s ease infinite;
}

@keyframes jump {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Spin Animation */
.spin {
    animation: spin 2s linear infinite;
}

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

/* Grow Animation */
.grow {
    animation: grow 1.5s ease forwards;
}

@keyframes grow {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

/* Shrink Animation */
.shrink {
    animation: shrink 1.5s ease forwards;
}

@keyframes shrink {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

/* Slide Up Animation */
.slide-up {
    animation: slideUp 1.5s ease forwards;
}

@keyframes slideUp {
    0% {
        transform: translateY(100%);
    }
    100% {
        transform: translateY(0);
    }
}

/* Slide Down Animation */
.slide-down {
    animation: slideDown 1.5s ease forwards;
}

@keyframes slideDown {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(0);
    }
}

/* Slide Left Animation */
.slide-left {
    animation: slideLeft 1.5s ease forwards;
}

@keyframes slideLeft {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Slide Right Animation */
.slide-right {
    animation: slideRight 1.5s ease forwards;
}

@keyframes slideRight {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Fade Out Animation */
.fade-out {
    animation: fadeOut 1.5s ease forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Fade Out Up Animation */
.fade-out-up {
    animation: fadeOutUp 1.5s ease forwards;
}

@keyframes fadeOutUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

/* Fade Out Down Animation */
.fade-out-down {
    animation: fadeOutDown 1.5s ease forwards;
}

@keyframes fadeOutDown {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(50px);
    }
}

/* Fade Out Left Animation */
.fade-out-left {
    animation: fadeOutLeft 1.5s ease forwards;
}

@keyframes fadeOutLeft {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50px);
    }
}

/* Fade Out Right Animation */
.fade-out-right {
    animation: fadeOutRight 1.5s ease forwards;
}

@keyframes fadeOutRight {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(50px);
    }
}

/* Delay Classes */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

.delay-6 {
    animation-delay: 0.6s;
}

.delay-7 {
    animation-delay: 0.7s;
}

.delay-8 {
    animation-delay: 0.8s;
}

.delay-9 {
    animation-delay: 0.9s;
}

.delay-10 {
    animation-delay: 1s;
}

.delay-15 {
    animation-delay: 1.5s;
}

.delay-20 {
    animation-delay: 2s;
}

/* Duration Classes */
.duration-1 {
    animation-duration: 0.1s;
}

.duration-2 {
    animation-duration: 0.2s;
}

.duration-3 {
    animation-duration: 0.3s;
}

.duration-4 {
    animation-duration: 0.4s;
}

.duration-5 {
    animation-duration: 0.5s;
}

.duration-10 {
    animation-duration: 1s;
}

.duration-15 {
    animation-duration: 1.5s;
}

.duration-20 {
    animation-duration: 2s;
}

.duration-25 {
    animation-duration: 2.5s;
}

.duration-30 {
    animation-duration: 3s;
}

/* Iteration Classes */
.iteration-1 {
    animation-iteration-count: 1;
}

.iteration-2 {
    animation-iteration-count: 2;
}

.iteration-3 {
    animation-iteration-count: 3;
}

.iteration-4 {
    animation-iteration-count: 4;
}

.iteration-5 {
    animation-iteration-count: 5;
}

.iteration-infinite {
    animation-iteration-count: infinite;
}

/* Direction Classes */
.direction-normal {
    animation-direction: normal;
}

.direction-reverse {
    animation-direction: reverse;
}

.direction-alternate {
    animation-direction: alternate;
}

.direction-alternate-reverse {
    animation-direction: alternate-reverse;
}

/* Fill Mode Classes */
.fill-none {
    animation-fill-mode: none;
}

.fill-forwards {
    animation-fill-mode: forwards;
}

.fill-backwards {
    animation-fill-mode: backwards;
}

.fill-both {
    animation-fill-mode: both;
}

/* Timing Function Classes */
.timing-linear {
    animation-timing-function: linear;
}

.timing-ease {
    animation-timing-function: ease;
}

.timing-ease-in {
    animation-timing-function: ease-in;
}

.timing-ease-out {
    animation-timing-function: ease-out;
}

.timing-ease-in-out {
    animation-timing-function: ease-in-out;
}

/* Play State Classes */
.play-running {
    animation-play-state: running;
}

.play-paused {
    animation-play-state: paused;
}

/* Animation Utilities */
.animate-on-scroll {
    opacity: 0;
    transition: all 1s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
}

.animate-on-hover:hover {
    animation-play-state: running !important;
}

.animate-on-hover {
    animation-play-state: paused !important;
}

.animate-once {
    animation-iteration-count: 1 !important;
}

.animate-twice {
    animation-iteration-count: 2 !important;
}

.animate-thrice {
    animation-iteration-count: 3 !important;
}

.animate-infinite {
    animation-iteration-count: infinite !important;
}

.animate-fast {
    animation-duration: 0.5s !important;
}

.animate-slow {
    animation-duration: 2s !important;
}

.animate-slower {
    animation-duration: 3s !important;
}

.animate-slowest {
    animation-duration: 4s !important;
}

.animate-delay-none {
    animation-delay: 0s !important;
}

.animate-delay-short {
    animation-delay: 0.3s !important;
}

.animate-delay-medium {
    animation-delay: 0.6s !important;
}

.animate-delay-long {
    animation-delay: 1s !important;
}

.animate-delay-longer {
    animation-delay: 1.5s !important;
}

.animate-delay-longest {
    animation-delay: 2s !important;
}

/* Responsive Animations */
@media (max-width: 991px) {
    .animate-md-none {
        animation: none !important;
    }
}

@media (max-width: 767px) {
    .animate-sm-none {
        animation: none !important;
    }
}

@media (max-width: 575px) {
    .animate-xs-none {
        animation: none !important;
    }
}
