/*==================================
  FONT SETTINGS
==================================*/
/* Import Poppins and Merriweather fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&family=Merriweather:wght@400;700&display=swap');

/*==================================
  ROOT VARIABLES
==================================*/
:root {
  /* Font families for consistent typography */
  --font-primary: 'Poppins', sans-serif;
  --font-secondary: 'Merriweather', serif;
  
  /* Color palette for consistent theming */
  --color-border: #4d4e5e;
  --color-tab-border: #4a4a54;
  --color-tab-hover: #AC2747;
  --color-background-primary: #11141d;
  --color-background-hover: #08081c;
  --color-block: #222432;
  --color-block-hover: #2d2d4a;
  --color-bookmark-icon: #1f233c;
  
  /* Gradient definition for animated borders */
  --gradient-border: linear-gradient(90deg, #F75050, #6C033D, #F75050);
  
  /* Consistent spacing scale */
  --spacing-xs: 5px;
  --spacing-sm: 8px;
  --spacing-md: 10px;
  --spacing-lg: 30px;
  --spacing-xl: 40px;
  
  /* Border properties for consistent styling */
  --border-width: 2px;
  --border-radius: .375rem;
  --border-radius-sm: .275rem;
  
  /* Animation timings for consistent motion */
  --animation-duration: 3s;
  --transition-duration: 0.3s;
  
  /* Layout measurements */
  --logo-size: 66px;
  
  /* Tab-specific styling variables */
  --tab-border-width: 2px;
  --tab-border-radius: .375rem;
  --tab-backdrop-filter: blur(1px);
}

/* Apply Poppins font to all text */
* {
  font-family: var(--font-primary) !important;
}

/*==================================
  TAB STYLES
==================================*/
/* Container for all tabs */
#myTab {
  padding: var(--spacing-xs);
  background: none;
  backdrop-filter: none;
  display: flex;
  justify-content: flex-start;
  gap: var(--spacing-xl);
}

/* Individual tab styling */
button[id$='-tab'] {
  border-width: var(--tab-border-width);
  border-radius: var(--tab-border-radius);
  border-color: var(--color-tab-border);
  backdrop-filter: var(--tab-backdrop-filter);
  padding: 1px;
  margin: 1px;
  border-spacing: 0;
  transition: border-color var(--transition-duration) ease;
}

/* Tab hover effect */
button[id$='-tab']:hover {
  border-color: var(--color-tab-hover);
}

/*==================================
  HEADING STYLES
==================================*/
/* Apply Merriweather font to the greeting */
.information-widget-logo + .information-widget-greeting span {
  font-family: var(--font-secondary) !important;
  font-weight: 700 !important;
}

/* Logo size and positioning */
.information-widget-logo img {
  width: var(--logo-size) !important;  
  height: var(--logo-size) !important;
  max-width: none;   
  max-height: none;     
  margin-left: var(--spacing-lg);
}

/*==================================
  SERVICE CARD STYLES
==================================*/
/* Base service card container */
.service-card {
  position: relative;
  padding: 0;
  margin: 0;
  margin-bottom: 10px;
  border-radius: var(--border-radius);
  background: transparent;
  border: var(--border-width) solid var(--color-border);
  overflow: visible;
}

/* Background color for service data blocks */
.bg-theme-200\/50, 
.flex-1.service-block {     
  background-color: var(--color-block) !important;
  transition: background-color var(--transition-duration) ease;
}

/* Change block colors on service card hover */
.service-card:hover [class*="bg-theme-200/50"],
.service-card:hover .flex-1.service-block {    
  background-color: var(--color-block-hover) !important;
}

/* Animated border gradient effect */
.service-card::before {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--border-width));
  background: var(--gradient-border);
  z-index: -2; 
  border-radius: var(--border-radius);
  background-size: 200% 100%;
  animation: wave var(--animation-duration) linear infinite;
  opacity: 0;
  transition: opacity var(--transition-duration) ease;
}

/* Show animated border on hover */
.service-card:hover::before {
  opacity: 1;
}

/* Animation keyframes for border gradient */
@keyframes wave {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Inner card background effect */
.service-card::after {
  content: '';
  position: absolute;
  inset: var(--border-width);
  background: var(--color-background-primary);
  border-radius: var(--border-radius-sm);
  z-index: -1;
  transition: background-color var(--transition-duration) ease;
}

/* Change background color on hover */
.service-card:hover::after {
  background: var(--color-background-hover);
}

/* Hide default border on hover */
.service-card:hover {
  border-color: transparent;
}

/*==================================
  LAYOUT GROUP STYLES - HOME
==================================*/
:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="HOME-tab"])) .service-card {
  position: relative;
  min-height: 106.854px;
}

:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="HOME-tab"])) .service-card .service-title {
  position: relative;
  min-height: 48px;
}

:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="HOME-tab"])) .service-card .service-title-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  pointer-events: none;
}

:is(#inner_wrapper:has(#tabs [aria-selected="true"]#HOME-tab))
.service[data-name^="LEGEND:"] .service-title-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

:is(#inner_wrapper:has(#tabs [aria-selected="true"]#HOME-tab))
.service[data-name^="LEGEND:"] .service-name {
  text-align: right;
}


:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="HOME-tab"])) .service-card .service-title-text * {
  pointer-events: auto;
}

/* For cards without widget data, center the text relative to the full card height */
:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="HOME-tab"])) .service-card:not(:has(.service-block)) .service-title-text {
  position: absolute;
  left: 0;
  right: 0;
  /* 
    card is 106.854px total, service-title is 48px
    difference is ~58px, so offset text down by half of that (~29px)
    relative to the 50% of service-title (24px)
    net: push down by (106.854 - 48) / 2 = ~29px from current center
  */
  top: calc(50% + 29px);
  transform: translateY(-50%);
  text-align: center;
  pointer-events: none;
}
/*==================================
  LAYOUT GROUP STYLES - SYSTEM
==================================*/
/* Homepage layout container with calculations */
:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="SYSTEM-tab"])) #layout-groups {
  --gap: var(--spacing-md);
  --cols-1: calc(100% - var(--gap));
  --cols-2: calc(50% - (var(--gap) * 1 / 2));
  --cols-3: calc(33% - (var(--gap) * 1 / 3));
  --cols-4: calc(25% - (var(--gap) * 3 / 4));
  --cols-5: calc(20% - (var(--gap) * 4 / 5));
 
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap) !important;
}

:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="SYSTEM-tab"])) .mt-3 {
    margin-top:0;
  }

/* First Service - 100% Width */
:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="SYSTEM-tab"])) #layout-groups > .services-group:nth-child(-n+1) {
  flex: 1 1 var(--cols-1) !important;
  max-width: var(--cols-1) !important;
}

/* Services 2 - 5 - 50% width each */
:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="SYSTEM-tab"])) #layout-groups > .services-group:nth-child(n+2):nth-child(-n+5) {
  flex: 1 1 var(--cols-2) !important;
  max-width: var(--cols-2) !important;
}

/* Services 6 - 8 - 30% width each */
:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="SYSTEM-tab"])) #layout-groups > .services-group:nth-child(n+6):nth-child(-n+8) {
  flex: 1 1 var(--cols-3) !important;
  max-width: var(--cols-3) !important;
}

/* Hide services after the 8th one */
:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="SYSTEM-tab"])) #layout-groups > .services-group:nth-child(n+9) {
  display: none !important;
}

:is([id="inner_wrapper"]:has(#tabs [aria-selected="true"][id="SYSTEM-tab"])) .text-sm {
  white-space: pre-line;
  text-align: left;
  font-size: 1em;
  
  &::first-line {
    margin-bottom: var(--spacing-xs);
  }
}

/*==================================
  BOOKMARK SECTION STYLES
==================================*/
/* Bookmark section container */
.flex.flex-col.mt-3.bookmark-list {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md) var(--spacing-sm) 0 var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

/* Bookmark icon background */
.bookmark-icon {
  background-color: var(--color-bookmark-icon) !important;
}


/*==================================
  TEXT STYLES
==================================*/
/* Small text styling with pre-line whitespace */
.text-sm {
  white-space: pre-line;
  text-align: center;
  font-size: 1em;
  
  &::first-line {
    margin-bottom: var(--spacing-xs);
  }
}

/* Hide elements with _hidden prefix */
[data-name^="_hidden"] .service-title,
.bookmark-group .bookmark-group-name {
  display: none;
}

/* Hide elements with _hidden prefix */
[data-name^="_invisible"] .service-title,
.bookmark-group .bookmark-group-name {
  opacity: 0;
}

/* Hide footer completely */
#footer {
  display: none;
}