@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400&subset=latin,cyrillic,cyrillic-ext);

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #282a36;
    color: #444;
    font-family: 'Ubuntu', sans-serif;
}

header {
    padding: 10px 20px;
    background: #0a0606;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.07);
    z-index: 10;
}

#editor-container {
    flex-grow: 1;
    min-height: 0;
    background: #282a36;
    overflow: hidden;
}

#code-editor {
    display: none;
}

.CodeMirror {
    height: 100%;
    font-size: 16px;
}

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

.button {
    display: inline-block;
    padding: 10px 20px;
    text-align: center;
    border: 0;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.button--white {
    background-color: #f9f9f9;
    color: #484848;
    border: 1px solid #eee;
}

.button--white:hover {
    background-color: #f0f0f0;
}

.button--black {
    background-color: #444;
    color: #fff;
}

.button--black:hover {
    background-color: #575757;
}

.button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.button--danger {
    color: #ff5555;
}

.link-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.link-input-wrapper--hidden {
    display: none;
}

.link-input {
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 10px 15px 10px 35px;
    border-radius: 30px;
    width: 200px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    outline: none;
}

.link-icon {
    position: absolute;
    left: 12px;
    width: 14px;
    height: 14px;
    fill: #ccc;
}

select.button {
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 8px auto;
}

.lang-dropdown {
    position: relative;
}

.lang-dropdown__native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.lang-dropdown__trigger {
    min-width: 160px;
    padding-right: 30px;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 8px auto;
}

.lang-dropdown__trigger .lang-icon,
.lang-dropdown__item .lang-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 3px;
}

.lang-dropdown__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 145px;
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1100;
}

.lang-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #484848;
    white-space: nowrap;
}

.lang-dropdown__item:hover {
    background: #f0f0f0;
}

.lang-dropdown--open .lang-dropdown__trigger {
    background-color: #f0f0f0;
}

[tooltip] {
    position: relative;
    cursor: pointer;
}

[tooltip]::after {
    content: attr(tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #353539;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    z-index: 1000;
}

[tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: #fff;
    margin: 10% auto;
    padding: 25px;
    border-radius: 15px;
    width: 350px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
}

.modal-content h3 {
    margin-top: 0;
    color: #444;
}

.modal-content--password {
    text-align: center;
}

.modal-protected-icon {
    display: block;
    width: 80px;
    height: auto;
    margin: 0 auto 16px;
}

.modal-content--password h3 {
    margin-bottom: 8px;
}

.modal-protected-text {
    margin: 0 0 16px;
    color: #888;
    font-size: 14px;
    line-height: 1.5;
}

.modal-content input,
.modal-content select {
    width: 100%;
    margin: 10px 0 20px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #f9f9f9;
    outline: none;
    box-sizing: border-box;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    background: #353539;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
}

.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--error {
    background: #ff5555;
}

.toast--success {
    background: #50fa7b;
    color: #282a36;
}
