/* Advanced Link Dashboard - Static Version CSS */

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

@keyframes glow {
  0% { box-shadow: 0 0 5px rgba(168, 85, 247, 0.4); }
  100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.8), 0 0 30px rgba(168, 85, 247, 0.4); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(50px);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.05);
  }
  80% {
    opacity: 1;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Utility Classes */
.animate-float {
  animation: float 3s ease-in-out infinite;
}

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

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.2s ease-out;
}

.animate-bounce-in {
  animation: bounceIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-pulse-slow {
  animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

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

::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.6);
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.8);
}

/* Glass Morphism Effects */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.125);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Enhanced Link Cards */
.link-card {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s;
  border-radius: inherit;
}

.link-card:hover::before {
  transform: translateX(100%);
}

.link-card:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04),
    0 0 50px rgba(168, 85, 247, 0.3);
}

/* Disable animations on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .link-card {
    transition: none;
  }
  .link-card:hover {
    transform: none;
  }
}

/* Tooltip Styling */
.tooltip {
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.link-card:hover .tooltip {
  transform: translateY(0);
}

/* Category Header Effects */
.category-header {
  position: relative;
  overflow: hidden;
}

.category-header::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;
}

.category-header:hover::before {
  left: 100%;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(168, 85, 247, 0.6);
}

/* Modal Animations */
.modal-enter {
  animation: fadeIn 0.3s ease-out;
}

.modal-content-enter {
  animation: bounceIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.1) 25%, 
    rgba(255, 255, 255, 0.2) 50%, 
    rgba(255, 255, 255, 0.1) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* Text Effects */
.text-gradient {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s ease infinite;
}

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

/* Hover States for Interactive Elements */
.interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.interactive:active {
  transform: translateY(0);
  transition: transform 0.1s;
}

/* Focus States for Accessibility */
.focus-visible:focus-visible {
  outline: 2px solid #a855f7;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Line Clamp Utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Toggle Switch Styles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #374151;
  transition: .4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #a855f7;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .glass {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid white;
  }
  
  .link-card {
    border: 2px solid white;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .link-card:hover {
    transform: none !important;
  }
}

/* Print Styles */
@media print {
  .no-print,
  #quick-add-fab,
  #add-link-modal,
  #settings-modal,
  #toast {
    display: none !important;
  }
  
  .link-card {
    break-inside: avoid;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    box-shadow: none;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* Responsive Design Improvements */
@media (max-width: 640px) {
  .link-card {
    padding: 3rem 1rem;
  }
  
  .category-header h2 {
    font-size: 1.5rem;
  }
  
  #quick-add-fab {
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
  }
}

/* Dark mode specific styles */
.dark .bg-gray-100 {
  background-color: #111827;
}

.dark .text-gray-900 {
  color: #f9fafb;
}

/* Light mode specific styles */
.light .bg-gray-900 {
  background-color: #f9fafb;
}

.light .text-white {
  color: #111827;
}

.light .bg-white {
  background-color: #374151;
}

.light .border-white {
  border-color: #374151;
}

.light .text-gray-300 {
  color: #6b7280;
}

.light .bg-black {
  background-color: rgba(255, 255, 255, 0.8);
}

/* Custom selection colors */
::selection {
  background-color: rgba(168, 85, 247, 0.3);
  color: white;
}

::-moz-selection {
  background-color: rgba(168, 85, 247, 0.3);
  color: white;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Improved form styling */
input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

/* Better button hover states */
button:hover:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading state styles */
.loading {
  position: relative;
  color: transparent;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #a855f7;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

/* Error state styles */
.error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Success state styles */
.success {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}