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

body,
html {
    height: 100%;
    font-family: sans-serif;
}

.editor-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    transition: all 0.5s ease;
}

body>.editor-container {
    visibility: hidden;
}

#loading-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    font-size: 16px;
    text-align: center;
    font-family: Arial, sans-serif;
    color: #fff;
    font-weight: bold;
    z-index: 200;
}

#main__typing--text::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50%,
    100% {
        opacity: 1;
    }

    25%,
    75% {
        opacity: 0;
    }
}

.editor-container.editor-center,
.editor-container.editor-left,
.editor-container.editor-right {
    transition: all 0.5s ease;
}



#html-editor,
#css-editor,
#js-editor {
    text-align: left;
    direction: ltr;
    white-space: pre;
    width: 100%;
    background: #1d1e22;
    color: #fff;
    font-weight: bold;
}

#html-editor::-webkit-scrollbar,
#css-editor::-webkit-scrollbar,
#js-editor::-webkit-scrollbar {
    display: none;
}

.editors {
    display: flex;
    flex-direction: column;
    text-align: left;
    background: #111;
    position: relative;
}

.panel__search__countend span {
    font-size: 12px;
    color: red;
}

.highlight-match {
    background: yellow;
    color: transparent;
}

.highlight-match.current-match {
    background: orange;
}


.editor-container.editor-center .editors {
    flex-direction: row;
    height: 100%;
    flex: unset;
    width: 100%;
    min-width: unset;
    max-width: unset;
}

@media(min-width:1025px) {
    .editor-container.editor-center {
        flex-direction: column;
    }

    .editor-container.editor-right .editors {
        order: 2;
    }

    .editor-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(30, 30, 30, 0.85);
        color: #0f0;
        font-family: monospace;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 999;
        pointer-events: none;
        flex-direction: column;
        gap: 10px;
    }

    .editor-overlay .spinner {
        width: 20px;
        height: 20px;
        border: 3px solid #0f0;
        border-top: 3px solid transparent;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }

    .calendar-animation {
        display: grid;
        grid-template-columns: repeat(3, 20px);
        grid-gap: 5px;
        margin-bottom: 15px;
    }

    .calendar-animation .day {
        width: 20px;
        height: 20px;
        background: #fff;
        border-radius: 3px;
        animation: dayPulse 1s infinite;
    }

    .calendar-animation .day:nth-child(1) {
        animation-delay: 0s;
    }

    .calendar-animation .day:nth-child(2) {
        animation-delay: 0.1s;
    }

    .calendar-animation .day:nth-child(3) {
        animation-delay: 0.2s;
    }

    .calendar-animation .day:nth-child(4) {
        animation-delay: 0.3s;
    }

    .calendar-animation .day:nth-child(5) {
        animation-delay: 0.4s;
    }

    .calendar-animation .day:nth-child(6) {
        animation-delay: 0.5s;
    }

    .calendar-animation .day:nth-child(7) {
        animation-delay: 0.6s;
    }

    .calendar-animation .day:nth-child(8) {
        animation-delay: 0.7s;
    }

    .calendar-animation .day:nth-child(9) {
        animation-delay: 0.8s;
    }

    @keyframes dayPulse {

        0%,
        100% {
            transform: scale(1);
            opacity: 0.5;
        }

        50% {
            transform: scale(1.3);
            opacity: 1;
        }
    }

    .editor-overlay .typing {
        white-space: nowrap;
        overflow: hidden;
        font-size: 16px;
        color: #fff;
        font-weight: bold;
    }

}

@media(max-width:1024px) {

    .panel-resizer,
    .resizer,
    .resizer-horizontal {
        display: none;
    }
}

.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #ccc;
    padding: 0 10px 10px 10px;
    position: relative;
}

textarea::selection {
    background: #fff;
    color: #000;
}


.editor-header {
    background: #2d2d2d;
    color: #fff;
    padding: 5px 10px;
    font-weight: bold;
    text-align: center;
}

textarea {
    flex: 1;
    height: 100%;
    resize: none;
    padding: 8px;
    font-family: monospace;
    font-size: 14px;
    overflow: auto;
}

.preview {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#live-preview {
    flex: 1;
    width: 100%;
    border: none;
    height: 100%;
}


.editor-right .resizer,
.editor-right .panel-width-resizer,
.editor-left .panel-width-resizer,
.editor-center .resize-handle,
.editor-left .resize-handle {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media(max-width:1024px) {
    .editor-panel {
        display: none;
    }

    .editor-panel.active {
        display: block;
    }
}



.editor-sidebar {
    display: none;
}

.preview-panel {
    flex: 1;
    overflow: hidden;
}

@media (max-width: 1024px) {
    #live-preview {
        height: 100%;
        padding-bottom: 30px;
    }

    .input__row {
        padding: 15px;
    }

    .editor-container {
        display: flex;
        flex-direction: column;
        padding-left: 28px;
    }


    .editor-sidebar {
        display: flex;
        flex-direction: column;
        background: #222;
        padding: 5px;
        gap: 10px;
        align-items: center;
        position: fixed;
        height: 100vh;
        width: 31px;
        left: 0;
    }

    .editor-sidebar button {
        background: #ccc;
        border: none;
        color: #000;
        font-size: 18px;
        padding: 10px;
        cursor: pointer;
        border-radius: 8px;
    }

    .editor-sidebar button.active {
        background: #444;
        color: #fff;
    }

    .editors {
        flex: 1;
        padding: 10px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-width: unset;
        max-width: unset;
    }

    textarea {
        max-height: unset;
        height: 100%;
    }
}

header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.siteheader {
    background: #111;
    padding: 10px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 2000;
}

.siteheader h1 {
    font-size: 1.1rem;
    color: #fff;
    font-weight: bold;
}

.siteheader span {
    font-size: .9rem;
    color: #fff;
    font-weight: bold;
}

.sitheader--logo {
    width: 30px;
    height: 30px;
}

.sitheader--logo img {
    width: 100%;
    height: 100%;
}

.panel-resizer {
    background: #ddd;
    cursor: row-resize;
    transition: background 0.2s ease;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%
}

.panel-resizer:hover {
    background: #bbb;
}

.editors--switch {
    float: right;
    margin-left: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media(max-width:1024px) {
    .editors--switch {
        display: none;
    }
}

.editors--switch h2 {
    font-size: 16px;
    color: #fff;
}


.editors--switch button {
    width: 40px;
    background: #fff;
    padding: 7px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0;
}



.editors--switch button.dropdown-btn {
    border: 1px solid #ccc;
    border-right: 0;
    border-radius: 0px;
    background: none;
}

.editors--switch button.dropdown-btn.active {
    background: #ccc;
}

.editors--switch button.dropdown-btn:first-of-type svg {
    transform: rotate(-90deg);
}

.editors--switch button.dropdown-btn:last-of-type {
    border-right: 1px solid #ccc;
}

.editors--switch button.dropdown-btn:last-of-type svg {
    transform: rotate(90deg);
}

@keyframes dropdownFlipIn {
    0% {
        opacity: 0;
        transform: rotateX(-90deg) scaleY(0.8);
    }

    100% {
        opacity: 1;
        transform: rotateX(0) scaleY(1);
    }
}

@keyframes dropdownFlipOut {
    0% {
        opacity: 1;
        transform: rotateX(0) scaleY(1);
    }

    100% {
        opacity: 0;
        transform: rotateX(-90deg) scaleY(0.8);
    }
}

.view-switcher-dropdown.dropdown-show {
    animation: dropdownFlipIn 0.3s ease forwards;
}

.view-switcher-dropdown.dropdown-hide {
    animation: dropdownFlipOut 0.3s ease forwards;
}

.view-switcher-dropdown {
    display: flex;
    justify-content: space-between;
    overflow: hidden;
}

#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#page-loader img {
    width: 150px;
    height: 150px;
    animation: loaderPulse 1.2s infinite;
    border-radius: 50%;
    display: block;
    position: relative;
    z-index: 2;
}

.progress-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
    z-index: 1;
}

.progress-ring__circle {
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 0.2s linear;
}


@keyframes loaderPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

#page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}


form#search__popupmain {
    display: flex;
    align-items: center;
    gap: 5px;
}

form#search__popupmain label {
    font-size: 12px;
    font-family: sans-serif;
}

.loader__calendar {
    width: 240px;
    height: 220px;
    margin: 20px 0 10px 0;
    padding: 6px;
    border: 2px solid #333;
    border-radius: 15px;
    font-family: sans-serif;
    background: #000;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    animation: shake 1.5s infinite;
}

.loader__month {
    color: #fff;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin: 10px;
}

.loader__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    gap: 2px;
    flex: 1;
}

.loader__day {
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    border: 1px solid #fff;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.3s, transform 0.3s, color 0.3s;
}

@keyframes pickhand {
    0% {
        transform: scale(1);
        background: #fff;
        color: #000;
    }

    30% {
        transform: scale(1.2);
        background: #fff;
        color: #000;
    }

    60% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        background: #fff;
        color: #000;
    }
}

.loader__day.picked {
    animation: pickhand 0.8s ease forwards;
}

.loader__day.hand::after {
    content: "🤚";
    filter: grayscale(60%);
    position: absolute;
    font-size: 20px;
    bottom: -2px;
    right: -2px;
    opacity: 0;
    transform: scale(0.5);
    animation: handPress 0.6s ease forwards;
}

@keyframes handPress {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-10px);
    }

    50% {
        opacity: 1;
        transform: scale(1.1) translateY(0);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.loading-calendar {
    width: 242px;
    height: 140px;
    margin-bottom: 10px;
    border: 2px solid #333;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    animation: shake 1.5s infinite;
    padding: 0 10px;
    box-sizing: border-box;
}


.load__calmonth {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #fff;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    animation: typing 2s steps(20, end) infinite;
}

@keyframes typing {
    0% {
        width: 0;
    }

    50% {
        width: 100%;
    }

    100% {
        width: 0;
    }
}

.load__caldays {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
}

.load__calday {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    font-size: 16px;
    color: #fff;
    font-weight: bold;
    animation: pick 1s ease forwards;
    animation-delay: var(--delay);
    animation-direction: alternate;
    animation-iteration-count: infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-2px) rotate(-1deg);
    }

    50% {
        transform: translateX(2px) rotate(1deg);
    }

    75% {
        transform: translateX(-1px) rotate(-0.5deg);
    }
}

@keyframes pick {
    0% {
        background: #eee;
        transform: scale(0.5) rotateX(90deg);
    }

    40% {
        background: #000;
        transform: scale(1.2) rotateX(-20deg);
    }

    60% {
        background: #000;
        transform: scale(1) rotateX(0deg);
    }

    100% {
        background: #eee;
        transform: scale(1) rotateX(0deg);
    }
}

.offline-message {
    position: fixed;
    inset: 0;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000000d6;
    color: white;
    text-align: center;
    font-weight: bold;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: progress;
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeDown 0.4s forwards ease;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fadeUp {
    animation: fadeUp 0.4s forwards ease;
}

@keyframes fadeUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}