/**
 * LA TANDA - Dashboard Polish CSS
 * Animations, transitions, and visual enhancements
 * Version: 1.0.0
 * Added: 2026-01-26
 */

/* ================================================
   KEYFRAME ANIMATIONS
   ================================================ */

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in from left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in scale */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse glow effect */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
    }
}

/* Shimmer loading effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Bounce subtle */
@keyframes bounceSubtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Ripple effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ================================================
   SOCIAL FEED CARD ANIMATIONS
   ================================================ */

/* Cards animate in when loaded */
.social-feed-card {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

/* Stagger animation for multiple cards */
.social-feed-card:nth-child(1) { animation-delay: 0s; }
.social-feed-card:nth-child(2) { animation-delay: 0.05s; }
.social-feed-card:nth-child(3) { animation-delay: 0.1s; }
.social-feed-card:nth-child(4) { animation-delay: 0.15s; }
.social-feed-card:nth-child(5) { animation-delay: 0.2s; }

/* Card hover lift effect */
.social-feed-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.social-feed-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Card focus state for keyboard navigation */
.social-feed-card:focus,
.social-feed-card.keyboard-focused {
    outline: none;
    border-color: rgba(0, 255, 255, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.2), 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ================================================
   ENGAGEMENT BUTTON ANIMATIONS
   ================================================ */

/* Like button heart animation */
.engagement-btn.liked i {
    animation: bounceSubtle 0.3s ease;
}

/* Bookmark animation */
.engagement-btn.bookmarked i {
    animation: fadeInScale 0.2s ease;
}

/* Button ripple effect container */
.engagement-btn {
    position: relative;
    overflow: hidden;
}

.engagement-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(0, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.engagement-btn:active::after {
    animation: ripple 0.4s ease-out;
}

/* ================================================
   SIDEBAR WIDGET ANIMATIONS
   ================================================ */

/* Hub cards animate in */
.hub-card-mini {
    animation: fadeInLeft 0.3s ease-out;
    animation-fill-mode: both;
}

.hub-card-mini:nth-child(1) { animation-delay: 0s; }
.hub-card-mini:nth-child(2) { animation-delay: 0.1s; }
.hub-card-mini:nth-child(3) { animation-delay: 0.2s; }
.hub-card-mini:nth-child(4) { animation-delay: 0.3s; }

/* Who to follow item animation */
.who-to-follow-item {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

/* Trending item hover */
.trending-item {
    transition: background 0.2s ease, transform 0.2s ease;
}

.trending-item:hover {
    transform: translateX(4px);
}

/* ================================================
   NAVIGATION ANIMATIONS
   ================================================ */

/* Nav menu items */
.nav-menu-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu-item:hover {
    transform: translateX(4px);
}

.nav-menu-item.active {
    position: relative;
}

.nav-menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: #00FFFF;
    border-radius: 0 2px 2px 0;
    animation: fadeInLeft 0.2s ease;
}

/* Post button pulse */
.nav-post-btn {
    transition: all 0.2s ease;
}

.nav-post-btn:hover {
    animation: pulseGlow 1.5s ease-in-out infinite;
}

/* ================================================
   LOADING STATES
   ================================================ */

/* Skeleton loading placeholder */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

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

.skeleton-text {
    height: 14px;
    margin: 8px 0;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

/* ================================================
   SCROLL ENHANCEMENTS
   ================================================ */

/* Smooth scroll for entire page */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for main feed */
.main-feed::-webkit-scrollbar {
    width: 6px;
}

.main-feed::-webkit-scrollbar-track {
    background: transparent;
}

.main-feed::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.2);
    border-radius: 3px;
}

.main-feed::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.4);
}

/* Hide scrollbar on sidebars but allow scroll */
.left-sidebar,
.right-sidebar-sticky {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 255, 0.2) transparent;
}

/* ================================================
   KEYBOARD NAVIGATION INDICATORS
   ================================================ */

/* Show focus ring only for keyboard users */
.using-keyboard *:focus {
    outline: 2px solid rgba(0, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #00FFFF;
    color: #000;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
}

/* ================================================
   TOOLTIP STYLES
   ================================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* ================================================
   PERFORMANCE OPTIMIZATIONS
   ================================================ */

/* GPU acceleration for animated elements */
.social-feed-card,
.hub-card-mini,
.who-to-follow-item,
.trending-item,
.nav-menu-item,
.mobile-drawer,
.mobile-fab {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ================================================
   DARK MODE ENHANCEMENTS
   ================================================ */

/* Subtle glow on interactive elements in dark mode */
@media (prefers-color-scheme: dark) {
    .nav-post-btn:hover,
    .mobile-fab:hover {
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
    }
}
