/* Importing Google Sans font */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&display=swap');

/* General body styling */
body, .mud-typography-body1 {
    font-family: 'Google Sans', sans-serif;
    font-weight: 400; /* Normal weight for body text */
    font-size: 16px;
    line-height: 1.5;
    color: var(--mud-palette-text-primary);
    margin: 0;
    padding: 0;
}

/* Header styling */
h1, h2, h3, h4, h5, h6, .mud-typography-h1, .mud-typography-h2, .mud-typography-h3, .mud-typography-h4, .mud-typography-h5, .mud-typography-h6 {
    font-family: 'Google Sans', sans-serif;
    color: var(--mud-palette-text-primary);
    margin: 0;
    padding: 0;
}

h1, .mud-typography-h1 {
    color: var(--mud-palette-text-primary);
    font-size: 26px;
    font-weight: 500; /* Adjusted weight */
    margin-bottom: 8px;
    padding-top: 30px;
}

h2, .mud-typography-h2 {
    color: var(--mud-palette-text-primary);
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 8px;
    padding-top: 26px;
}

h3, .mud-typography-h3 {
    color: var(--mud-palette-text-primary);
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    padding-top: 22px;
}

h4, .mud-typography-h4 {
    color: var(--mud-palette-text-primary);
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    padding-top: 18px;
}

h5, .mud-typography-h5 {
    color: var(--mud-palette-text-primary);
    font-size: 16px;
    font-weight: 400; /* Normal weight */
    margin-bottom: 8px;
}

h6, .mud-typography-h6 {
    color: var(--mud-palette-text-primary);
    font-size: 14px;
    font-weight: 400; /* Normal weight */
    margin-bottom: 8px;
}

/* Paragraph styling */
p, .mud-typography-body2 {
    color: var(--mud-palette-text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

ul {
    list-style-type: disc;
    padding-left: 20px;
    color: var(--mud-palette-text-secondary);
    font-size: 14px;
}

li {
    margin-bottom: 5px;
}



/* Links */
a {
    color: var(--mud-palette-primary);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* Other text elements */
strong {
    font-weight: 700;
}

em {
    font-style: italic;
}

small {
    font-size: 0.875em;
    color: var(--mud-palette-text-secondary);
}

/* Utility classes */
.text-muted {
    color: var(--mud-palette-text-secondary);
}

/* Existing classes - adjusted for GCP style */
.image-container {
    display: flex;
    align-items: center;
    height: 100%;
}

.appbar-button {
    margin-right: 8px;
    margin-left: 8px;
}

.responsive-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.text-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 400px;
}

.section {
    padding-top: 40px;
    padding-bottom: 40px;
}



/* Loading image start */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8); /* fallback */
    background-color: color-mix(in srgb, var(--mud-palette-background) 80%, transparent);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    animation: delayedFadeIn 0.3s ease-in 0.25s forwards;
}

.loading-gif {
    max-width: 150px;
    max-height: 150px;
    width: 100%;
    height: auto;
}

@keyframes delayedFadeIn {
    0% {
        opacity: 0;
        visibility: hidden;
    }

    100% {
        opacity: 1;
        visibility: visible;
    }
}

.loading-container.hide {
    animation: quickFadeOut 0.3s ease-out forwards;
}

@keyframes quickFadeOut {
    0% {
        opacity: 1;
        visibility: visible;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}
/* Loading image end */


.responsive-padding {
    padding: var(--zen-layout-pad-y) var(--zen-layout-pad-x);
    padding-top: calc(var(--zen-appbar-height) + var(--zen-layout-pad-y));
}

.zen-auth-container {
    min-height: calc(100vh - var(--zen-appbar-height) - var(--zen-layout-pad-y));
    min-height: calc(100dvh - var(--zen-appbar-height) - var(--zen-layout-pad-y));
    display: flex;
    align-items: center;
    justify-content: center;
}

.zen-auth-status {
    width: min(100%, 420px);
    padding: 32px;
}

.zen-auth-icon {
    opacity: 0.9;
}

.article-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.markdown-wrapper {
    width: 100%;
}

.not-found {
    text-align: center;
}

/* Ordered list styling */
ol {
    list-style-type: decimal;
    padding-left: 20px;
    color: var(--mud-palette-text-secondary);
    font-size: 14px;
}

/* Make sure both ol and ul share the same li styles */
ol li,
ul li {
    margin-bottom: 5px;
    line-height: 1.5;
}

/* Nested list styling */
ol ol,
ul ul,
ol ul,
ul ol {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Table styling */
.markdown-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
    box-shadow: 0 1px 3px var(--mud-palette-lines-default);
    border-radius: 8px;
    overflow: hidden;
}

.markdown-wrapper th {
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font-weight: 500;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.markdown-wrapper td {
    color: var(--mud-palette-text-secondary);
    padding: 12px 16px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.markdown-wrapper tr:last-child td {
    border-bottom: none;
}



/* For responsive tables */
@media (max-width: 600px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}



/* 1. Styling for inline code, like `POST` */
/* This rule targets <code> tags that are NOT inside a <pre> block */
.markdown-wrapper :not(pre) > code {
    display: inline !important; /* Force the element to be inline */
    width: auto !important;     /* Ensure it only takes up the space it needs */
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    background-color: var(--mud-palette-background-grey);
    color: var(--mud-palette-text-primary);
    font-size: 0.875em;
    padding: 0.2em 0.4em;
    margin: 0 0.1em; /* Adds a tiny bit of horizontal space */
    border-radius: 6px;
    vertical-align: baseline; /* Helps with vertical alignment */
}

/* 2. Styling for code blocks (from triple backticks) */
/* This styles the container */
.markdown-wrapper pre {
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 16px;
    overflow: auto; /* Adds a scrollbar for wide code */
    line-height: 1.45;
}

/* This styles the code text itself inside the block */
.markdown-wrapper pre code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    background-color: transparent; /* The <pre> container handles the background */
    color: var(--mud-palette-text-primary);
    font-size: 0.875em;
    padding: 0; /* Reset padding */
}

.mud-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.mud-main-content {
    flex: 1;
}

.footer-container {
    /* DEPRECATED: Footer removed in Phase 2C */
    padding: 1rem;
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-secondary);
    box-shadow: 0 -1px 2px rgba(60, 64, 67, 0.3);
}



/*
  DEPRECATED: replaced by inline icon in Phase 2A-2
  Container for positioning the logo in the center.
*/
.appbar-center-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    display: flex;
    align-items: center;
    padding: 8px 0; /* Controls vertical padding */
}

/*
  DEPRECATED: replaced by inline icon in Phase 2A-2
  The link now defines the logo's dimensions.
  It needs an explicit width for the background image to be visible.
*/
.appbar-center-container a {
    display: block;
    height: 100%;
    width: 280px; /* Set the width of your logo here */
}


@media (max-width: 360px) {
    .appbar-center-container a {
        width: 200px; /* Very small on narrow phones */
    }
}

/* ============================================
   Appbar Search (Phase 2A-3)
   ============================================ */

.mud-appbar .mud-toolbar {
    gap: 8px;
}

.zen-appbar-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    align-self: center;
    justify-content: flex-start;
}

.zen-appbar-logo {
    display: flex;
    align-items: center;
    padding: 4px;
    text-decoration: none;
}

.zen-appbar-logo img {
    height: 36px;
    width: 36px;
    display: block;
}

.zen-appbar-brand {
    gap: 10px;
    color: var(--mud-palette-text-primary);
    font-weight: 600;
}

.zen-appbar-logo-text {
    line-height: 1;
}

.zen-appbar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.zen-appbar-search {
    flex: 0 1 720px;
    min-width: 200px;
}
.zen-appbar-search .mud-input-outlined {
    border-radius: 24px;
}
.zen-appbar-search .mud-input-outlined input::placeholder {
    text-align: center;
}
.zen-appbar-search .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--mud-palette-lines-default);
}
.zen-appbar-search:focus-within .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--mud-palette-primary);
}

/* ============================================
   SplitContainer Splitter Bar Styling
   ============================================ */

/* Override splitter bar size and add visual styling */
/* Note: the class name has a typo in the library - it's "spliter-bar" not "splitter-bar" */
.split-container {
    --splitter-bar-size: 6px;
}

/* Style the splitter bar itself - using the actual class name from the library */
.split-container > .spliter-bar {
    background-color: var(--mud-palette-lines-default, #e0e0e0) !important;
    transition: background-color 0.15s ease;
}

.split-container > .spliter-bar:hover,
.split-container > .spliter-bar:active {
    background-color: var(--mud-palette-primary, #1976d2) !important;
}

/* ============================================
   ZentrumDocs Design Tokens
   ============================================ */

:root {
    --zen-appbar-height: 64px;
    --zen-layout-pad-x: 24px;
    --zen-layout-pad-y: 24px;

    /* Warm pastel teal - complement-adjacent to burnt orange (#E64A19) */
    --zen-toolbar-tint: rgba(126, 214, 201, 0.07);
    --zen-toolbar-tint-hover: rgba(126, 214, 201, 0.12);
    --zen-toolbar-tint-rgb: 126, 214, 201;
    
    /* Shared transition timing */
    --zen-transition-fast: 150ms ease;
    --zen-transition-normal: 200ms ease;
}

@media (min-width: 960px) {
    :root {
        --zen-layout-pad-x: 32px;
    }
}

@media (max-width: 600px) {
    :root {
        --zen-appbar-height: 56px;
        --zen-layout-pad-x: 16px;
        --zen-layout-pad-y: 16px;
    }
}
