/* ==============================================
   Mike's Hub - Modern Premium Dashboard Theme
   ============================================== */

/* ========================================
   HEADER LAYOUT - LEFT ALIGNED
   ======================================== */

/* Override the default centered header layout */
#information-widgets,
.information-widget-container,
[class*="information-widget"] {
  justify-content: flex-start !important;
  text-align: left !important;
}

/* Main widget row - force left alignment */
.widgets-container,
#widgets,
[class*="widgets"] {
  justify-content: flex-start !important;
  align-items: center !important;
}

/* Logo and greeting side by side */
.information-widget-logo,
.information-widget-greeting {
  margin-right: 16px !important;
}

/* Date/time left aligned */
.information-widget-datetime,
.datetime-widget,
[class*="datetime"] {
  text-align: left !important;
  justify-content: flex-start !important;
}

/* Move title to left side, inline with avatar */
.widget-container,
#page_container > div:first-child {
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: center !important;
  flex-wrap: wrap !important;
}

/* Custom Properties for theming */
:root {
  --glass-bg: rgba(15, 23, 42, 0.75);
  --glass-border: rgba(148, 163, 184, 0.15);
  --glass-blur: 20px;
  --accent-primary: #6366f1;
  --accent-secondary: #a78bfa;
  --accent-gradient: linear-gradient(
    135deg,
    #6366f1 0%,
    #a78bfa 50%,
    #38bdf8 100%
  );
  --glow-primary: 0 0 30px rgba(99, 102, 241, 0.3);
  --glow-secondary: 0 0 40px rgba(167, 139, 250, 0.2);
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Background Enhancement */
body {
  background: linear-gradient(
    135deg,
    #0f172a 0%,
    #1e1b4b 30%,
    #0f172a 60%,
    #164e63 100%
  ) !important;
  background-attachment: fixed !important;
}

/* Add subtle animated gradient overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      ellipse at 20% 20%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 80%,
      rgba(139, 92, 246, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 50%,
      rgba(56, 189, 248, 0.08) 0%,
      transparent 60%
    );
  pointer-events: none;
  z-index: -1;
  animation: gradientShift 15s ease-in-out infinite alternate;
}

@keyframes gradientShift {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Main Container Styling */
#page_container {
  max-width: 1600px !important;
}

/* ========================================
   SERVICE CARDS - COMPACT LAYOUT
   ======================================== */

/* Service group container - use grid with auto-fit */
.service-group > div,
.services-group > div,
[class*="service"] > ul,
.service-container {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, max-content)) !important;
  gap: 12px !important;
  justify-content: start !important;
}

/* Service Card Styling - Glassmorphism + Compact Width */
.service {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(var(--glass-blur)) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur)) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 16px !important;
  transition: var(--transition-smooth) !important;
  position: relative;
  overflow: hidden;
  max-width: 280px !important;
  min-width: 200px !important;
  width: auto !important;
}

/* Gradient border effect on hover */
.service::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  padding: 1px;
  background: var(--accent-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: var(--transition-smooth);
  pointer-events: none;
}

.service:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: var(--glow-primary), var(--glow-secondary) !important;
  background: rgba(30, 41, 59, 0.85) !important;
}

.service:hover::before {
  opacity: 1;
}

/* Service Icons Enhancement */
.service img,
.service svg {
  transition: var(--transition-bounce) !important;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.service:hover img,
.service:hover svg {
  transform: scale(1.15) rotate(5deg) !important;
  filter: drop-shadow(0 8px 16px rgba(99, 102, 241, 0.4)) !important;
}

/* Status Indicators - Using Homepage built-in animations */

/* ========================================
   RESOURCE WIDGETS - HEADER SPACING
   ======================================== */

/* Add horizontal spacing between resource widgets */
.information-widget-resources,
.resources-wrapper,
[class*="resources"] {
  gap: 24px !important;
  padding: 0 12px !important;
}

/* Widget Cards - Resource Widgets */
.widget {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(var(--glass-blur)) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur)) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 16px !important;
  transition: var(--transition-smooth) !important;
}

.widget:hover {
  border-color: rgba(99, 102, 241, 0.4) !important;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15) !important;
}

/* Progress Bars for Resources */
.progress,
[class*="progress"] {
  background: rgba(30, 41, 59, 0.8) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

.progress > div,
[class*="progress"] > div {
  background: var(--accent-gradient) !important;
  border-radius: 8px !important;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative;
}

.progress > div::after,
[class*="progress"] > div::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Section Headers */
h2,
.text-theme-800 {
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

/* Bookmarks Section Enhancement */
.bookmark {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(var(--glass-blur)) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 12px !important;
  transition: var(--transition-smooth) !important;
  padding: 12px 16px !important;
}

.bookmark:hover {
  transform: translateY(-4px) !important;
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2) !important;
}

/* Bookmark Abbreviation Badges */
.bookmark .abbr,
.bookmark [class*="abbr"] {
  background: var(--accent-gradient) !important;
  color: white !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;
}

/* DateTime Widget Enhancement */
time {
  font-size: 1.25rem !important;
  font-weight: 300 !important;
  letter-spacing: 0.1em !important;
  color: rgba(255, 255, 255, 0.9) !important;
  text-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

/* Docker Status Widget */
.docker-widget,
[class*="docker"] {
  border-radius: 16px !important;
}

/* Search Bar Enhancement (if enabled) */
input[type="text"],
input[type="search"] {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(var(--glass-blur)) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 12px !important;
  color: white !important;
  transition: var(--transition-smooth) !important;
}

input[type="text"]:focus,
input[type="search"]:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3) !important;
  outline: none !important;
}

/* Link Styling */
a {
  transition: var(--transition-smooth) !important;
}

a:hover {
  color: var(--accent-secondary) !important;
}

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

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--accent-gradient);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* Footer Enhancement */
footer {
  opacity: 0.6;
  transition: var(--transition-smooth) !important;
}

footer:hover {
  opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .service:hover {
    transform: translateY(-4px) scale(1.01) !important;
  }

  .service:hover img,
  .service:hover svg {
    transform: scale(1.1) !important;
  }
}

/* Animation for initial page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-group {
  animation: fadeInUp 0.6s ease-out forwards;
}

.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;
}

/* Extra Polish - Subtle grid pattern overlay */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
      rgba(99, 102, 241, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -1;
}

/* ========================================
   ADDITIONAL PREMIUM EFFECTS
   ======================================== */

/* Logo Enhancement - Glowing Effect */
.information-widget-logo img,
img[src*="logo"],
.widget img:first-child {
  animation: logo-glow 3s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

@keyframes logo-glow {
  0% {
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 0 25px rgba(167, 139, 250, 0.8));
    transform: scale(1.05);
  }
}

/* Greeting Text - Shimmering Animation */
.information-widget-greeting,
[class*="greeting"] {
  animation: text-shine 4s ease-in-out infinite;
  background: linear-gradient(
    90deg, 
    #fff 0%, 
    #a78bfa 25%, 
    #fff 50%,
    #6366f1 75%,
    #fff 100%
  ) !important;
  background-size: 200% auto !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

@keyframes text-shine {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* Service Status - Using Homepage built-in styling */

/* Card Title Glow on Hover */
.service:hover .service-title,
.service:hover h3,
.service:hover a {
  color: #c4b5fd !important;
  text-shadow: 0 0 15px rgba(167, 139, 250, 0.6);
}

/* Enhanced Resource Widget Styling */
.resource-usage,
[class*="resource"] {
  background: rgba(15, 23, 42, 0.6) !important;
  border-radius: 12px !important;
}

/* Better Bookmark Hover Animation */
.bookmark:hover svg {
  transform: scale(1.2) rotate(-5deg);
  color: var(--accent-secondary) !important;
}

/* Enhanced Date/Time Display */
.datetime-widget time,
[class*="datetime"] time {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300 !important;
  font-size: 1.1rem !important;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(167, 139, 250, 0.9)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Smoother Global Transitions */
* {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

/* Footer Enhancement */
footer a {
  opacity: 0.5;
  transition: all 0.3s ease;
}

footer a:hover {
  opacity: 1;
  color: var(--accent-secondary) !important;
}

/* Container Status - Using Homepage built-in animations */

/* ========================================
   API ERROR BANNER - HIGH CONTRAST FIX
   ======================================== */

/* Error messages - ensure high contrast with white text */
.bg-rose-900,
.bg-red-900,
[class*="error"],
[class*="Error"],
.widget-error,
div[class*="bg-rose"],
div[class*="bg-red"] {
  background: linear-gradient(135deg, #991b1b, #7f1d1d) !important;
  color: #ffffff !important;
  border: 1px solid rgba(252, 165, 165, 0.3) !important;
  border-radius: 8px !important;
}

/* Error text inside banners - force white */
.bg-rose-900 *,
.bg-red-900 *,
[class*="error"] span,
[class*="error"] p,
[class*="error"] a,
.widget-error *,
div[class*="bg-rose"] *,
div[class*="bg-red"] * {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* Error icon styling */
.bg-rose-900 svg,
.bg-red-900 svg,
[class*="error"] svg {
  color: #fca5a5 !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* API Error Information specific fix */
.information-widget-error,
[class*="api"][class*="error"],
.widget [class*="error"] {
  background: #7f1d1d !important;
  color: #fff !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
}

/* ========================================
   STATUS INDICATORS - REMOVED CUSTOM ANIMATIONS
   Let Homepage's built-in animations work without conflicts
   ======================================== */

/* Just add a subtle glow to the green status dots */
.rounded-full.bg-emerald-500,
.rounded-full.bg-green-500,
.h-3.w-3.rounded-full.bg-emerald-500,
.h-3.w-3.rounded-full.bg-green-500 {
  filter: drop-shadow(0 0 4px #22c55e) drop-shadow(0 0 8px #22c55e);
}

/* ========================================
   DEVELOPER BOOKMARKS - COMPACT GRID LAYOUT
   ======================================== */

/* Target the bookmarks container to use grid layout */
#bookmarks ul,
.bookmark-group ul,
#bookmarks > div > ul {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, max-content)) !important;
  gap: 12px !important;
  justify-content: start !important;
}

/* Make individual bookmark items more compact */
#bookmarks li,
.bookmark-group li {
  width: auto !important;
  max-width: 280px !important;
}

/* Ensure bookmark links don't stretch full width */
#bookmarks a,
.bookmark-group a,
.bookmark {
  width: auto !important;
  min-width: 200px !important;
  max-width: 280px !important;
  display: inline-flex !important;
  justify-content: space-between !important;
}
