/*
 * This file is part of midnightntwrk/example-bboard.
 * Copyright (C) Midnight Foundation
 * SPDX-License-Identifier: Apache-2.0
 * Licensed under the Apache License, Version 2.0 (the "License");
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.5) 0%, rgba(6, 182, 212, 0.5) 100%);
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.7) 0%, rgba(6, 182, 212, 0.7) 100%);
}

/* Selection color */
::selection {
  background: rgba(124, 58, 237, 0.3);
  color: #ffffff;
}

/* Smooth fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide up animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide down animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale in animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pulse animation for loading states */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Glow animation */
@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.6), 0 0 60px rgba(6, 182, 212, 0.3);
  }
}

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

/* Float animation */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* Apply animations to common elements */
.MuiCard-root {
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.MuiDialog-paper {
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.MuiBackdrop-root {
  animation: fadeIn 0.2s ease-out;
}

/* Hover effect enhancement for cards */
.MuiCard-root:hover {
  animation: glow 2s ease-in-out infinite;
}

/* Loading skeleton shimmer */
.MuiSkeleton-root {
  background: linear-gradient(
    90deg,
    rgba(124, 58, 237, 0.1) 0%,
    rgba(124, 58, 237, 0.2) 50%,
    rgba(124, 58, 237, 0.1) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid rgba(124, 58, 237, 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Smooth transitions for all interactive elements */
button,
a,
IconButton,
.MuiIconButton-root {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent layout shift on hover */
.MuiIconButton-root:hover {
  transform: scale(1.1);
}

/* Custom cursor for interactive elements */
button:hover,
a:hover,
.MuiIconButton-root:hover {
  cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  .MuiCard-root {
    animation-duration: 0.3s;
  }
}

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