/* ===================================
   Dream X - Enhanced Animations & Effects
   10x CSS Enhancement with jaw-dropping visuals
   =================================== */

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

/* Floating animation for elements */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

/* Gradient animation */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

/* Electric Pulse Glow - Logo Theme */
@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 77, 255, 0.4), 0 0 15px rgba(63, 214, 255, 0.3);
    }
    50% { 
        box-shadow: 0 0 40px rgba(255, 77, 255, 0.8), 0 0 60px rgba(63, 214, 255, 0.6), 0 0 80px rgba(165, 60, 255, 0.5);
    }
}

/* Electric Glow Animation - Dual Color */
@keyframes electricGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 77, 255, 0.6)) drop-shadow(0 0 12px rgba(63, 214, 255, 0.4));
        box-shadow: 0 0 15px rgba(255, 77, 255, 0.3), 0 0 10px rgba(63, 214, 255, 0.2);
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(255, 77, 255, 0.9)) drop-shadow(0 0 24px rgba(63, 214, 255, 0.7)) drop-shadow(0 0 32px rgba(165, 60, 255, 0.5));
        box-shadow: 0 0 30px rgba(255, 77, 255, 0.6), 0 0 25px rgba(63, 214, 255, 0.5), 0 0 35px rgba(165, 60, 255, 0.4);
    }
}

/* Electric Spark Animation */
@keyframes electricSpark {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
        filter: brightness(1);
    }
    25% {
        opacity: 1;
        transform: scale(1.1);
        filter: brightness(1.5);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
        filter: brightness(1.2);
    }
    75% {
        opacity: 1;
        transform: scale(1.15);
        filter: brightness(1.8);
    }
}

/* Electric Wave Animation */
@keyframes electricWave {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    50% {
        background-position: 100% 50%;
        filter: hue-rotate(180deg);
    }
    100% {
        background-position: 0% 50%;
        filter: hue-rotate(360deg);
    }
}

/* Cosmic Pulse - Dark background with electric accents */
@keyframes cosmicPulse {
    0%, 100% {
        background: radial-gradient(circle at 20% 50%, rgba(255, 77, 255, 0.08) 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, rgba(63, 214, 255, 0.06) 0%, transparent 50%),
                    #0B0A14;
    }
    50% {
        background: radial-gradient(circle at 20% 50%, rgba(255, 77, 255, 0.15) 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, rgba(63, 214, 255, 0.12) 0%, transparent 50%),
                    #0B0A14;
    }
}

/* Scale bounce */
@keyframes scaleBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Slide in from bottom */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in zoom */
@keyframes fadeInZoom {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotate gradient */
@keyframes rotateGradient {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

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

/* Particle float */
@keyframes particleFloat {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

/* === ENHANCED NAVBAR === */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(11, 10, 20, 0.95) !important;
    border-bottom: 1px solid rgba(255, 77, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.logo a {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.logo a .logo-text {
    background: linear-gradient(135deg, #FF4DFF, #D845FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #FF4DFF, #3FD6FF);
    transition: width 0.3s ease;
}

.logo a:hover::after {
    width: 100%;
}

/* Enhanced nav links */
.nav-links a {
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
}

.nav-links a:hover::before {
    left: 100%;
}

/* === ENHANCED HERO SECTION === */
.hero {
    background: linear-gradient(-45deg, #3FD6FF, #A53CFF, #FF4DFF, #D845FF);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s linear infinite;
}

.hero-title {
    animation: slideInUp 0.8s ease-out;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    animation: slideInUp 1s ease-out 0.2s both;
}

.hero-buttons {
    animation: slideInUp 1.2s ease-out 0.4s both;
}

/* === ENHANCED BUTTONS === */
.btn, .btn-primary, .btn-secondary, .btn-outline {
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 77, 255, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #FF4DFF, #D845FF);
    box-shadow: 0 4px 15px rgba(255, 77, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #D845FF, #FF4DFF);
    box-shadow: 0 8px 25px rgba(255, 77, 255, 0.4);
}

/* === CARD ENHANCEMENTS === */
.feature-card, .pricing-card, .billing-card, .card {
    animation: fadeInZoom 0.6s ease-out both;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 77, 255, 0.1);
}

.feature-card:hover, .pricing-card:hover, .billing-card:hover, .card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 40px rgba(255, 77, 255, 0.1);
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

/* === FLOATING ELEMENTS === */
.float-element {
    animation: float 6s ease-in-out infinite;
}

.float-slow {
    animation: floatSlow 8s ease-in-out infinite;
}

/* === SECTION ANIMATIONS === */
.section {
    animation: slideInUp 0.8s ease-out both;
}

.section:nth-of-type(even) {
    animation: slideInLeft 0.8s ease-out both;
}

.section:nth-of-type(odd) {
    animation: slideInRight 0.8s ease-out both;
}

/* === ENHANCED BACKGROUNDS === */
.gradient-bg {
    background: linear-gradient(-45deg, #3FD6FF, #A53CFF, #FF4DFF, #D845FF);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.animated-gradient-border {
    position: relative;
    background: white;
    border-radius: 12px;
}

.animated-gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FF4DFF, #A53CFF, #3FD6FF, #FF4DFF);
    background-size: 400% 400%;
    border-radius: 12px;
    z-index: -1;
    animation: gradientShift 3s ease infinite;
}

/* === SHIMMER EFFECT === */
.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 77, 255, 0.3), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* === PARTICLE BACKGROUND === */
.particle-bg {
    position: relative;
    overflow: hidden;
}

.particle-bg::before,
.particle-bg::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255, 77, 255, 0.3), transparent);
    border-radius: 50%;
    animation: particleFloat 15s linear infinite;
}

.particle-bg::before {
    left: 20%;
    animation-delay: 0s;
}

.particle-bg::after {
    left: 60%;
    animation-delay: 7s;
}

/* === PROFILE ENHANCEMENTS === */
.profile-page .profile-avatar-wrapper .profile-avatar {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-page .profile-avatar-wrapper .profile-avatar:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 15px 40px rgba(255, 77, 255, 0.4);
}

.profile-page .profile-avatar-wrapper .profile-avatar::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, #FF4DFF, #A53CFF, #3FD6FF);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: rotateGradient 3s linear infinite;
}

.profile-page .profile-avatar-wrapper .profile-avatar:hover::after {
    opacity: 1;
}

/* === BILLING PAGE ENHANCEMENTS === */
.billing-hero {
    background: linear-gradient(-45deg, #3FD6FF, #A53CFF, #FF4DFF, #D845FF);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

.billing-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    animation: float 20s linear infinite;
}

.billing-card-featured {
    background: linear-gradient(135deg, rgba(255, 77, 255, 0.05), rgba(165, 60, 255, 0.05));
    border: 2px solid rgba(255, 77, 255, 0.3);
    animation: pulseGlow 3s ease-in-out infinite;
}

.tier-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

.tier-card:hover::before {
    left: 100%;
}

.tier-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.tier-card-current {
    border: 2px solid var(--primary-color);
    box-shadow: 0 10px 40px rgba(255, 77, 255, 0.3);
    animation: scaleBounce 2s ease-in-out infinite;
}

/* === TOAST ENHANCEMENTS === */
.fx-toast {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
}

.fx-toast.show {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1), float 3s ease-in-out infinite !important;
}

.fx-toast.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95)) !important;
}

.fx-toast.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95)) !important;
}

.fx-toast .fx-toast-message {
    color: white !important;
}

.fx-toast .fx-toast-icon {
    animation: scaleBounce 0.6s ease-in-out;
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

/* === INPUT ENHANCEMENTS === */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select,
.settings-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(225, 232, 237, 1);
}

input:focus,
textarea:focus,
select:focus,
.settings-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 77, 255, 0.1), 0 8px 20px rgba(255, 77, 255, 0.15);
    transform: translateY(-2px);
    outline: none;
}

/* === LOADING ANIMATIONS === */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 77, 255, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === SCROLL ANIMATIONS === */
@keyframes scrollIndicator {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(10px); opacity: 0.5; }
}

.scroll-indicator {
    animation: scrollIndicator 2s ease-in-out infinite;
}

/* === NOTIFICATION PANEL ENHANCEMENTS === */
#notificationPanel {
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2) !important;
}

.notification-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.notification-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, #FF4DFF, #A53CFF);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.notification-item:hover::before {
    transform: scaleY(1);
}

.notification-item:hover {
    background: linear-gradient(90deg, rgba(255, 77, 255, 0.05), transparent) !important;
    transform: translateX(5px);
}

/* === DROPDOWN ENHANCEMENTS === */
.dropdown-menu {
    animation: slideInUp 0.2s ease-out;
    backdrop-filter: blur(10px);
}

.dropdown-menu a {
    position: relative;
    overflow: hidden;
}

.dropdown-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.dropdown-menu a:hover::before {
    transform: scaleY(1);
}

/* === RESPONSIVE ENHANCEMENTS === */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .nav-links {
        animation: slideInUp 0.3s ease-out;
    }
}

/* === UTILITY CLASSES === */
.fade-in {
    animation: fadeInZoom 0.6s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

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

.glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

.bounce {
    animation: scaleBounce 1s ease-in-out infinite;
}

/* === SMOOTH SCROLL === */
html {
    scroll-behavior: smooth;
}

/* === PAGE TRANSITIONS === */
body {
    animation: fadeInZoom 0.5s ease-out;
}

/* === ELECTRIC RAINBOW BORDER FOR POSTS === */
@property --angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

@keyframes electricSpin {
    to { --angle: 360deg; }
}

/* Ensure post card can host animated border layers */
.post-card {
    position: relative;
    z-index: 0; /* create stacking context */
}

/* Crisp animated border ring */
.post-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px; /* match inline radius */
    padding: 2px; /* border thickness */
    background: conic-gradient(from var(--angle),
        #FF4DFF 0%,
        #D845FF 20%,
        #A53CFF 40%,
        #3FD6FF 60%,
        #2BB6FF 80%,
        #6AE6FF 100%
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude; /* show only the ring */
    pointer-events: none;
    animation: electricSpin 6s linear infinite;
}

/* Soft outer glow for the "electric" feel */
.post-card::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 18px; /* slightly larger for glow */
    background: conic-gradient(from var(--angle),
        rgba(255,77,255,0.75) 0%,
        rgba(216,69,255,0.75) 20%,
        rgba(165,60,255,0.75) 40%,
        rgba(63,214,255,0.75) 60%,
        rgba(43,182,255,0.75) 80%,
        rgba(106,230,255,0.75) 100%
    );
    filter: blur(14px);
    opacity: 0.25; /* tasteful glow */
    z-index: -1; /* behind the card */
    pointer-events: none;
    animation: electricSpin 6s linear infinite;
}

/* === CENTERED BUTTONS FIX === */
.hero-buttons,
.billing-actions,
.tier-card-action {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* === AVATAR FIX - Prevent cutting === */
.nav-avatar,
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 2px solid rgba(255, 77, 255, 0.2);
    transition: all 0.3s ease;
}

/* Profile page avatar is handled separately in style.css */
.profile-page .profile-avatar-wrapper .profile-avatar {
    /* Styles are in style.css to avoid conflicts */
}

.nav-avatar:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
    border-color: rgba(255, 77, 255, 0.5);
}

/* Large profile avatar */
.profile-header-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 4px solid white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-top: -60px;
    position: relative;
    z-index: 10;
}
