/* Layout and controls consume the canonical shared palette definitions. */
@import url('./theme.css');

/* General styles for the page layout */
html {
    font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    background: var(--background);
    color: var(--text-color);
}

body {
    display: grid;
    grid-template-columns:11em minmax(0,1fr); /* Sidebar and content split */
    grid-template-rows: auto 1fr; /* Header and main content */
    height: 100vh;
    margin: 0;
    background: var(--background);
    color:var(--text-color);
}

.header {
    grid-column: 1 / -1; /* Header spans full width */
}

.nav {
    grid-row: 2 / -2; /* Sidebar spans full height, below header */
}

main {
    grid-row: 2 / -1; /* Main content below header */
    background: var(--modal-background);
    border-radius: 0.5em 0 0 0;
    overflow: auto;
    padding: 1em;
}

main.data-chat{
    display:grid;
    gap:1em;
    grid-template-rows:auto minmax(0,1fr);
    overflow:hidden;
}

.data-workspace{
    height:100%;
    min-height:0;
}

/* Typography */
h1, h2, h3, h4, h5, h6, p {
    margin: 0.5em 0;
    padding: 0;
    color: var(--text-color);
    font-weight: 400;
}

strong {
    color:var(--accent-color);
    font-weight: bold;
}

a{
    color:var(--accent-color);
    text-underline-offset:.18em;
}

/* Form inputs and buttons */
input, textarea {
    box-sizing:border-box;
    font:inherit;
    padding: 1em;
    border: 1px solid var(--border-color);
    border-radius: 0.5em;
    background-color: var(--modal-background);
    color: var(--text-color);
    margin: 0.5em 0;
    transition:border-color 180ms,box-shadow 180ms;
}

input::placeholder,
textarea::placeholder{
    color:var(--platinum);
    opacity:.78;
}

button {
    font:inherit;
    padding: 0.5em 1em;
    margin: 10px auto;
    border-radius: 0.5em;
    border: 1px solid var(--border-color);
    background-color: var(--primary-color);
    color: var(--button-text-color, var(--text-color)); 
    box-shadow:0 .12em .35em var(--shadow-color);
    transition:background-color 180ms,border-color 180ms,box-shadow 180ms,transform 120ms;
    cursor: pointer;
}

button:hover {
    background-color: var(--secondary-color);
    color:var(--text-color);
    box-shadow:0 .2em .55em var(--shadow-color);
}

button:active:not(:disabled){
    transform:translateY(1px);
}

button:disabled {
    opacity: 0.5;
    background-color: var(--border-color);
    cursor: not-allowed;
}

select {
    font:inherit;
    padding: 0.5em;
    border: 1px solid var(--border-color);
    border-radius: 0.5em;
    background-color: var(--modal-background);
    color: var(--text-color);
    appearance: none;
    transition:border-color 180ms,box-shadow 180ms;
}

input:hover,
textarea:hover,
select:hover{
    border-color:var(--platinum);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible{
    outline:.18em solid var(--focus-color);
    outline-offset:.14em;
}

::selection{
    background:var(--secondary-color);
    color:var(--text-color);
}

html{
    scrollbar-color:var(--platinum) var(--background);
}

code{
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
    line-height: 1.5;
    text-align: left;
}

/* Inline code */
:not(pre) > code{
    padding: 0.15em 0.35em;
    border-radius: 0.35em;
    background: var(--modal-background);
    color: var(--accent-color);
    white-space: break-spaces;
}



/* Code blocks */
pre{
    margin: 1em 0;
    padding: 1em;
    border-radius: 0.65em;
    background: var(--background);
    color: var(--text-color);
    overflow-x: auto;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-align: left;
}

/* Code inside pre */
pre code{
    display: block;
    padding: 0;
    background: transparent;
    color: inherit;
    white-space: pre;
    overflow-wrap: normal;
    tab-size: 4;
}

/* Visibility classes */
.visible {
    display: block !important;
}

.hidden {
    display: none !important;
}

/* Drag region */
.block-input {
    -webkit-app-region: drag;
}

/* Media Queries for responsiveness */
@media (max-width: 48em) {
    body {
        grid-template-columns:3.25em minmax(0,1fr);
    }
    
    button {
        font-size:1em;
    }
    
    textarea, input {
        width: 100%;
    }

    main{
        padding:.75em;
    }
}

@media (prefers-reduced-motion:reduce){
    *,
    *::before,
    *::after{
        animation-duration:.01ms !important;
        animation-iteration-count:1 !important;
        scroll-behavior:auto !important;
        transition-duration:.01ms !important;
    }
}

:root[data-color-scheme="dark"] a{
    color:var(--secondary-color);
}

@media (prefers-color-scheme:dark){
    :root:not([data-color-scheme]) a{
        color:var(--secondary-color);
    }
}
