/* ==========================================================
   1. FONTS & GLOBAL (Targeted Google Sans)
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap');

/* Apply Google Sans to the main elements but NOT the universal '*' */
body,
.service-name,
.service-description,
.group-header,
.service-url {
    font-family: 'Google Sans', sans-serif !important;
}

/* Header stays Google Sans */
#widgets-wrap,
#widgets-wrap * {
    font-family: 'Google Sans', sans-serif !important;
}

body {
    background-color: #030405 !important;
    color: #e2e8f0 !important;
}

/* ==========================================================
   2. HEADER WIDGETS LAYOUT (THE FIX)
   ========================================================== */
#widgets-wrap {
    display: grid !important;
    /* We make 5 columns: Greeting | Date | Weather 1 | Weather 2 | Resources */
    grid-template-columns: 1fr auto auto auto 1.2fr !important;
    grid-template-rows: auto auto !important;
    gap: 20px 30px !important;
    align-items: center !important;
    width: 100% !important;
    padding: 10px 0 !important;
}

/* Unpack the containers so everything sits in the main grid */
#information-widgets-left,
#information-widgets-right {
    display: contents !important;
}

/* Col 1: Greeting */
.information-widget-greeting {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
}

.information-widget-greeting span {
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    display: inline-block !important;
}

/* Col 2: Date */
.information-widget-datetime {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
}

/* Cols 3 & 4: Weather Widgets (The Elegant Fix)
   By NOT giving these a specific column number, CSS Grid automatically 
   places the first one in Col 3 and the second one in Col 4! */
.widget-container:has(.information-widget-openweathermap) {
    grid-row: 1;
    justify-self: center;
}

.information-widget-openweathermap {
    text-transform: capitalize;
}

/* Col 5: Resources */
.widget-container:has(.information-widget-resource) {
    grid-column: 5;
    grid-row: 1;
    justify-self: end;
}

.widget-container:has(.information-widget-resource)>div {
    display: grid !important;
    grid-template-columns: repeat(2, auto) !important;
    grid-template-rows: repeat(2, auto) !important;
    gap: 8px 24px !important;
}

.information-widget-resource {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    white-space: nowrap !important;
    min-width: 130px !important;
}

/* Row 2: Search Bar */
.information-widget-search {
    grid-column: 1 / -1 !important;
    /* -1 forces it to span all 5 columns */
    grid-row: 2;
    width: 100% !important;
}

.information-widget-search div {
    width: 100% !important;
}

/* ==========================================================
   3. THE CARDS (RESTORED WITH GAP FIXES)
   ========================================================== */
.relative.flex.flex-col.items-center.justify-center {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    padding: 1rem 1.25rem !important;
    /* CRUSHES THE TOP GAP */
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    backdrop-filter: blur(4px);
}

.relative.flex.flex-col.items-center.justify-center:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px);
}

.service-card {
    background-color: hsla(314, 20%, 20%, 0.3) !important;
}

.service-card,
.card {
    box-shadow: none !important;
}

.service-icon {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
    width: 48px !important;
    height: 48px !important;
}

.service-title,
.service-name {
    font-weight: 600 !important;
    color: #ffffff !important;
    font-size: 0.9rem !important;
    letter-spacing: -0.01em !important;
    margin-top: 0 !important;
    /* REMOVES THE PUSH DOWN ON TEXT */
}

.service-description {
    color: #94a3b8 !important;
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
    margin-top: 0.25rem !important;
}

.service-url,
.service-status {
    font-size: 0.75rem !important;
}

/* Rips the status container out of the layout so it stops pushing icons down */
.service-status {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    margin: 0 !important;
}

/* Pins the green dot perfectly in the corner */
[class*="status-indicator"] {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
    border-radius: 50% !important;
    margin: 0 !important;
}

/* Hides the "OK" text next to the dot */
.status-text {
    display: none !important;
}

/* ==========================================================
   4. GROUP HEADERS
   ========================================================== */
.group-header {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 1.25rem !important;
    border-left: 3px solid #1e293b !important;
    padding-left: 12px !important;
}

/* Shield widgets from global font-family width issues */
.service-card div.flex-row,
.service-card div.flex-row * {
    font-family: ui-sans-serif, system-ui, sans-serif !important;
    white-space: normal !important;
    /* This allows the wrap you want */
}