/**
 * Copyright (c) 2023-2025, WSO2 LLC. (https://www.wso2.com).
 *
 * WSO2 LLC. licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

:root,
[data-md-color-scheme=default] {
    --md-home-body-gradient: conic-gradient(from 180deg at 50% 50%, #2a8af6 0deg, #d9a300 180deg, var(--md-primary-fg-color) 1turn);
    min-height: auto;
}

.md-home-gradient {
    background: var(--md-home-body-gradient);
    width: 1000px;
    height: 1000px;
    display: block;
    mix-blend-mode: normal;
    filter: blur(75px);
    opacity: .15;
    will-change: filter;
    border-radius: 9999px;
    max-width: 100%;
    top: -500px;
    position: absolute;
}

.md-home-search-container {
    margin: 0 auto 10px;
}

.md-home-search-input-label {
    margin-bottom: 0.5em;
}

.md-home-search-input-description {
    display: block;
    max-width: 800px;
    margin: 2em 0 5em;
}

.md-home-sections {
    max-width: var(--md-main-content-max-width);
}

.md-column-grid {
    margin: auto;
    display: flex;
    align-items: start;
    justify-content: space-between;
}

.md-grid-column {
    width: 32%;
    display: inline-block;
    vertical-align: top;
    margin: 20px;
}

.md-grid-column:last-child {
    margin-right: 0;
}

.md-column-grid-item {
    margin: 0 0 20px 0;
    -webkit-column-break-inside: avoid;
    -moz-column-break-inside: avoid;
}

.md-column-grid-item-header-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.md-column-grid-item-header-text {
    font-size: .8rem;
    font-weight: 600;
    line-height: 2.5;
}

.md-column-grid-item-header-icon {
    background: #F7F8FB;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    gap: 10px;
    height: 2rem;
    width: 2rem;
    display: inline-block;
}

.md-column-grid-item-header-icon>svg {
    transform: translate(-50%, -50%);
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 45%;
}

.md-list-item>a {
    color: var(--md-default-fg-color);
    display: block;
    padding: 10px 0;
    white-space: nowrap;
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-list-item:last-child>a {
    border-bottom: none;
}

.md-list-item-icon {
    margin-right: 0.5rem;
    vertical-align: top;
}

.md-list-item-icon,
.md-list-item-text {
    max-width: 92%;
    white-space: normal;
}

.md-list-item-icon,
.md-list-item-text {
    display: inline-block;
}

.md-list-item-icon svg>path {
    fill: var(--md-primary-fg-color);
}

.md-search__icon[for=__search] {
    top: 0.8rem;
}

[dir=ltr] .md-search__icon[for=__search] {
    left: 0.8rem;
}

.md-search-result__icon {
    margin: 0.5rem 0.9rem;
}

[dir=ltr] .md-search__inner {
    float: none;
    width: 600px;
    height: auto;
    position: relative;
    opacity: 1;
    transform: none;
    max-width: 100%;
}

[dir=ltr] .md-search__input {
    padding-left: 2.8rem;
    height: 100%;
}

.md-search__output {
    top: 2.9rem;
}

.md-search__form {
    height: 2.8rem;
}

.md-search__icon[for=__search] svg:first-child {
    display: block;
}

.md-search__icon[for=__search] svg:last-child {
    display: none;
}

[data-md-toggle=search]:checked~.md-container .md-home-search-container .md-search__inner {
    overflow: visible;
}

[data-md-toggle=search]:checked~.md-container .md-home-search-container .md-search__form {
    background-color: var(--md-default-bg-color);
    border-radius: 0.1rem 0.1rem 0 0;
    box-shadow: 0 0 0.6rem #00000012;
    color: var(--md-default-fg-color);
}

[data-md-toggle=search]:checked~.md-container .md-home-search-container .md-search__scrollwrap {
    max-height: 50vh;
}

[data-md-toggle=search]:checked~.md-container .md-home-search-container .md-search__output {
    box-shadow: var(--md-shadow-z3);
    opacity: 1 !important;
    bottom: auto;
}

[data-md-toggle=search]:checked~.md-container .md-home-search-container .md-search__output .md-search-result__list {
    margin: 0;
}

[data-md-toggle=search]:checked~.md-container .md-home-search-container .md-search__output .md-search-result__item {
    margin-left: 0;
}

[data-md-toggle=search]:checked~.md-container .md-home-search-container .md-search__overlay {
    background-color: #0000008a;
    height: 200vh;
    opacity: 1 !important;
    transition: width 0ms, height 0ms, opacity .25s;
    width: 100%;
    cursor: pointer;
    left: 0;
    position: fixed;
    top: 0;
    border-radius: 0 !important;
    pointer-events: auto;
}

[dir=ltr] .md-search-result__meta {
    padding-left: 2.8rem;
}

[dir=ltr] .md-search-result__article {
    padding-left: 2.9rem;
}

[dir=ltr] .md-search-result__more>summary>div {
    padding-left: 1.5rem;
}

[dir=ltr] .md-search-result__more>summary:before {
    left: 1.3rem;
    top: 0.8rem;
}

.md-search__scrollwrap {
    width: 100% !important;
}

.md-sidebar--secondary {
    display: none !important;
}

@media screen and (min-width: 76.25em) {
    [data-md-toggle=search]:checked~.md-header .md-tabs,
    [data-md-toggle=search]:checked~.md-header .md-header__version-select-dropdown {
        opacity: 1 !important;
    }

    [dir=ltr] .md-sidebar--secondary:not([hidden])~.md-content > .md-content__inner,
    [dir=rtl] .md-sidebar--primary:not([hidden])~.md-content > .md-content__inner {
        max-width: 1200px !important;
    }
}

@media screen and (max-width: 76.1875em) {
    .md-column-grid {
        flex-direction: column;
    }

    .md-grid-column {
        width: 100%;
        display: block;
    }
}

/* New implementation of a gradient background */
.md-content::before {
    content: "";
    
    background: var(--md-home-body-gradient);
    
    width: 1000px;
    height: 1000px;
    border-radius: 50%;
    
    position: absolute;
    top: -500px;        
    left: 50%;          
    transform: translateX(-50%); 
    
    filter: blur(75px);
    opacity: 0.15;
    
    z-index: -1;
    pointer-events: none;
}

.md-content {
    position: relative;
    overflow: visible; 
}

/* Rules for styling APIM component cards */

/* Container for the whole layout */
.components-hub-container {
  max-width: 1200px;
  margin: 0 auto;
  color: var(--md-default-fg-color);
}

.components-section-header {
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.components-section-header h2 {
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--md-default-fg-color);
}

.components-section-header p {
  color: var(--md-default-fg-color--light);
  margin: 0;
}

.components-grid-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.components-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.components-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* Stack columns on small screens */
@media (max-width: 768px) {
  .components-grid-split, .components-grid-2, .components-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Card Styling */
.components-card {
  box-shadow: var(--md-shadow-z1); 
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px; 
  
  background-color: var(--md-default-bg-color);
  
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  transition: box-shadow 0.2s;
}

.components-card:hover {
    box-shadow: var(--md-shadow-z2);
}

.components-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 500;
  color: var(--md-default-fg-color);
}

.components-card-content {
  line-height: 1.5;
  color: var(--md-default-fg-color);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Container for the links in the components cards. 
   Uses negative margins to counteract the .components-card padding
   so the links span the full width of the card.
*/
.components-card-footer {
  margin-top: auto; 
  margin-left: -15px; 
  margin-right: -15px;
  margin-bottom: -15px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

.components-resource-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 15px; 
  text-decoration: none;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  color: var(--md-default-fg-color--light); 
  transition: background-color 0.2s, color 0.2s;
}

/* Remove border from last item so it doesn't double up with card border */
.components-resource-link:last-child {
  border-bottom: none;
  /* Rounds the corners of the last link to match the card */
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.components-resource-link:hover span {
  transform: translateX(3px);
  transition: transform 0.2s;
}

.quickstart-cta {
  max-width: 1200px;
  margin: 2rem auto 3rem auto;
  padding: 1rem 1.5rem;
  
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;

  background-color: var(--md-default-bg-color);
  border-left: 4px solid var(--md-accent-fg-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border-radius: 4px;

  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.quickstart-cta:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.cta-icon {
  width: 32px; 
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; 
  
  color: var(--md-accent-fg-color);
  transition: transform 0.2s;
}

.cta-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.quickstart-cta:hover .cta-icon {
    transform: translateY(-2px) translateX(2px);
}

.cta-content {
  flex-grow: 1;
  font-size: var(--rem);
  line-height: 1.5;
  color: var(--md-default-fg-color);
}

.cta-title {
  font-weight: 600;
  font-size: var(--rem);
  color: var(--md-default-fg-color);
  margin-right: 0.5rem;
}

@media (max-width: 768px) {
  .quickstart-cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    border-left-width: 4px;
  }
}