/* Modern Enhancements for TBCreates Event System */

/* Universal Navbar Styles */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.magnetic-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magnetic-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.text-shimmer {
  background: linear-gradient(90deg, #ffffff 0%, #10b981 25%, #3b82f6 50%, #8b5cf6 75%, #ffffff 100%);
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 200% 0; }
  50% { background-position: -200% 0; }
}

/* Active page styling */
.nav-link.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(59, 130, 246, 0.2));
  color: #10b981;
  font-weight: 600;
}

.nav-link.active .nav-bg {
  opacity: 1;
}

/* Dropdown animations */
.dropdown-visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.dropdown-hidden {
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
}

/* Mobile menu animations */
.mobile-nav-open .hamburger .bar.top {
  transform: rotate(45deg);
  top: 14px;
}

.mobile-nav-open .hamburger .bar.middle {
  opacity: 0;
}

.mobile-nav-open .hamburger .bar.bottom {
  transform: rotate(-45deg);
  top: 14px;
}

.mobile-nav-open #mobile-nav-backdrop {
  opacity: 1 !important;
  pointer-events: all !important;
}

.mobile-nav-open #mobile-nav-dropdown {
  opacity: 1 !important;
  transform: scale(1) !important;
  pointer-events: all !important;
}

/* Body class for mobile nav */
body.mobile-nav-open {
  overflow: hidden;
}

/* Hamburger menu styles */
.hamburger {
  width: 32px;
  height: 32px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger .bar {
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 1px;
  transition: all 0.3s ease;
}

.hamburger .bar.top {
  top: 6px;
}

.hamburger .bar.middle {
  top: 15px;
}

.hamburger .bar.bottom {
  top: 24px;
}

/* Card Effects */
.card-glow {
  transition: all 0.3s ease;
}

.card-glow:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* Main Grid Layout */
.main-grid {
  gap: 2rem;
}

@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Status Effects */
.status-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Enhanced Interactive Elements */
.interactive-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.interactive-hover::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;
}

.interactive-hover:hover::before {
  left: 100%;
}

/* Status Indicators */
.status-indicator {
  position: relative;
}

.status-indicator::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* Enhanced Button Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
}

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

.btn-ripple:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% { transform: scale(0, 0); opacity: 1; }
  20% { transform: scale(25, 25); opacity: 1; }
  100% { transform: scale(40, 40); opacity: 0; }
}

/* Enhanced Card Shadows */
.card-glow {
  box-shadow: 
    0 0 20px rgba(16, 185, 129, 0.1),
    0 0 40px rgba(59, 130, 246, 0.1),
    0 0 60px rgba(139, 92, 246, 0.1);
  transition: all 0.3s ease;
}

.card-glow:hover {
  box-shadow: 
    0 0 30px rgba(16, 185, 129, 0.2),
    0 0 60px rgba(59, 130, 246, 0.2),
    0 0 90px rgba(139, 92, 246, 0.2);
}

/* Text Enhancement */
.text-enhance {
  background: linear-gradient(45deg, #10b981, #3b82f6, #8b5cf6);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Micro-animations */
.micro-bounce {
  animation: microBounce 2s ease-in-out infinite;
}

@keyframes microBounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-3px); }
  60% { transform: translateY(-1px); }
}

/* Enhanced Focus States */
.focus-ring:focus {
  outline: none;
  outline-offset: 2px;
  outline-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Performance Optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Accessibility Enhancements */
.reduced-motion {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Enhanced Loading States */
.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

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

/* Enhanced Scroll Behavior */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* Modern Typography */
.font-display {
  font-display: swap;
}

/* Enhanced Spacing */
.space-y-enhanced > * + * {
  margin-top: 1.5rem;
}

/* Modern Shadows */
.shadow-modern {
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.24);
}

.shadow-modern-hover {
  box-shadow: 
    0 14px 28px rgba(0, 0, 0, 0.25),
    0 10px 10px rgba(0, 0, 0, 0.22);
}

/* Loading Animation */
.loader {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #10b981;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 120px;
  background-color: #1a1a1a;
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Better Focus States */
.focus-visible:focus {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* Enhanced Hover Effects */
.interactive-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Improved Button Styling */
.btn-modern {
  background: linear-gradient(135deg, #10b981, #3b82f6);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-modern:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* Sparkle Animation */
.sparkle {
  position: absolute;
  width: 24px;
  height: 24px;
  top: -12px;
  right: -12px;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

/* Better Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #10b981;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #059669;
}

/* Enhanced Animations */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }
  50% { box-shadow: 0 0 40px rgba(16, 185, 129, 0.8); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

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

/* Enhanced typewriter effect */
.typewriter-cursor {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Page transition effects */
#fadePage {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

#fadePage.loaded {
  opacity: 1;
}

#fadePage.fade-out {
  opacity: 0;
}

/* Global Announcement System Enhancements */
.global-announcement {
  backdrop-filter: blur(10px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.global-announcement::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.global-announcement:hover::after {
  opacity: 1;
}

/* Enhanced badge styling */
.announcement-badge {
  position: relative;
  overflow: hidden;
}

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

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

/* Icon container styling */
.announcement-icon-container {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.announcement-icon-container:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

/* Improved gradient backgrounds */
.urgent-gradient {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 25%, #991b1b 50%, #dc2626 100%);
  background-size: 400% 400%;
  animation: gradientShift 3s ease infinite;
}

.normal-gradient {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 25%, #1e40af 50%, #2563eb 100%);
  background-size: 400% 400%;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Enhanced dismiss button */
.announcement-dismiss {
  position: relative;
  overflow: hidden;
}

.announcement-dismiss::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.announcement-dismiss:hover::before {
  width: 100%;
  height: 100%;
}

/* Text animations */
.announcement-title {
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 100%;
  animation: textShine 3s ease-in-out infinite;
}

@keyframes textShine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Typing animation for new announcements */
.announcement-typing {
  overflow: hidden;
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  margin: 0 auto;
  animation: typing 1.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: rgba(255, 255, 255, 0.7); }
}

/* Staggered animation for multiple announcements */
.announcement-stagger-1 { animation-delay: 0.1s; }
.announcement-stagger-2 { animation-delay: 0.2s; }
.announcement-stagger-3 { animation-delay: 0.3s; }
.announcement-stagger-4 { animation-delay: 0.4s; }
.announcement-stagger-5 { animation-delay: 0.5s; }

/* Mobile enhancements */
@media (max-width: 640px) {
  .global-announcement {
    margin: 0 -1rem;
    border-radius: 0;
  }
  
  .announcement-icon-container {
    width: 2rem;
    height: 2rem;
  }
  
  .announcement-dismiss {
    padding: 0.5rem;
  }
}

/* Accessibility improvements */
.global-announcement:focus-within {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}

.announcement-dismiss:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .global-announcement,
  .announcement-badge,
  .announcement-icon-container,
  .announcement-dismiss {
    animation: none;
    transition: none;
  }
  
  .global-announcement::before,
  .global-announcement::after,
  .announcement-badge::before,
  .announcement-dismiss::before {
    display: none;
  }
}

/* Manage cookies link styling (consistent site-wide) */
.manage-cookies-link {
  text-decoration: underline;
  color: #fbbf24; /* gold/yellow to match site accents */
}
.manage-cookies-link:hover {
  color: #f59e0b;
}
