/* HTML Input Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f3f3f3;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #f3f3f3;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

.modal-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f3f3f3;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-button {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    background-color: #d9d9d9;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #000;
}

.word-counter {
    font-size: 16px;
    color: #666;
    white-space: nowrap;
}

.modal-body {
    flex-grow: 1;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
}

.modal-footer {
    padding: 16px;
    display: flex;
    justify-content: center;
    gap: 12px;
    background-color: #f3f3f3;
}

#htmlInputField {
    width: 100%;
    height: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    flex: 1;
    resize: none;
    box-sizing: border-box;
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

#htmlInputField:focus {
    outline: none;
}

.save-button {
    padding: 12px 0;
    width: 120px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid black;
    background-color: #00FEA6;
    color: black;
    transition: background-color 0.2s;
}

.save-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.word-counter .exceeded {
    color: #e53935;
    font-weight: bold;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .modal-header {
        padding: 12px;
    }

    .modal-body {
        padding: 0 12px;
    }

    .modal-footer {
        padding: 12px;
    }

    #htmlInputField {
        border-radius: 8px;
    }

    .save-button {
        width: 100px;
    }
}