/* Theme style variables */
:root {
    --highlight-color-main: #dd7230;
    --highlight-color-secondary: #eb5160;
    --highlight-color-tertiary: #2b7fff;
}

html[data-theme="dark"] {
    --dark: initial;
    --light: ;
}

html[data-theme="light"] {
    --dark: ;
    --light: initial;
}

html,
body {
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}

.dark-mode-only {
    display: var(--dark, initial) var(--light, none);
}

.light-mode-only {
    display: var(--dark, none) var(--light, initial);
}

.preview-navbar {
    position: sticky;
    z-index: 1000;
    top: 0;
    display: flex;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--primary-color-6);
    background-color: var(--primary-color);
}

.navbar-link {
    padding: 0.5em 0;
    color: var(--secondary-color-4);
    font-size: 1.2em;
    font-weight: bold;
    text-decoration: none;
}

.navbar-link:hover {
    color: var(--secondary-color-3);
}

.navbar-links {
    display: flex;
    gap: 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    color: var(--secondary-color-4);
    font-size: 1.5em;
    font-weight: bold;
    text-decoration: none;
}

/* Code block styles */
.code-block {
    overflow: scroll;
    width: 100%;
    max-width: calc(100vw - 2rem);
    height: 100%;
    max-height: 80vh;
    box-sizing: border-box;
    padding: 0.5rem;
    border-radius: 0.5rem;
    margin: 0;
    font-family: "Courier New", Courier, monospace;
    white-space: pre;
}

.dark-code-block {
    display: var(--dark, block) var(--light, none);
}

.light-code-block {
    display: var(--dark, none) var(--light, block);
}

.code-block[data-collapsed="true"] {
    height: 10em;
    backdrop-filter: blur(1px);
    mask: linear-gradient(
        to bottom,
        rgb(0 0 0 / 100%) 0%,
        rgb(0 0 0 / 100%) 60%,
        rgb(0 0 0 / 0%) 100%
    );
    user-select: none;
}

.dark-mode-toggle {
    border: none;
    background: none;
    color: var(--secondary-color-4);
    cursor: pointer;
}

.copy-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    border: none;
    border-radius: 0.5rem;
    background: none;
    color: var(--secondary-color-4);
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.copy-button:hover {
    color: var(--highlight-color-tertiary);
}

.copy-button[data-copied="true"] {
    color: var(--secondary-success-color);
}

/* Demo frame styles */
.component-preview {
    display: flex;
    width: 100vw;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.component-preview-contents {
    display: flex;
    width: 75vw;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.component-preview-frame {
    display: flex;
    width: 100%;
    min-height: 25vh;
    max-height: 100%;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 1px solid var(--primary-color-6);
    border-radius: 0.5em;
    background-color: var(--primary-color-2);
}

/* component info styles */
.component-title {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 2em;
    text-align: center;
    text-transform: capitalize;
}

.component-variants-title {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
    text-transform: capitalize;
}

.component-description {
    margin: 5vw;
    font-size: 1em;
    overflow-x: scroll;
}

.component-installation {
    width: 100%;
    padding: 1rem;
}

.component-installation-list {
    list-style-type: decimal;
    padding-left: 2rem;
}

.component-installation-list li {
    margin-bottom: 0.5rem;
    font-size: 1em;
}

.component-code {
    display: flex;
    width: 100%;
    min-height: 25vh;
    max-height: 100%;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 2rem;
    border-top-left-radius: 0.5em;
    border-top-right-radius: 0.5em;
}

/* Masonry styles */
.masonry-with-columns {
    display: flex;
    flex-wrap: wrap;
    padding: 0 0 0 1rem;
}

.masonry-with-columns .masonry-preview-frame {
    display: flex;
    max-width: calc(100vw - 2rem);
    min-height: 10rem;
    box-sizing: border-box;
    flex: 1 0 auto;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
    border: 1px solid var(--primary-color-6);
    border-radius: 0.5rem;
    margin: 0 1rem 1rem 0;
    background-color: var(--primary-color-2);
}

.masonry-with-columns .masonry-component-frame {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Disable animations while the page is loading */
.preload * {
    transition: none !important;
    animation-duration: 0.001s !important;
}
