/* Enhanced Glassmorphism for Orange Pi Homelab Dashboard 2025 */

/* Nature Image Background Enhancement */
body, html, #__next, main, .app, [class*="app"], [class*="main"] {
  background-attachment: fixed !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

:root {
  /* Color Palette */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --glass-active: rgba(255, 255, 255, 0.12);
  
  /* Dynamic Variables */
  --blur-strength: 20px;
  --shadow-subtle: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-elevated: 0 16px 64px rgba(0, 0, 0, 0.3);
  --border-radius: 16px;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Nature Image Background Overlay for Better Contrast */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)) !important;
  z-index: -1;
  pointer-events: none;
}

@keyframes backgroundShift {
  0% { background-position: 0% 0%, 20% 50%, 80% 20%, 40% 80%, 60% 30%; }
  33% { background-position: 3% 5%, 25% 60%, 75% 15%, 45% 85%, 65% 25%; }
  66% { background-position: -3% 8%, 35% 45%, 65% 30%, 55% 75%, 55% 40%; }
  100% { background-position: 0% 0%, 22% 55%, 78% 22%, 42% 82%, 62% 32%; }
}

/* Enhanced Service Cards with Improved Glass Effect */
.service-card, .card, [class*="card"] {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(var(--blur-strength)) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(var(--blur-strength)) saturate(1.2) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: 
    var(--shadow-subtle),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  transition: var(--transition-smooth) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Hover Effects with Enhanced Glass */
.service-card:hover, .card:hover, [class*="card"]:hover {
  background: var(--glass-hover) !important;
  backdrop-filter: blur(25px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(25px) saturate(1.4) !important;
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: 
    var(--shadow-elevated),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Active State */
.service-card:active, .card:active, [class*="card"]:active {
  background: var(--glass-active) !important;
  transform: translateY(-2px) scale(1.01) !important;
}

/* Floating Glass Effect for Widgets */
.widget, [class*="widget"] {
  background: rgba(255, 255, 255, 0.03) !important;
  backdrop-filter: blur(15px) saturate(1.1) !important;
  -webkit-backdrop-filter: blur(15px) saturate(1.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  transition: var(--transition-smooth) !important;
}

.widget:hover, [class*="widget"]:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(18px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.2) !important;
  transform: translateY(-2px) !important;
}

/* Navigation Bar with Premium Glass and Enhanced Padding */
.header, .navbar, nav, [class*="header"], [class*="nav"] {
  background: rgba(0, 0, 0, 0.25) !important;
  backdrop-filter: blur(30px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(30px) saturate(1.5) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 
    0 4px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  padding: 24px 32px !important;
  margin-bottom: 24px !important;
}

/* Enhanced Service Grid Layout */
.service-group, [class*="service-group"] {
  margin-bottom: 3rem !important;
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
}

.service-group:nth-child(1) { animation-delay: 0.1s; }
.service-group:nth-child(2) { animation-delay: 0.2s; }
.service-group:nth-child(3) { animation-delay: 0.3s; }
.service-group:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typography Enhancements */
.service-title, h1, h2, h3, [class*="title"] {
  font-weight: 600 !important;
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  letter-spacing: -0.01em !important;
}

.service-description, p, [class*="description"] {
  color: rgba(255, 255, 255, 0.75) !important;
  line-height: 1.6 !important;
}

/* Modern Search Bar with Enhanced Padding */
input[type="search"], input[type="text"], .search-container input {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 16px !important;
  color: #ffffff !important;
  padding: 18px 24px !important;
  font-size: 16px !important;
  margin: 16px 0 !important;
  transition: var(--transition-smooth) !important;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

input[type="search"]:focus, input[type="text"]:focus, .search-container input:focus {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  outline: none !important;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    0 0 0 4px rgba(255, 255, 255, 0.1) !important;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Enhanced Status Indicators */
.status-up, [class*="status-up"], .text-green-500 {
  color: #10b981 !important;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.3) !important;
}

.status-down, [class*="status-down"], .text-red-500 {
  color: #ef4444 !important;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.3) !important;
}

.status-unknown, [class*="status-unknown"], .text-yellow-500 {
  color: #f59e0b !important;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.3) !important;
}

/* Error States with Glass Effect */
.widget-error, [class*="error"] {
  background: rgba(239, 68, 68, 0.08) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

/* Buttons and Interactive Elements */
button, .btn, [role="button"] {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  padding: 8px 16px !important;
  transition: var(--transition-smooth) !important;
  cursor: pointer !important;
}

button:hover, .btn:hover, [role="button"]:hover {
  background: var(--glass-hover) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  transition: var(--transition-smooth);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  :root {
    --blur-strength: 15px;
    --border-radius: 12px;
  }
  
  .service-card, .card, [class*="card"] {
    backdrop-filter: blur(15px) saturate(1.1) !important;
    -webkit-backdrop-filter: blur(15px) saturate(1.1) !important;
  }
}

/* Loading Animation */
.loading-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.02) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

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

/* Ripple Effect for Clicks */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(2);
    opacity: 0;
  }
}

/* Homepage specific styling */
.main-container, [class*="container"] {
  backdrop-filter: blur(10px) !important;
}

/* Icon enhancements */
svg, img {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
}

/* Text improvements for better contrast on glass */
[class*="text-"] {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Reduced padding for service cards for tighter layout */
.service, [class*="service"] {
  padding: 16px !important;
  margin: 6px !important;
}

.service-content, [class*="service-content"] {
  padding: 12px !important;
  gap: 8px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}

/* Widget content improvements */
.widget-content, [class*="widget-content"] {
  padding: 16px !important;
  margin: 8px 0 !important;
}

/* Grid layout improvements with reduced spacing */
.grid-item, [class*="grid-item"] {
  padding: 8px !important;
  margin: 4px !important;
}

/* Service icon spacing - tighter */
.service-icon, [class*="service-icon"] {
  margin-bottom: 8px !important;
  display: block !important;
}

/* Title and description spacing - reduced */
.service-title, [class*="service-title"] {
  margin: 6px 0 3px 0 !important;
  padding: 0 6px !important;
}

.service-description, [class*="service-description"] {
  margin: 3px 0 6px 0 !important;
  padding: 0 6px !important;
}

/* Widget status and metrics spacing */
.widget-status, [class*="widget-status"] {
  padding: 8px 12px !important;
  margin: 4px 0 !important;
}

/* Enhanced Top Area Elements with More Padding */
.top-container, [class*="top"], .header-content, [class*="header-content"] {
  padding: 32px 24px !important;
  margin: 16px 0 24px 0 !important;
}

/* Search and Date Elements Enhanced Spacing */
.search-container, [class*="search"] {
  padding: 20px 16px !important;
  margin: 20px 0 !important;
}

.date-container, [class*="date"], .time-container, [class*="time"] {
  padding: 16px 20px !important;
  margin: 12px 8px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(15px) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Status Elements with Enhanced Padding */
.status-container, [class*="status"], .info-container, [class*="info"] {
  padding: 16px 20px !important;
  margin: 12px 8px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(15px) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
