/* ==================================================
   GLASSMORPHISM CSS - Digital Library System
   Modern glass design utilities for Tailwind CSS
   ================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

/* ==================================================
   BASE STYLES
   ================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #dbeafe 0%, #e9d5ff 50%, #fce7f3 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

/* ==================================================
   GLASSMORPHISM UTILITIES
   ================================================== */

/* Glass Card - Base */
.glass-card {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  transition: all 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
}

/* Glass Card - Dark Variant */
.glass-card-dark {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background-color: rgba(17, 25, 40, 0.75);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.125);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* Glass Button */
.glass-button {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}

.glass-button:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.02);
}

/* Glass Input */
.glass-input {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.glass-input:focus {
  background-color: rgba(255, 255, 255, 0.7);
  border-color: #6366f1;
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Glass Navbar */
.glass-navbar {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background-color: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 24px 0 rgba(31, 38, 135, 0.1);
}

/* Glass Sidebar */
.glass-sidebar {
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  background: linear-gradient(180deg, rgba(49, 46, 129, 0.9) 0%, rgba(31, 25, 77, 0.95) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 4px 0 32px 0 rgba(0, 0, 0, 0.2);
}

/* ==================================================
   GRADIENT UTILITIES
   ================================================== */

/* Primary Gradient (Indigo to Cyan) */
.gradient-primary {
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
}

/* Success Gradient */
.gradient-success {
  background: linear-gradient(135deg, #4ade80 0%, #06b6d4 100%);
}

/* Danger Gradient */
.gradient-danger {
  background: linear-gradient(135deg, #f87171 0%, #f59e0b 100%);
}

/* Warning Gradient */
.gradient-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

/* Info Gradient */
.gradient-info {
  background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
}

/* ==================================================
   DECORATIVE ELEMENTS
   ================================================== */

/* Decorative Blurred Circles for Backgrounds */
.bg-decoration {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.2;
  pointer-events: none;
  z-index: -1;
}

.bg-decoration-1 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  top: -100px;
  right: -100px;
}

.bg-decoration-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #22d3ee 0%, #4ade80 100%);
  bottom: -150px;
  left: -150px;
}

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

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

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

/* Slide Up Animation */
@keyframes slideUp {
  0% {
    transform: translateY(10px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

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

/* Fade In Animation */
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

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

/* Scale In Animation */
@keyframes scaleIn {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.scale-in {
  animation: scaleIn 0.2s ease-out;
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

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

/* ==================================================
   CUSTOM SHADOWS
   ================================================== */

.shadow-glass {
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.shadow-glass-lg {
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.5);
}

.shadow-glass-colored {
  box-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.3);
}

/* ==================================================
   SCROLLBAR STYLING
   ================================================== */

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%);
}

/* Firefox Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #6366f1 rgba(255, 255, 255, 0.1);
}

/* ==================================================
   UTILITY CLASSES
   ================================================== */

/* Text Gradient */
.text-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Backdrop Blur Variants */
.backdrop-blur-xs {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.backdrop-blur-sm {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.backdrop-blur-md {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.backdrop-blur-lg {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.backdrop-blur-xl {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.backdrop-blur-2xl {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* ==================================================
   RESPONSIVE UTILITIES
   ================================================== */

/* Mobile Optimizations */
@media (max-width: 768px) {
  /* Reduce blur for better mobile performance */
  .glass-card {
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
  }

  .glass-sidebar {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
  }

  /* Reduce decoration sizes */
  .bg-decoration-1 {
    width: 200px;
    height: 200px;
  }

  .bg-decoration-2 {
    width: 250px;
    height: 250px;
  }
}

/* ==================================================
   BROWSER FALLBACKS
   ================================================== */

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(10px)) {
  .glass-card {
    background-color: rgba(255, 255, 255, 0.95);
  }

  .glass-card-dark {
    background-color: rgba(17, 25, 40, 0.95);
  }

  .glass-navbar {
    background-color: rgba(255, 255, 255, 0.95);
  }

  .glass-sidebar {
    background: linear-gradient(180deg, rgba(49, 46, 129, 0.98) 0%, rgba(31, 25, 77, 1) 100%);
  }

  .glass-input {
    background-color: rgba(255, 255, 255, 0.95);
  }
}

/* ==================================================
   PRINT STYLES
   ================================================== */

@media print {
  /* Remove glass effects for printing */
  .glass-card,
  .glass-navbar,
  .glass-sidebar,
  .glass-input {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
  }

  /* Hide decorative elements */
  .bg-decoration,
  .bg-decoration-1,
  .bg-decoration-2 {
    display: none !important;
  }

  /* Solid body background */
  body {
    background: #ffffff !important;
  }
}

/* ==================================================
   ACCESSIBILITY
   ================================================== */

/* Focus Visible Styles */
:focus-visible {
  outline: 3px solid #6366f1;
  outline-offset: 2px;
}

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

  .float-element {
    animation: none !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .glass-card,
  .glass-navbar,
  .glass-sidebar {
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid #000000;
  }
}
