/* ========================================
   MICRO-INTERACTIONS & TRANSITIONS
   Delightful UI animations
   ======================================== */

/* ========== 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: 200px;
    height: 200px;
}

/* ========== BUTTON HOVER EFFECTS ========== */
.btn-primary,
.btn-secondary,
button,
.contact-section .box,
.resume-wrap {
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    left: 100%;
}

/* ========== TEXT SELECTION ANIMATION ========== */
::selection {
    background: linear-gradient(135deg, #F96D00 0%, #FFAC00 100%);
    color: #ffffff;
    text-shadow: none;
}

::-moz-selection {
    background: linear-gradient(135deg, #F96D00 0%, #FFAC00 100%);
    color: #ffffff;
    text-shadow: none;
}

/* ========== LINK UNDERLINE ANIMATION ========== */
a {
    position: relative;
    display: inline-block;
}

a:not(.btn):not(.navbar-brand)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #F96D00, #FFAC00);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:not(.btn):not(.navbar-brand):hover::after {
    width: 100%;
}

/* ========== CARD SHINE EFFECT ========== */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

.card-shine:hover::before {
    animation: shine 1s ease;
}

@keyframes shine {
    0% {
        left: -50%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 150%;
        opacity: 0;
    }
}

/* ========== BOUNCE ON SCROLL ========== */
.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== SHAKE ANIMATION ========== */
.shake {
    animation: shake 0.5s;
}

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

/* ========== PULSE ANIMATION ========== */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(249, 109, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(249, 109, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(249, 109, 0, 0);
    }
}

/* ========== GLOW EFFECT ========== */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #F96D00, 0 0 20px #F96D00;
    }
    to {
        text-shadow: 0 0 10px #fff, 0 0 20px #FFAC00, 0 0 30px #FFAC00, 0 0 40px #FFAC00;
    }
}

/* ========== FLOAT ANIMATION ========== */
.float {
    animation: float 3s ease-in-out infinite;
}

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

/* ========== ROTATE ON HOVER ========== */
.rotate-on-hover {
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.rotate-on-hover:hover {
    transform: rotate(360deg) scale(1.1);
}

/* ========== FLIP CARD EFFECT ========== */
.flip-card {
    perspective: 1000px;
}

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

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

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

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

/* ========== SLIDE IN ANIMATIONS ========== */
.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-bottom {
    animation: slideInBottom 0.6s ease-out;
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== ZOOM IN ANIMATION ========== */
.zoom-in {
    animation: zoomIn 0.5s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== MORPH ANIMATION ========== */
.morph {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.morph:hover {
    border-radius: 50%;
}

/* ========== TEXT GRADIENT ANIMATION ========== */
.gradient-text-animated {
    background: linear-gradient(270deg, #F96D00, #FFAC00, #F96D00);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

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

/* ========== LOADING DOTS ========== */
.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* ========== TYPEWRITER EFFECT ========== */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #F96D00;
    white-space: nowrap;
    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: #F96D00;
    }
}

/* ========== ATTENTION SEEKER ========== */
.attention {
    animation: attention 1s ease-in-out infinite;
}

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

/* ========== PAGE TRANSITIONS ========== */
.page-enter {
    animation: pageEnter 0.5s ease-out;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-exit {
    animation: pageExit 0.5s ease-in;
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ========== FOCUS WITHIN ANIMATIONS ========== */
.form-group:focus-within {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

.form-group:focus-within label {
    color: #F96D00;
    transform: scale(0.9) translateY(-10px);
}

/* ========== SMOOTH TRANSITIONS FOR ALL ========== */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-duration: 200ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== REDUCED MOTION SUPPORT ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
