/* ========================================
   Fun Animated Profile Squares for index.php
   ======================================== */

/* Base animation setup */
.animated-square {
    animation: fadeInUp 0.8s ease-out forwards, floatAnimation 6s ease-in-out infinite;
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Staggered fade-in animation based on data-delay attribute */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Continuous floating/bobbing animation */
@keyframes floatAnimation {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(0.5deg);
    }
    50% {
        transform: translateY(0px) rotate(0deg);
    }
    75% {
        transform: translateY(-5px) rotate(-0.5deg);
    }
}

/* Add variety with alternating animation delays */
.animated-square:nth-child(2n) {
    animation: fadeInUp 0.8s ease-out forwards, floatAnimation 7s ease-in-out infinite;
    animation-delay: 0.1s, 0.5s;
}

.animated-square:nth-child(3n) {
    animation: fadeInUp 0.8s ease-out forwards, floatAnimation 8s ease-in-out infinite;
    animation-delay: 0.2s, 1s;
}

.animated-square:nth-child(4n) {
    animation: fadeInUp 0.8s ease-out forwards, floatAnimation 6.5s ease-in-out infinite;
    animation-delay: 0.15s, 1.5s;
}

/* Hover effects - make them interactive! */
.animated-square:hover {
    transform: scale(1.05) translateY(-5px);
    z-index: 100 !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    animation: floatAnimation 2s ease-in-out infinite;
}

.animated-square:hover .graypic {
    -webkit-filter: grayscale(0%) !important;
    filter: grayscale(0%) !important;
    transform: scale(1.05);
    transition: all 0.4s ease;
}

/* Smooth image transitions */
.graypic {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Add a subtle pulse to random squares */
@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 15px rgba(0, 150, 200, 0.3);
    }
}

.animated-square:nth-child(5n) {
    animation: fadeInUp 0.8s ease-out forwards, 
               floatAnimation 7s ease-in-out infinite,
               subtlePulse 4s ease-in-out infinite;
    animation-delay: 0.25s, 1s, 2s;
}

/* Parallax-like effect on scroll */
@keyframes parallaxShift {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-20px);
    }
}

/* Add slight rotation variety */
.animated-square:nth-child(7n) {
    transform: rotate(0.5deg);
}

.animated-square:nth-child(11n) {
    transform: rotate(-0.5deg);
}

/* Color tint on hover for fun */
.animated-square:hover .cover {
    background: linear-gradient(135deg, rgba(0, 150, 255, 0.1), rgba(255, 50, 150, 0.1));
}

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

.animated-square:nth-child(13n)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 6s infinite;
    pointer-events: none;
    z-index: 1;
}

/* Smooth overlay transitions */
.animated-square .overlay {
    transition: all 0.3s ease;
}

.animated-square:hover .overlay {
    background: rgba(0, 0, 0, 0.3);
}

/* Make the online indicator pulse */
.animated-square .v-bottom img {
    animation: onlinePulse 2s ease-in-out infinite;
}

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

/* Add entrance animation variety */
.animated-square:nth-child(even) {
    animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Prevent animation performance issues */
.animated-square {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Mobile optimization - reduce animations on small screens */
@media (max-width: 768px) {
    .animated-square {
        animation: fadeInUp 0.6s ease-out forwards !important;
    }
    
    .animated-square:hover {
        transform: scale(1.02) !important;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .animated-square,
    .animated-square *,
    .graypic {
        animation: none !important;
        transition: none !important;
    }
    
    .animated-square {
        opacity: 1 !important;
    }
}

/* ========================================
   Show/Hide Password Toggle
   ======================================== */

#togglePassword {
    transition: all 0.3s ease;
    user-select: none;
}

#togglePassword:hover {
    background-color: #e0e0e0 !important;
    color: #333;
}

#togglePassword:active {
    background-color: #d0d0d0 !important;
    transform: scale(0.95);
}

#togglePasswordIcon {
    transition: all 0.2s ease;
    color: #666;
}

#togglePassword:hover #togglePasswordIcon {
    color: #333;
}

/* Smooth icon transition */
.fa-eye, .fa-eye-slash {
    display: inline-block;
}

