/* ==========================================
   MICRO-INTERACTIONS & HOVER EFFECTS
   Subtle animations and interactions for better UX
   ========================================== */

/* ==========================================
   BUTTON MICRO-INTERACTIONS
   ========================================== */

/* Ripple Effect on Click */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-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;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Button Bounce on Hover */
.btn-bounce:hover {
    animation: bounce 0.6s ease;
}

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

/* Button Pulse */
.btn-pulse {
    animation: pulse-btn 2s infinite;
}

@keyframes pulse-btn {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

/* Button Shake (for errors) */
.btn-shake {
    animation: shake 0.5s;
}

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

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

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

.btn-shine:hover::before {
    left: 100%;
}

/* Button Grow */
.btn-grow:hover {
    animation: grow 0.3s ease forwards;
}

@keyframes grow {
    to { transform: scale(1.08); }
}

/* ==========================================
   INPUT MICRO-INTERACTIONS
   ========================================== */

/* Input Focus Glow */
.input-glow:focus {
    animation: input-glow 1.5s infinite;
}

@keyframes input-glow {
    0%, 100% { box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2); }
    50% { box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.4); }
}

/* Input Label Float */
.input-float-label {
    position: relative;
}

.input-float-label input {
    padding-top: 20px;
}

.input-float-label label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.6);
}

.input-float-label input:focus + label,
.input-float-label input:not(:placeholder-shown) + label {
    top: 8px;
    font-size: 12px;
    color: var(--accent-gold);
}

/* Input Underline Animation */
.input-underline {
    position: relative;
}

.input-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.4s ease;
}

.input-underline:focus::after {
    width: 100%;
}

/* ==========================================
   CARD MICRO-INTERACTIONS
   ========================================== */

/* Card Tilt on Hover */
.card-tilt {
    transition: transform 0.3s ease;
}

.card-tilt:hover {
    transform: perspective(1000px) rotateY(5deg) rotateX(-5deg);
}

/* Card Flip */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

.card-flip-front,
.card-flip-back {
    backface-visibility: hidden;
}

.card-flip-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg);
}

/* Card Expand */
.card-expand {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.card-expand:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* Card Reveal */
.card-reveal {
    position: relative;
    overflow: hidden;
}

.card-reveal-content {
    position: absolute;
    bottom: -100%;
    left: 0;
    right: 0;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    transition: bottom 0.4s ease;
}

.card-reveal:hover .card-reveal-content {
    bottom: 0;
}

/* ==========================================
   ICON MICRO-INTERACTIONS
   ========================================== */

/* Icon Bounce */
.icon-bounce:hover {
    animation: icon-bounce 0.6s;
}

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

/* Icon Spin */
.icon-spin:hover {
    animation: icon-spin 0.6s ease;
}

@keyframes icon-spin {
    to { transform: rotate(360deg); }
}

/* Icon Wiggle */
.icon-wiggle:hover {
    animation: icon-wiggle 0.5s;
}

@keyframes icon-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* Icon Pop */
.icon-pop:hover {
    animation: icon-pop 0.3s;
}

@keyframes icon-pop {
    50% { transform: scale(1.3); }
}

/* Icon Glow */
.icon-glow:hover {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    transition: filter 0.3s ease;
}

/* ==========================================
   LINK MICRO-INTERACTIONS
   ========================================== */

/* Link Underline Slide */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* Link Bracket Effect */
.link-bracket {
    position: relative;
}

.link-bracket::before,
.link-bracket::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.3s ease;
}

.link-bracket::before {
    top: 0;
    left: 0;
}

.link-bracket::after {
    bottom: 0;
    right: 0;
}

.link-bracket:hover::before,
.link-bracket:hover::after {
    width: 100%;
}

/* ==========================================
   NOTIFICATION MICRO-INTERACTIONS
   ========================================== */

/* Notification Slide In */
.notification-slide-in {
    animation: slide-in-right 0.4s ease;
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Notification Bounce In */
.notification-bounce-in {
    animation: bounce-in 0.6s ease;
}

@keyframes bounce-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================
   TOOLTIP MICRO-INTERACTIONS
   ========================================== */

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(10, 14, 39, 0.95);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(10, 14, 39, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
}

/* ==========================================
   PROGRESS BAR MICRO-INTERACTIONS
   ========================================== */

/* Progress Bar Animate */
.progress-animate {
    animation: progress-grow 1.5s ease;
}

@keyframes progress-grow {
    from { width: 0; }
}

/* Progress Pulse */
.progress-pulse {
    animation: progress-pulse 2s infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ==========================================
   BADGE MICRO-INTERACTIONS
   ========================================== */

/* Badge Pop In */
.badge-pop-in {
    animation: badge-pop 0.4s ease;
}

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

/* Badge Wiggle */
.badge-wiggle {
    animation: badge-wiggle 1s ease infinite;
}

@keyframes badge-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* ==========================================
   CHECKBOX/RADIO MICRO-INTERACTIONS
   ========================================== */

/* Checkbox Checkmark Animation */
.checkbox-animated input[type="checkbox"]:checked + label::after {
    animation: checkmark 0.4s ease;
}

@keyframes checkmark {
    0% {
        height: 0;
        width: 0;
    }
    50% {
        height: 0;
        width: 8px;
    }
    100% {
        height: 12px;
        width: 8px;
    }
}

/* Radio Ripple */
.radio-ripple input[type="radio"]:checked + label::before {
    animation: radio-ripple 0.6s ease;
}

@keyframes radio-ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    100% {
        box-shadow: 0 0 0 20px rgba(102, 126, 234, 0);
    }
}

/* ==========================================
   DROPDOWN MICRO-INTERACTIONS
   ========================================== */

/* Dropdown Slide Down */
.dropdown-slide {
    animation: dropdown-slide 0.3s ease;
}

@keyframes dropdown-slide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   IMAGE MICRO-INTERACTIONS
   ========================================== */

/* Image Zoom on Hover */
.image-zoom {
    overflow: hidden;
}

.image-zoom img {
    transition: transform 0.6s ease;
}

.image-zoom:hover img {
    transform: scale(1.15);
}

/* Image Grayscale to Color */
.image-grayscale img {
    filter: grayscale(100%);
    transition: filter 0.4s ease;
}

.image-grayscale:hover img {
    filter: grayscale(0%);
}

/* ==========================================
   SKELETON LOADING
   ========================================== */

/* Skeleton Shimmer */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ==========================================
   SCROLL ANIMATIONS
   ========================================== */

/* Scroll Fade In */
.scroll-fade {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.scroll-fade.visible {
    opacity: 1;
}

/* Scroll Slide Up */
.scroll-slide-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.6s ease;
}

.scroll-slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

/* Smooth Transition */
.transition-smooth {
    transition: all 0.3s ease;
}

.transition-slow {
    transition: all 0.6s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

/* No Select (prevent text selection) */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Cursor Pointer */
.cursor-pointer {
    cursor: pointer;
}

/* Disabled State */
.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}
