.delete_write svg {
    width: 20px;
    height: 20px;
    filter: invert(1);
}

[data-theme="light"] .delete_write svg {
    filter: invert(0);
}

.copy_write_link svg {
    max-width: 16px;
    max-height: 16px;
    filter: invert(0);
}

@media (max-width: 768px) {
    .copy_write_link svg {
        max-width: 14px;
        max-height: 14px;
    }
}

.block_2_write {
    width: 800px;
    padding: 20px;
    position: relative;
    padding-bottom: 25px;
    border-radius: 10px;
    overflow: hidden;
}

.title_container {
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .title_container {
        flex-direction: column;
    }
}

.title_container .content_status {
    margin: 0;
    color: #999;
}

.title_container h2 {
    margin: 0;
}

.content_status {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 10px 20px;
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text_color);
    opacity: 0.5;
    text-align: right;
    font-size: 14px;
    z-index: 1;
}

.title_container .word_count {
    font-size: 14px;
    opacity: 0.7;
}

.content_status_container {
    display: none;
}

.content_title {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #333;
    border-radius: 5px;
    background-color: #1c1b1b;
    color: var(--text_color);
    font-size: 16px;
    font-family: 'DM Sans', sans-serif;
}

.editor_container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.editor_tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 8px;
    position: relative;
    width: fit-content;
}

[data-theme="light"] .editor_tabs {
    background: rgba(0, 0, 0, 0.05);
}

.editor_tabs::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

[data-theme="light"] .editor_tabs::before {
    background: rgba(0, 0, 0, 0.1);
}

.editor_tabs[data-active-tab="view"]::before {
    transform: translateX(100%);
}

.tab_button {
    padding: 8px 24px;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
    min-width: 100px;
    text-align: center;
}

.tab_button:hover {
    color: #fff;
}

.tab_button.active {
    color: #fff;
}

[data-theme="light"] .tab_button.active, [data-theme="light"] .tab_button:hover {
    color: black;
}

.album_actions_container {
    width: 100%;
    min-height: min-content;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    margin-bottom:10px;
    max-width: 840px;
}

.album_actions_write {
    background-color: var(--block_background);
    -webkit-box-shadow: var(--block_shadow); 
    box-shadow: var(--block_shadow);
    border-radius: 10px;
    padding-left: 10px;
    padding-right: 10px;
}

.editor_toolbar {
    display: flex;
    gap: 8px;
    padding: 8px 8px 8px 0px;
    position: relative;
    align-items: center;
    border-radius: 10px 10px 0 0;
    min-height: 52px;
    width: 100%;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-top: -20px;
    flex-wrap: wrap;
}

.editor_toolbar.active {
    opacity: 1;
    pointer-events: all;
}

.editor_button_group {
    display: flex;
    gap: 4px;
    padding: 0px 4px;
    background: var(--input_background);
    border-radius: 6px;
    height: 36px;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

.editor_toolbar > *:last-child {
    margin-right: 10px;
}

.editor_button_group:not(:last-child) {
    margin-right: 4px;
}

.editor_button {
    background: transparent;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    flex-shrink: 0;
    position: relative;
    color: var(--text_color);
}

.editor_button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .editor_button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.8);
}

.editor_button.active {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .editor_button.active {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.9);
}

.editor_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.editor_button svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.editor_button[data-command="bold"] {
    font-weight: bold;
}

.editor_button[data-command="italic"] {
    font-style: italic;
}

.editor_button[data-command="underline"] {
    text-decoration: underline;
}

.editor_button[data-command="strikeThrough"] {
    text-decoration: line-through;
}

.dropdown_menu {
    position: absolute;
    top: calc(100% + 6px);
    background: var(--block_background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px;
    display: none;
    min-width: 160px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.2s, transform 0.2s;
    transform-origin: top center;
}

[data-theme="light"] .dropdown_menu {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.dropdown_menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.dropdown_item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    color: var(--text_color);
    opacity: 0.7;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.dropdown_item:hover {
    background: rgba(255, 255, 255, 0.05);
    opacity: 0.9;
}

[data-theme="light"] .dropdown_item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dropdown_item.active {
    background: rgba(255, 255, 255, 0.08);
    opacity: 1;
}

[data-theme="light"] .dropdown_item.active {
    background: rgba(0, 0, 0, 0.08);
}

.format_dropdown {
    min-width: 160px;
}

.format_dropdown .dropdown_item {
    font-size: 14px;
    padding: 8px 12px;
}

.format_dropdown .dropdown_item[data-value="1"] {
    font-size: 16px;
    font-weight: bold;
}

.format_dropdown .dropdown_item[data-value="2"] {
    font-size: 15px;
    font-weight: bold;
}

.format_dropdown .dropdown_item[data-value="3"] {
    font-size: 14px;
    font-weight: bold;
}

.color_dropdown {
    min-width: 260px;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
}

.color_box {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    border-radius: 3px;
    background-color: #fff;
}

[data-theme="light"] .color_box {

}

.editor_button:hover .color_box {
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .editor_button:hover .color_box {
    border-color: rgba(0, 0, 0, 0.2);
}

.editor_button.active .color_box {
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .editor_button.active .color_box {
    border-color: rgba(0, 0, 0, 0.3);
}

.color_section {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .color_section {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.color_section:last-child {
    border-bottom: none;
}

.color_label {
    font-size: 13px;
    color: var(--text_color);
    opacity: 0.7;
    margin-bottom: 8px;
    font-weight: 500;
}

.color_grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.color_option {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: transparent;
}

[data-theme="light"] .color_option {
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.color_option:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .color_option:hover {
    border-color: rgba(0, 0, 0, 0.3);
}

.color_option.add_color {
    background: transparent;
    color: var(--text_color);
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .color_option.add_color {
    border: 2px dashed rgba(0, 0, 0, 0.3);
}

.color_option.no_highlight,
.color_option.no_color {
    background: transparent;
    color: var(--text_color);
    font-size: 18px;
}

.color_option.no_color:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .color_option.no_color:hover {
    background: rgba(0, 0, 0, 0.1);
}

.bottom_bar_editor {
    width: 100%;
    height: max-content;
    display: flex;
    gap: 10px;
    flex-direction: row;
    justify-content: flex-end;
    margin-top: 15px;
}

.custom_editor,
.preview_content {
    width: 100%;
    box-sizing: border-box; /* ensures padding is included in width calculations */
    height: 300px;
    padding-bottom: 50px;
    color: var(--text_color);
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    border: none;
    outline: none;
    overflow-y: auto;
    margin: 0;
    border-radius: 0 0 10px 10px;
}

.custom_editor {
    padding: 20px;
}

/* alignment styles */
.custom_editor > *[style*="text-align"] {
    padding: 0;
    margin: 0px 0;
    line-height: 1.6;
}

.custom_editor > div:first-child,
.custom_editor > p:first-child {
    margin-top: 0;
}

.custom_editor > div:last-child,
.custom_editor > p:last-child {
    margin-bottom: 0;
}

/* ensure block elements maintain consistent spacing */
.custom_editor div,
.custom_editor p {
    min-height: 1.6em;
    padding: 0;
    margin: 0px 0;
    line-height: 1.6;
}

/* handle empty blocks */
.custom_editor div:empty,
.custom_editor p:empty {
    min-height: 1.6em;
}

.preview_content {
    padding: 3px;
}

.custom_editor h1,
.preview_content h1 {
    font-size: 26px;
    margin-top: 14px;
    margin-right: 0;
    margin-bottom: 10px;
    margin-left: 0;
    color: #fff;
}

.custom_editor h2,
.preview_content h2 {
    font-size: 22px;
    margin-top: 12px;
    margin-right: 0;
    margin-bottom: 6px;
    margin-left: 0;
    color: #fff;
}

.custom_editor h3,
.preview_content h3 {
    font-size: 16px;
    margin-top: 8px;
    margin-right: 0;
    margin-bottom: 4px;
    margin-left: 0;
    color: #fff;
}

.custom_editor p {
    margin: 0px 0;
    line-height: 1.6;
}

.custom_editor ul, 
.custom_editor ol,
.preview_content ul,
.preview_content ol {
    margin-top:2px;
    margin-bottom: 2px;
    padding-left: 24px;
}

.custom_editor a,
.preview_content a {
    color: #4a9eff;
    text-decoration: none;
}

.custom_editor a:hover {
    text-decoration: underline;
}

.preview_content a:hover {
    opacity: 0.8;
}

.custom_editor li {
    margin: 6px 0;
}

.custom_editor blockquote {
    margin: 16px 0;
    padding-left: 16px;
    border-left: 3px solid #333;
    color: #aaa;
    font-style: italic;
}

.custom_editor code {
    background-color: #2a2a2a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

.custom_editor pre {
    background-color: #2a2a2a;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.custom_editor pre code {
    background-color: transparent;
    padding: 0;
}

#contentForm {
    position: relative;
    width: 100%;
    margin: 0;
}

#continue_button {
    position: relative;
    margin: 0;
}

.upload_submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom_editor::-webkit-scrollbar {
    width: 8px;
}

.custom_editor::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

.custom_editor::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.custom_editor::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.save_status {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 4px;
    margin-right: auto;
    font-size: 14px;
    transition: all 0.3s ease;
}

.save_status.success {
    background-color: rgba(85, 189, 118, 0.2);
    color: #55bd76;
}

.save_status.error {
    background-color: rgba(255, 74, 74, 0.2);
    color: #ff4a4a;
}

.custom_editor[contenteditable="false"] {
    opacity: 0.8;
    cursor: not-allowed;
    position: relative;
}

.custom_editor[contenteditable="false"]::before {
    content: "View only mode - enter edit code to make changes";
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--text_color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
}

@keyframes edit-enabled-pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(74, 144, 226, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 144, 226, 0); }
}

.edit_enabled {
    animation: edit-enabled-pulse 1s ease-out;
    border: 1px solid rgba(74, 144, 226, 0.6) !important;
}

@media (max-width: 480px) {
    .block_2_upload {
        width: 100% !important;
        margin: 0;
        padding: 20px;
        border-radius: 0;
    }

    .content_title {
        font-size: 14px;
    }

    .editor_container {
        margin: 15px 0;
    }

    .editor_toolbar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 8px 8px 8px 0px;
        width: calc(100% + 10px);
        padding-right: 20px;
    }

    .editor_button_group {
        flex-shrink: 0;
    }

    .dropdown_menu {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 90vw;
        max-height: 80vh;
        overflow-y: auto;
    }

    .dropdown_menu.show {
        transform: translate(-50%, -50%);
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .block_2_upload {
        width: 90% !important;
        max-width: 800px;
    }
}

@media (max-width: 767px) and (min-width: 480px) {
    .block_2_upload {
        width: 95% !important;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .custom_editor,
    .preview_content {
        height: 250px;
    }
}

/* Modal styles moved to shared/popupactions.css */

.emoji_picker {
    width: 320px;
    background: var(--block_background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: fixed;
    z-index: 1000;
    display: none;
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.emoji_search {
    margin-bottom: 12px;
}

.emoji_search_input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text_color);
    font-size: 14px;
}

.emoji_search_input:focus {
    outline: none;
    border-color: var(--accent_color);
}

.emoji_grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.emoji_item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 20px;
    transition: background-color 0.2s;
    background: none;
    border: none;
    padding: 0;
}

.emoji_item:hover {
    background: rgba(255, 255, 255, 0.1);
}