/**
 * Animations Stylesheet - Safi Gold Trading
 * Smooth animations and hover effects
 */

/* ===================================
   FADE ANIMATIONS
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

.fade-in-up {
    animation: fadeInUp var(--transition-slow) ease-out;
}

.fade-in-down {
    animation: fadeInDown var(--transition-slow) ease-out;
}

.fade-in-left {
    animation: fadeInLeft var(--transition-slow) ease-out;
}

.fade-in-right {
    animation: fadeInRight var(--transition-slow) ease-out;
}

/* ===================================
   ZOOM ANIMATIONS
   =================================== */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

.zoom-in {
    animation: zoomIn var(--transition-normal) ease-out;
}

.zoom-out {
    animation: zoomOut var(--transition-normal) ease-out;
}

/* ===================================
   SLIDE ANIMATIONS
   =================================== */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.slide-in-up {
    animation: slideInUp var(--transition-slow) ease-out;
}

.slide-in-down {
    animation: slideInDown var(--transition-slow) ease-out;
}

.slide-in-left {
    animation: slideInLeft var(--transition-slow) ease-out;
}

.slide-in-right {
    animation: slideInRight var(--transition-slow) ease-out;
}

/* ===================================
   BOUNCE ANIMATIONS
   =================================== */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

.bounce-in {
    animation: bounceIn var(--transition-slow) ease-out;
}

/* ===================================
   PULSE ANIMATIONS
   =================================== */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes pulse-shadow {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(212, 175, 55, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

.pulse-shadow {
    animation: pulse-shadow 2s infinite;
}

/* ===================================
   ROTATE ANIMATIONS
   =================================== */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinReverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

.spin {
    animation: spin 2s linear infinite;
}

.spin-reverse {
    animation: spinReverse 2s linear infinite;
}

/* ===================================
   FLIP ANIMATIONS
   =================================== */
@keyframes flipInX {
    from {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateX(0);
        opacity: 1;
    }
}

@keyframes flipInY {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0);
        opacity: 1;
    }
}

.flip-in-x {
    animation: flipInX var(--transition-slow) ease-out;
}

.flip-in-y {
    animation: flipInY var(--transition-slow) ease-out;
}

/* ===================================
   SHIMMER EFFECT (For Loading)
   =================================== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ===================================
   TYPING EFFECT
   =================================== */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typing-effect {
    overflow: hidden;
    border-right: 3px solid var(--color-gold);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* ===================================
   PARALLAX EFFECT
   =================================== */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ===================================
   HOVER EFFECTS
   =================================== */

/* Glow Effect */
.hover-glow {
    transition: all var(--transition-fast);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

/* Scale Up */
.hover-scale-up {
    transition: transform var(--transition-fast);
}

.hover-scale-up:hover {
    transform: scale(1.1);
}

/* Scale Down */
.hover-scale-down {
    transition: transform var(--transition-fast);
}

.hover-scale-down:hover {
    transform: scale(0.95);
}

/* Rotate on Hover */
.hover-rotate {
    transition: transform var(--transition-fast);
}

.hover-rotate:hover {
    transform: rotate(15deg);
}

/* Slide Arrow */
.hover-slide-arrow {
    position: relative;
    transition: padding-left var(--transition-fast);
}

.hover-slide-arrow:hover {
    padding-left: 10px;
}

.hover-slide-arrow::after {
    content: '→';
    position: absolute;
    right: -20px;
    opacity: 0;
    transition: all var(--transition-fast);
}

.hover-slide-arrow:hover::after {
    right: 0;
    opacity: 1;
}

/* Underline Animation */
.hover-underline {
    position: relative;
    display: inline-block;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-gold);
    transition: width var(--transition-fast);
}

.hover-underline:hover::after {
    width: 100%;
}

/* Border Draw */
.hover-border-draw {
    position: relative;
    background: transparent;
    z-index: 1;
}

.hover-border-draw::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--color-gold);
    transform: scale(0.9);
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: -1;
}

.hover-border-draw:hover::before {
    transform: scale(1);
    opacity: 1;
}

/* Fill Background */
.hover-fill {
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.hover-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--color-gold);
    transition: left var(--transition-fast);
    z-index: -1;
}

.hover-fill:hover::before {
    left: 0;
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ===================================
   SCROLL ANIMATIONS (Triggered by JS)
   =================================== */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--transition-slow);
}

.scroll-animate.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   LOADING SPINNER
   =================================== */
@keyframes loader {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--color-gold);
    border-radius: 50%;
    animation: loader 1s linear infinite;
}

/* ===================================
   FLOATING ANIMATION
   =================================== */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* ===================================
   HEARTBEAT ANIMATION
   =================================== */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.15);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.15);
    }
    70% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* ===================================
   DELAY UTILITIES
   =================================== */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

.delay-600 {
    animation-delay: 0.6s;
}

.delay-700 {
    animation-delay: 0.7s;
}

.delay-800 {
    animation-delay: 0.8s;
}

.delay-900 {
    animation-delay: 0.9s;
}

.delay-1000 {
    animation-delay: 1s;
}

/* ===================================
   HERO BACKGROUND IMAGE
   =================================== */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    animation: slowZoomPan 30s ease-in-out infinite;
}

/* Slow zoom and pan animation */
@keyframes slowZoomPan {
    0% {
        transform: scale(1) translate(0, 0);
    }
    25% {
        transform: scale(1.05) translate(-2%, -2%);
    }
    50% {
        transform: scale(1.1) translate(0, 0);
    }
    75% {
        transform: scale(1.05) translate(2%, 2%);
    }
    100% {
        transform: scale(1) translate(0, 0);
    }
}

/* Fallback if image doesn't load */
.hero {
    background: linear-gradient(135deg, var(--color-dark) 0%, #1a1a1a 100%);
}
