/* Social Components CSS for 999DEX */
/* Complementary styles for social features - uses Tailwind CSS as base */

/* ===========================
   Custom Scrollbar
   =========================== */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.8);
}

/* ===========================
   Profile Modal Animations
   =========================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

.animate-scale-up {
    animation: scaleUp 0.3s ease-out;
}

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

/* ===========================
   Comment Styles
   =========================== */
.comment-item {
    transition: all 0.3s ease;
}

.comment-item.highlight-new {
    background: rgba(139, 92, 246, 0.1);
    animation: pulse 2s ease-in-out;
}

.comment-like-btn {
    transition: all 0.2s ease;
}

.comment-like-btn:hover svg {
    transform: scale(1.2);
}

.comment-reply-btn:hover,
.comment-edit-btn:hover,
.comment-delete-btn:hover,
.comment-report-btn:hover {
    transform: translateY(-1px);
}

/* Nested comment indentation with visual guide */
.comment-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, rgba(139, 92, 246, 0.3), transparent);
}

.comment-item[style*="margin-left: 0px"]::before {
    display: none;
}

/* ===========================
   Leaderboard Styles
   =========================== */
.leaderboard-tab {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #9CA3AF;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.875rem;
}

.leaderboard-tab:hover {
    color: #A855F7;
    background: rgba(139, 92, 246, 0.05);
}

.leaderboard-tab.active {
    color: #A855F7;
    border-bottom-color: #A855F7;
    background: rgba(139, 92, 246, 0.1);
}

.timeframe-btn {
    padding: 0.375rem 0.75rem;
    background: rgba(51, 65, 85, 0.5);
    color: #9CA3AF;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeframe-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #A855F7;
}

.timeframe-btn.active {
    background: #A855F7;
    color: white;
    border-color: #A855F7;
}

/* Leaderboard table responsive styles */
@media (max-width: 768px) {
    .leaderboard-tab span {
        display: none;
    }

    .leaderboard-tab {
        padding: 1rem 0.5rem;
    }
}

/* ===========================
   Reputation Badges
   =========================== */
.badge-icon {
    position: relative;
    overflow: hidden;
}

.badge-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0%, 100% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    50% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.badge-card {
    position: relative;
    overflow: hidden;
}

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

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

/* ===========================
   Notification Styles
   =========================== */
.notification-tab {
    flex: 1;
    padding: 0.75rem 0.5rem;
    text-align: center;
    color: #9CA3AF;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.notification-tab:hover {
    color: #A855F7;
    background: rgba(139, 92, 246, 0.05);
}

.notification-tab.active {
    color: #A855F7;
    border-bottom-color: #A855F7;
    background: rgba(139, 92, 246, 0.1);
}

.notification-item {
    position: relative;
}

.notification-item.unread {
    background: rgba(139, 92, 246, 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #A855F7, #EC4899);
}

.notification-item:hover {
    background: rgba(51, 65, 85, 0.3);
}

/* Notification bell animation */
@keyframes bellRing {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(-10deg);
    }
    20%, 40% {
        transform: rotate(10deg);
    }
}

#notificationBell:hover svg {
    animation: bellRing 0.5s ease-in-out;
}

/* ===========================
   Card Animations
   =========================== */
.pulse-card {
    animation: cardPulse 0.5s ease-in-out;
}

@keyframes cardPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 10px rgba(139, 92, 246, 0);
    }
}

.celebrate-card {
    animation: celebrate 1.2s ease-in-out;
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(5deg);
    }
    50% {
        transform: scale(1.15) rotate(-5deg);
    }
    75% {
        transform: scale(1.1) rotate(5deg);
    }
}

.new-token {
    animation: newTokenAppear 0.6s ease-out;
}

@keyframes newTokenAppear {
    0% {
        transform: translateY(-20px) scale(0.9);
        opacity: 0;
    }
    60% {
        transform: translateY(5px) scale(1.05);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ===========================
   Utility Classes
   =========================== */

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #A855F7, #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass morphism effect */
.glass-effect {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Hover glow effect */
.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

/* Profile avatar hover */
[data-user-profile] {
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-user-profile]:hover {
    filter: brightness(1.2);
}

/* Loading states */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(51, 65, 85, 0.5) 25%,
        rgba(71, 85, 105, 0.5) 50%,
        rgba(51, 65, 85, 0.5) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Social action buttons */
.social-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.social-button:hover {
    transform: translateY(-2px);
}

.social-button:active {
    transform: translateY(0);
}

/* ===========================
   Responsive Styles
   =========================== */
@media (max-width: 640px) {
    /* Stack leaderboard tabs on mobile */
    .leaderboard-tab {
        font-size: 0.75rem;
        padding: 0.75rem 0.5rem;
    }

    /* Adjust notification center width */
    #notificationCenter {
        width: 100vw;
        right: 0;
        left: 0;
        border-radius: 0;
        top: 60px;
    }

    /* Reduce comment indentation on mobile */
    .comment-item[style*="margin-left"] {
        margin-left: 0 !important;
    }

    /* Simplify profile modal on mobile */
    .profile-modal-content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    /* Adjust badge grid on tablets */
    .badge-collection .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===========================
   Dark Mode Enhancements
   =========================== */
:root {
    --social-bg-primary: rgba(30, 41, 59, 0.95);
    --social-bg-secondary: rgba(51, 65, 85, 0.5);
    --social-border: rgba(139, 92, 246, 0.2);
    --social-text-primary: #FFFFFF;
    --social-text-secondary: #9CA3AF;
    --social-accent: #A855F7;
    --social-accent-hover: #9333EA;
}

/* ===========================
   Accessibility
   =========================== */

/* Focus states for keyboard navigation */
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #A855F7;
    outline-offset: 2px;
}

/* Reduced 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;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .leaderboard-tab.active,
    .notification-tab.active {
        border-bottom-width: 3px;
    }

    .badge-icon {
        border-width: 3px;
    }
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    #notificationCenter,
    #notificationBell,
    .social-button,
    .comment-like-btn,
    .comment-reply-btn {
        display: none;
    }

    .notification-item,
    .comment-item {
        break-inside: avoid;
    }
}

/* ===========================
   Tooltips (optional enhancement)
   =========================== */
[title] {
    position: relative;
}

/* Custom tooltip styling can be added here if needed */

/* ===========================
   Performance Optimizations
   =========================== */

/* GPU acceleration for animations */
.notification-item,
.comment-item,
.badge-icon,
.leaderboard-tab {
    will-change: transform;
}

/* Contain layout shifts */
.notification-item,
.comment-item {
    contain: layout style paint;
}
