* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@font-face {
    font-display: swap;
    font-family: 'Inconsolata';
    font-style: normal;
    font-weight: 100 900;
    src: url('fonts/Inconsolata-VariableFont.ttf') format('truetype');
}

@font-face {
    font-display: swap;
    font-family: 'Equity';
    font-style: normal;
    font-weight: normal;
    src: url('fonts/equity_ot_a_regular.woff2') format('woff2');
}

@font-face {
    font-display: swap;
    font-family: 'Equity';
    font-style: italic;
    font-weight: normal;
    src: url('fonts/equity_ot_a_italic.woff2') format('woff2');
}

@font-face {
    font-display: swap;
    font-family: 'Equity';
    font-style: normal;
    font-weight: bold;
    src: url('fonts/equity_ot_a_bold.woff2') format('woff2');
}

@font-face {
    font-display: swap;
    font-family: 'Equity';
    font-style: italic;
    font-weight: bold;
    src: url('fonts/equity_ot_a_bold_italic.woff2') format('woff2');
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    height: 100%;
    overflow: hidden;
}

.container {
    background-color: #f9f9f9;
    display: flex;
    height: 100%;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.container.right-collapsed {
    background-color: white;
}

@media (max-width: 767px) {
    .pane-content {
        padding: 0 !important;
    }

    #editor {
        font-size: 18px !important;
        padding: 15px 80px 15px 15px !important;
    }

    #preview {
        font-size: 19px !important;
        padding: 15px 15px 15px 80px !important;
    }
}

.pane {
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    transition: none;
    width: 50%;
}

.pane-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    -ms-overflow-style: none;
    min-height: 100%;
    overflow: auto;
    padding: 0 4rem;
    scrollbar-width: none;
    transition: none;
}

.pane-content::-webkit-scrollbar {
    display: none;
}

.left-collapsed .right-pane,
.right-collapsed .left-pane {
    display: flex;
    justify-content: center;
    width: 100%;
}

.left-collapsed .right-pane .pane-content,
.right-collapsed .left-pane .pane-content {
    box-sizing: border-box;
    margin: 0 auto !important;
    max-width: 760px !important;
    padding: 4rem 0;
    width: 100%;
}

.left-collapsed .right-pane .pane-content #preview,
.right-collapsed .left-pane .pane-content #editor {
    max-width: 760px;
    padding-left: 0;
    padding-right: 0;
    width: 100%;
}

.left-pane {
    background-color: white;
    font-family: 'Inconsolata', monospace;
    font-size: 21px;
    font-weight: 450;
    position: relative;
}

.divider {
    background-color: #ddd;
    height: 100%;
    left: 50%;
    position: absolute;
    top: 0;
    transition: none;
    width: 1px;
    z-index: 5;
}

.left-collapsed .divider,
.right-collapsed .divider {
    display: none;
}

.right-pane {
    background: #f9f9f9;
    font-family: 'Equity', serif;
    font-size: 22px;
}

.left-pane .pane-content {
    font-family: 'Inconsolata', monospace;
}

.right-pane .pane-content {
    font-family: 'Equity', serif;
}

.right-pane h1, 
.right-pane h2, 
.right-pane h3, 
.right-pane h4, 
.right-pane h5, 
.right-pane h6 {
    font-family: 'Equity', serif;
    font-weight: bold;
}

.right-pane em, 
.right-pane i {
    font-style: italic;
}

.right-pane strong, 
.right-pane b {
    font-weight: bold;
}

.toggle-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    left: 50%;
    min-height: 225px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: none;
    z-index: 10;
}

.toggle-button-container {
    height: 40px;
    position: relative;
    transition: none;
}

.toggle-button {
    align-items: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    height: 40px;
    justify-content: center;
    transition: none;
    width: 40px;
}

.toggle-button:hover {
    border: 1px solid #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.toggle-button img {
    height: 20px;
    width: 20px;
}

.left-collapsed .left-pane {
    display: none;
    width: 0;
}

.right-collapsed .right-pane {
    display: none;
    width: 0;
}

.left-collapsed .toggle-controls {
    left: 20px;
    transform: translateY(-50%);
}

.right-collapsed .toggle-controls {
    left: calc(100% - 20px);
    transform: translate(-100%, -50%);
}

.left-collapsed .toggle-right-container,
.right-collapsed .toggle-left-container {
    display: none;
}

.left-collapsed #toggle-left,
.right-collapsed #toggle-right {
    border: 1px solid #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.toggle-copy-container {
    position: relative;
}

.toggle-button.copied {
    border: 1px solid #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.toggle-download-container {
    position: relative;
}

.toggle-button.downloading {
    border: 1px solid #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.toggle-import-container {
    position: relative;
}

.toggle-button.importing {
    border: 1px solid #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.toggle-button.importing-success {
    border: 1px solid #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.toggle-delete-container {
    position: relative;
}

.toggle-button.deleting {
    border: 1px solid #EF4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

#editor {
    background: transparent;
    border: none;
    caret-color: #2563eb;
    caret-shape: block;
    color: inherit;
    flex: 1;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.5;
    margin: 0;
    -ms-overflow-style: none;
    outline: none;
    padding: 3rem 0 3rem 0;
    resize: none;
    scrollbar-width: none;
    width: 100%;
}

#editor::-webkit-scrollbar {
    display: none;
}

@supports (caret-width: 2px) {
    #editor {
        caret-width: 2px;
    }
}

#editor::selection,
#editor::-moz-selection,
#preview::selection,
#preview::-moz-selection,
.container ::selection,
.container ::-moz-selection {
    background-color: #DAE4FC;
    color: inherit;
}

#preview {
    flex: 1;
    line-height: 1.6;
    -ms-overflow-style: none;
    padding: 3rem 0 3rem 0;
    scrollbar-width: none;
    width: 100%;
}

#preview::-webkit-scrollbar {
    display: none;
}

#preview > *:first-child {
    margin-top: 0;
}

#preview h1, #preview h2, #preview h3, #preview h4, #preview h5, #preview h6 {
    line-height: 1.3;
    margin-bottom: 0.5em;
    margin-top: 1.5em;
}

#preview h1 {
    font-size: 2em;
}

#preview h2 {
    font-size: 1.5em;
}

#preview h3 {
    font-size: 1.2em;
}

#preview p, #preview ul, #preview ol, #preview blockquote {
    margin-bottom: 1em;
}

#preview ul, #preview ol {
    padding-left: 2em;
}

#preview blockquote {
    border-left: 3px solid #ddd;
    color: #666;
    padding-left: 1em;
}

#preview code {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    font-family: 'Inconsolata', monospace;
    font-size: 0.9em;
    padding: 0.2em 0.4em;
}

#preview pre {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    margin-bottom: 1em;
    overflow-x: auto;
    padding: 1em;
}

#preview pre code {
    background-color: transparent;
    padding: 0;
}

#preview a {
    color: #2563eb;
    text-decoration: none;
}

#preview a:hover {
    text-decoration: underline;
}

#preview img {
    height: auto;
    max-width: 100%;
}

#preview table {
    border-collapse: collapse;
    margin-bottom: 1em;
    width: 100%;
}

#preview th, #preview td {
    border: 1px solid #ddd;
    padding: 0.5em;
}

#preview th {
    background-color: rgba(0, 0, 0, 0.05);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.toggle-button.downloading img,
.toggle-button.importing img,
.toggle-button.deleting img {
    animation: spin 1.5s linear infinite;
}

.toggle-button.sync-active {
    border: 1px solid #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.toggle-button.sync-connected {
    border: 1px solid #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.toggle-button.sync-error {
    border: 2px solid #e74c3c;
}

.tooltiptext {
  visibility: hidden;
  width: 140px;
  background-color: #2563eb;
  color: #fff;
  text-align: center;
  padding: 5px 7.5px;
  border-radius: 5px;
  position: absolute;
  left: 50px;
  z-index: 1;
}

.toggle-button:hover img, .left-collapsed #toggle-left img, .right-collapsed #toggle-right img, .sync-active img {
    filter: invert(34%) sepia(87%) saturate(2336%) hue-rotate(216deg) brightness(96%) contrast(93%);
}

.toggle-button.copied img {
    filter: invert(67%) sepia(14%) saturate(1080%) hue-rotate(101deg) brightness(92%) contrast(85%);
}

.toggle-button.deleting img {
    filter: invert(42%) sepia(75%) saturate(1381%) hue-rotate(328deg) brightness(98%) contrast(91%);
}

.container.right-collapsed .tooltiptext {
    left: -150px !important;
}

.toggle-button:hover .tooltiptext {
  visibility: visible;
}